Commit 061c00e5 authored by Ilya Rassadin's avatar Ilya Rassadin
Browse files

Introduce override variable for DEPLOY_HOST_PATH

parent 345e58e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ setup_environment_vars:
    name: $ENVIRONMENT_NAME
  before_script:
    - *set_ssh_keys
    - export DEPLOY_HOST_PATH="${DEPLOY_HOST_PATH_OVERRIDE:-$DEPLOY_HOST_PATH}"
    - echo $DEPLOY_HOST_PATH
    - echo "set project root perms to $PROJECT_ROOT_PERMS"
  script: []
+18 −0
Original line number Diff line number Diff line
@@ -99,6 +99,24 @@ setup() {
  assert_success
}

@test "deploy composer: DEPLOY_HOST_PATH_OVERRIDE redirects rsync to alternate path" {
  ssh_root mkdir -p /var/www/alt-vhost

  # Simulate .before_deploy_code before_script applying the job-level override
  export DEPLOY_HOST_PATH_OVERRIDE="root@$RECIPIENT_HOST:/var/www/alt-vhost"
  export DEPLOY_HOST_PATH="${DEPLOY_HOST_PATH_OVERRIDE:-$DEPLOY_HOST_PATH}"

  run run_deploy_composer
  assert_success

  run ssh_root test -f "/var/www/alt-vhost/vendor/acme/Foo.php"
  assert_success

  # acme/Foo.php is not in recipient-seed, so finding it at PROJECT_ROOT would mean the override was ignored
  run ssh_root test -f "$PROJECT_ROOT/vendor/acme/Foo.php"
  assert_failure
}

@test "deploy composer: stale cms file is removed when deploying cms path" {
  export COMPOSER_DEPLOY_PATHS="vendor/:vendor/ www/cms/:${DOC_ROOT_NAME}/cms/"
  setup_env