Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GOVCMS-7646] Remove early exit for config import. #221

Open
wants to merge 2 commits into
base: 9.x-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions scripts/deploy/govcms-config-import
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@ set -euo pipefail
#

LAGOON_ENVIRONMENT_TYPE=${LAGOON_ENVIRONMENT_TYPE:-production}
GOVCMS_DEPLOY_WORKFLOW_CONFIG=${GOVCMS_DEPLOY_WORKFLOW_CONFIG:-import}
CONFIG_DEFAULT_DIR=${CONFIG_DEFAULT_DIR:-/app/config/default}
CONFIG_DEV_DIR=${CONFIG_DEV_DIR:-/app/config/dev}
LAGOON_GIT_SAFE_BRANCH=${LAGOON_GIT_SAFE_BRANCH:-master}

echo "GovCMS Deploy :: Configuration import"

if [ "$GOVCMS_DEPLOY_WORKFLOW_CONFIG" != "import" ]; then
echo "[skip]: Workflow is not set to import."
exit 0
fi

if [[ "$LAGOON_GIT_SAFE_BRANCH" = internal-govcms-update* ]]; then
echo "[skip]: Configuration cannot be imported on update branches."
exit 0
Expand Down
33 changes: 0 additions & 33 deletions tests/bats/deploy/govcms-config-import.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,12 @@ load ../_helpers_govcms
assert_equal 0 "$(mock_get_call_num "${mock_drush}")"
}

# Workflow: retain
# dir: /app/config/default
@test "Config import: retain" {
mock_drush=$(mock_command "drush")
export GOVCMS_DEPLOY_WORKFLOW_CONFIG=retain

run scripts/deploy/govcms-config-import >&3

assert_output_contains "GovCMS Deploy :: Configuration import"
assert_output_contains "[skip]: Workflow is not set to import."

assert_equal 0 "$(mock_get_call_num "${mock_drush}")"
}

# Workflow: import
# dir: /app/config/default
@test "Config import: import" {
mock_drush=$(mock_command "drush")
export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import

run scripts/deploy/govcms-config-import >&3

assert_output_contains "GovCMS Deploy :: Configuration import"
assert_output_contains "[skip]: There is no configuration."

assert_equal 0 "$(mock_get_call_num "${mock_drush}")"
}

# Workflow: import
# dir: ./fixures/config/default
@test "Config import: default config" {
mock_drush=$(mock_command "drush")
mock_set_output "${mock_drush}" "Successful" 1

export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import
export CONFIG_DEFAULT_DIR="tests/bats/deploy/fixtures/config/default"
export CONFIG_DEV_DIR="/tmp/nodir"

Expand All @@ -75,7 +46,6 @@ load ../_helpers_govcms
mock_set_output "${mock_drush}" "Successful" 1

export LAGOON_ENVIRONMENT_TYPE="production"
export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import
export CONFIG_DEV_DIR="tests/bats/deploy/fixtures/config/dev"

run scripts/deploy/govcms-config-import >&3
Expand All @@ -93,7 +63,6 @@ load ../_helpers_govcms
mock_drush=$(mock_command "drush")
mock_set_output "${mock_drush}" "Successful" 1

export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import
export CONFIG_DEV_DIR="tests/bats/deploy/fixtures/config/dev"
export LAGOON_ENVIRONMENT_TYPE="development"

Expand All @@ -114,7 +83,6 @@ load ../_helpers_govcms
mock_drush=$(mock_command "drush")
mock_set_output "${mock_drush}" "Successful" 1

export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import
export LAGOON_ENVIRONMENT_TYPE="production"
export CONFIG_DEFAULT_DIR="tests/bats/deploy/fixtures/config/default"
export CONFIG_DEV_DIR="tests/bats/deploy/fixtures/config/dev"
Expand All @@ -136,7 +104,6 @@ load ../_helpers_govcms
mock_drush=$(mock_command "drush")
mock_set_output "${mock_drush}" "Successful" 1

export GOVCMS_DEPLOY_WORKFLOW_CONFIG=import
export LAGOON_ENVIRONMENT_TYPE="development"
export CONFIG_DEFAULT_DIR="tests/bats/deploy/fixtures/config/default"
export CONFIG_DEV_DIR="tests/bats/deploy/fixtures/config/dev"
Expand Down