Skip to content

Commit

Permalink
fix stage deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
casey-rapnicki-bixal committed Nov 18, 2024
1 parent b169472 commit a16a495
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 20 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/cloudgov-deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
DRUPAL_INSTANCES=${{ vars.MAIN_INSTANCES }}
;;
stage)
CF_SPACE="stage"
CF_SPACE="staging"
COMPOSER_DEV=0
DRUPAL_MEMORY=${{ vars.STAGE_CMS_MEMORY }}
DRUPAL_INSTANCES=${{ vars.STAGE_INSTANCES }}
Expand All @@ -44,7 +44,9 @@ jobs:
echo "HASH_SALT=${{ secrets.HASH_SALT }}" | tee -a $GITHUB_ENV
echo "WAF_NAME=waf"| tee -a $GITHUB_ENV
[ "${COMPOSER_DEV}" = "1" ] && sed -i 's/--no-dev //' .bp-config/options.json
if [ "${COMPOSER_DEV}" = "1" ]; then
sed -i 's/--no-dev //' .bp-config/options.json || exit 0
fi
- name: Set repo name
run: echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/terraform-deploy-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ jobs:
uses: actions/checkout@v4
- name: Set env.BRANCH
run: |
BRANCH=develop
#BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)
BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)
case ${BRANCH} in
develop)
CF_SPACE="dev"
;;
main)
CF_SPACE="prod"
;;
stage)
CF_SPACE="staging"
;;
esac
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "CF_SPACE=${CF_SPACE}" >> $GITHUB_ENV
Expand Down Expand Up @@ -51,8 +53,7 @@ jobs:
env:
TF_BASTION: "${{ secrets.TF_BASTION }}"
run: |
#declare -a commands=("rm -rf ${REPO_NAME}" "git clone https://github.com/${GITHUB_REPOSITORY_OWNER}/${REPO_NAME}.git" "cd ${REPO_NAME}" "git checkout ${BRANCH}")
declare -a commands=("rm -rf ${REPO_NAME}" "git clone -b "feature/dg-98-build-and-configure-pipeline" https://github.com/${GITHUB_REPOSITORY_OWNER}/${REPO_NAME}.git")
declare -a commands=("rm -rf ${REPO_NAME}" "git clone -b ${BRANCH} https://github.com/${GITHUB_REPOSITORY_OWNER}/${REPO_NAME}.git")
for command in "${commands[@]}"; do
./scripts/pipeline/cloud-gov-remote-command.sh "${TF_BASTION}" "${command}" 1
done
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_config: &defaults
buildpacks:
- https://github.com/cloudfoundry/apt-buildpack
- php_buildpack
disk_quota: 2G
disk_quota: 4G
env:
COMPOSER_DEV: ${COMPOSER_DEV}
environment: ${CF_SPACE}
Expand Down
56 changes: 43 additions & 13 deletions terraform/infra/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,11 @@ locals {
external_applications = {
drupal = {

environement = "dev"
environement = terraform.workspace

## Port is the application listening on.
port = var.mtls_port
},
drupal = {

environement = "main"

## Port is the application listening on.
port = var.mtls_port
}
}
}

## The various environment settings to be deployed.
Expand Down Expand Up @@ -459,7 +452,7 @@ locals {
#################################


main = merge(
prod = merge(
{
## Applications to deploy.
apps = local.globals.apps
Expand All @@ -479,16 +472,53 @@ locals {
}
}
)

#################################
##
## __ _
## / _\ |_ __ _ __ _ ___
## \ \| __/ _` |/ _` |/ _ \
## _\ \ || (_| | (_| | __/
## \__/\__\__,_|\__, |\___|
## |___/
##
#################################

staging = merge(
{
## Applications to deploy.
apps = local.globals.apps
services = local.globals.services
},
{
## Passwords that need to be generated for this environment.
## These will actually use the sha256 result from the random module.
passwords = {
hash_salt = {
length = 32
}
cron_key = {
length = 32
}
}
}
)
}

## Map of the 'all' environement and the current workspace settings.
env = merge(try(local.envs.all, {}), try(local.envs[terraform.workspace], {}))
env = merge(
try(
local.envs.all, {}
),
try(
local.envs[terraform.workspace], {}
)
)

service_bindings = merge(
service_bindings = merge(
flatten(
[
for key, value in try(local.env.services, {}) : {
#svc_value.name => svc_value
"${key}" = value
}
]
Expand Down

0 comments on commit a16a495

Please sign in to comment.