diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d154602cf7..8744b04c2ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2704,12 +2704,15 @@ workflows: - build_storybook filters: branches: - only: main + only: nolonger_main - build_storybook: requires: - anti_virus - pre_deps_yarn + filters: + branches: + only: nolonger_main - push_otel_collector_image_prd: requires: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ff130ec1cc..d231575a404 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,7 @@ variables: DOCKER_TOKEN: DOCKER_TOKEN registry: https://registry.hub.docker.com/ + # #Circle CI need to replace #CIRCLE_PROJECT_USERNAME: "my-username" # Replace with the actual namespace CIRCLE_PROJECT_REPONAME: "mymove" # Replace with your GitLab project name @@ -39,6 +40,8 @@ variables: CLIENT_IGNORE_BRANCH: &client_ignore_branch placeholder_branch_name SERVER_IGNORE_BRANCH: &server_ignore_branch placeholder_branch_name + OTEL_IMAGE_TAG: &otel_image_tag "git-$OTEL_VERSION-$CI_COMMIT_SHORT_SHA" + RUNNER_TAG: &runner_tag milmove DOCKER_RUNNER_TAG: &docker_runner_tag eks_cluster_runner @@ -80,6 +83,8 @@ stages: fi .setup_aws_vars_dp3: &setup_aws_vars_dp3 + - export SERVICE_RESERVATION_CPU=2048 + - export SERVICE_RESERVATION_MEM=4096 - | if [[ "$DP3_ENV" == "exp" || "$DP3_ENV" == "loadtest" || "$DP3_ENV" == "demo" ]]; then export ENV=$(echo ${DP3_ENV} | tr '[:lower:]' '[:upper:]'); @@ -101,6 +106,12 @@ stages: export APP_ENVIRONMENT=$DP3_ENV fi +.setup_aws_vars_com_dev: &setup_aws_vars_com_dev + - export AWS_DEFAULT_REGION=$COM_REGION + - export AWS_ACCOUNT_ID=$DEV_ACCOUNT_ID + - export AWS_ACCESS_KEY_ID=$DEV_ACCESS_KEY_ID + - export AWS_SECRET_ACCESS_KEY=$DEV_SECRET_KEY + .setup_aws_vars_stg: &setup_aws_vars_stg - export AWS_DEFAULT_REGION=$STG_REGION - export AWS_ACCOUNT_ID=$STG_ACCOUNT_ID @@ -119,6 +130,9 @@ stages: - export AWS_ACCOUNT_ID=$PRD_ACCOUNT_ID - export AWS_ACCESS_KEY_ID=$PRD_ACCESS_KEY_ID - export AWS_SECRET_ACCESS_KEY=$PRD_SECRET_ACCESS_KEY + - export SERVICE_RESERVATION_CPU=2048 + - export SERVICE_RESERVATION_MEM=8192 + .setup_tls_vars_prd: &setup_tls_vars_prd - export TLS_CERT=$PRD_MOVE_MIL_DOD_TLS_CERT @@ -241,14 +255,6 @@ stages: export OKTA_OFFICE_GROUP_ID=notrealgroupId export OKTA_CUSTOMER_GROUP_ID=notrealcustomergroupId -# -# .setup_host_intergration_tests: &setup_host_intergration_tests -# - echo "Setting up /etc/hosts for local domain simulation" -# - echo "127.0.0.1 milmovelocal" | sudo tee -a /etc/hosts -# - echo "127.0.0.1 officelocal" | sudo tee -a /etc/hosts -# - echo "127.0.0.1 adminlocal" | sudo tee -a /etc/hosts -# - echo "127.0.0.1 primelocal" | sudo tee -a /etc/hosts - .setup_env_intergration_mtls: &setup_env_intergration_mtls - | echo "Setting up environment variables" @@ -510,16 +516,18 @@ deploy_storybook_dp3: - build_storybook before_script: - *setup_milmove_env + - *setup_aws_vars_com_dev script: - - echo "TODO Add steps" - - echo "deploy_storybook_dp3" + - echo "Deploying Storybook to S3..." + - ./scripts/push-storybook-assets "storybook.dp3.us" after_script: - *announce_failure + allow_failure: true artifacts: paths: - /builds/milmove/mymove/storybook-static rules: - - *check_main + - *check_main compile_app_client: stage: build @@ -1149,7 +1157,7 @@ build_push_app_dp3: - *kaniko_before_setup script: - echo "Building and Pushing app Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1173,7 +1181,7 @@ build_push_migrations_dp3: - *kaniko_before_setup script: - echo "Building and Pushing migrations Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1197,7 +1205,7 @@ build_push_tasks_dp3: - *kaniko_before_setup script: - echo "Building tasks Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1219,17 +1227,20 @@ push_otel_collector_image_dp3: - compile_app_server - compile_app_client script: - - echo "Logging in to Amazon ECR with Crane..." - - aws ecr get-login-password --region ${AWS_REGION} | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin + - echo "Logging in to DockerHub with Crane..." + - echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin - - echo "Pulling the AWS OTel Collector image from the public registry with Crane..." - - crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar + - echo "Pulling the AWS OTel Collector image from DockerHub..." + - crane pull ${ECR_REPOSITORY_OTEL}:${OTEL_VERSION} image.tar - - echo "Pushing the image to our private ECR using Crane..." - - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA} + - echo "Logging into AWS ECR with Crane..." + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com -u AWS --password-stdin - - echo "Cleaning up the temporary image file..." - - rm image.tar + - echo "Pushing the image to our private ECR using Crane..." + - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${OTEL_IMAGE_TAG} + + - echo "Cleaning up temporary image file..." + - rm image.tar allow_failure: false after_script: - *announce_failure @@ -1256,7 +1267,7 @@ deploy_migrations_dp3: script: # Step 1: Get the Digest - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) # Step 2: Ensure exclusive execution and Snapshot - echo "Snapshotting database" - ./scripts/rds-snapshot-app-db "$APP_ENVIRONMENT" @@ -1287,7 +1298,7 @@ deploy_tasks_dp3: - *setup_release_dp3 script: - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Deploying GHC fuel price data task service" - ./scripts/ecs-deploy-task-container save-ghc-fuel-price-data "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}" - echo "Deploying payment reminder email task service" @@ -1322,9 +1333,9 @@ deploy_app_client_tls_dp3: # - echo "Comparing against deployed commit" # - ./scripts/compare-deployed-commit "" $CI_COMMIT_SHA ${TLS_KEY} ${TLS_CERT} ${TLS_CA} - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector Digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=${OTEL_IMAGE_TAG} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app-client-tls service" - ./scripts/ecs-deploy-service-container app-client-tls "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" @@ -1373,9 +1384,9 @@ deploy_app_dp3: echo $GO_VERSION > .go-version fi - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=git-${OTEL_VERSION}-${CI_COMMIT_SHORT_SHA} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app service" - ./scripts/ecs-deploy-service-container app "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" @@ -1412,7 +1423,7 @@ build_push_app_stg: - *kaniko_before_setup script: - echo "Building and Pushing app Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1436,7 +1447,7 @@ build_push_migrations_stg: - *kaniko_before_setup script: - echo "Building and Pushing migrations Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1460,7 +1471,7 @@ build_push_tasks_stg: - *kaniko_before_setup script: - echo "Building tasks Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1482,17 +1493,20 @@ push_otel_collector_image_stg: - *setup_aws_vars_stg - *setup_release_stg script: - - echo "Logging in to Amazon ECR with Crane..." - - aws ecr get-login-password --region ${AWS_REGION} | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin + - echo "Logging in to DockerHub with Crane..." + - echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin + + - echo "Pulling the AWS OTel Collector image from DockerHub..." + - crane pull ${ECR_REPOSITORY_OTEL}:${OTEL_VERSION} image.tar - - echo "Pulling the AWS OTel Collector image from the public registry with Crane..." - - crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar + - echo "Logging into AWS ECR with Crane..." + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com -u AWS --password-stdin - - echo "Pushing the image to our private ECR using Crane..." - - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA} + - echo "Pushing the image to our private ECR using Crane..." + - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${OTEL_IMAGE_TAG} - - echo "Cleaning up the temporary image file..." - - rm image.tar + - echo "Cleaning up temporary image file..." + - rm image.tar allow_failure: false after_script: - *announce_failure @@ -1519,7 +1533,7 @@ deploy_migrations_stg: script: # Step 1: Get the Digest - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) # Step 2: Ensure exclusive execution and Snapshot - echo "Snapshotting database" - ./scripts/rds-snapshot-app-db "$APP_ENVIRONMENT" @@ -1550,7 +1564,7 @@ deploy_tasks_stg: - *setup_release_stg script: - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Deploying GHC fuel price data task service" - ./scripts/ecs-deploy-task-container save-ghc-fuel-price-data "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}" - echo "Deploying payment reminder email task service" @@ -1583,9 +1597,9 @@ deploy_app_client_tls_stg: # - echo "Comparing against deployed commit" # - ./scripts/compare-deployed-commit "" $CI_COMMIT_SHA ${TLS_KEY} ${TLS_CERT} ${TLS_CA} - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector Digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=${OTEL_IMAGE_TAG} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app-client-tls service" - ./scripts/ecs-deploy-service-container app-client-tls "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" @@ -1635,9 +1649,9 @@ deploy_app_stg: echo $GO_VERSION > .go-version fi - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=${OTEL_IMAGE_TAG} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app service" - ./scripts/ecs-deploy-service-container app "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" @@ -1691,7 +1705,7 @@ build_push_app_prd: - *kaniko_before_setup script: - echo "Building and Pushing app Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${APP_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1716,7 +1730,7 @@ build_push_migrations_prd: - *kaniko_before_setup script: - echo "Building and Pushing migrations Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/Dockerfile.migrations" --destination "${ECR_REPOSITORY_URI}/app-migrations:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1741,7 +1755,7 @@ build_push_tasks_prd: - *kaniko_before_setup script: - echo "Building tasks Docker image..." - - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:$CI_COMMIT_SHORT_SHA" + - /kaniko/executor --context "${CI_PROJECT_DIR}/" --dockerfile "${CI_PROJECT_DIR}/${TASK_DOCKER_FILE}" --destination "${ECR_REPOSITORY_URI}/app-tasks:git-$CI_COMMIT_SHORT_SHA" after_script: - *announce_failure rules: @@ -1764,17 +1778,20 @@ push_otel_collector_image_prd: - *setup_aws_vars_prd - *setup_release_prd script: - - echo "Logging in to Amazon ECR with Crane..." - - aws ecr get-login-password --region ${AWS_REGION} | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin + - echo "Logging in to DockerHub with Crane..." + - echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin + + - echo "Pulling the AWS OTel Collector image from DockerHub..." + - crane pull ${ECR_REPOSITORY_OTEL}:${OTEL_VERSION} image.tar - - echo "Pulling the AWS OTel Collector image from the public registry with Crane..." - - crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar + - echo "Logging into AWS ECR with Crane..." + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com -u AWS --password-stdin - - echo "Pushing the image to our private ECR using Crane..." - - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA} + - echo "Pushing the image to our private ECR using Crane..." + - crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${OTEL_IMAGE_TAG} - - echo "Cleaning up the temporary image file..." - - rm image.tar + - echo "Cleaning up temporary image file..." + - rm image.tar allow_failure: false after_script: - *announce_failure @@ -1801,7 +1818,7 @@ deploy_migrations_prd: script: # Step 1: Get the Digest - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-migrations --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) # Step 2: Ensure exclusive execution and Snapshot - echo "Snapshotting database" - ./scripts/rds-snapshot-app-db "$APP_ENVIRONMENT" @@ -1832,7 +1849,7 @@ deploy_tasks_prd: - *setup_release_prd script: - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app-tasks --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Deploying GHC fuel price data task service" - ./scripts/ecs-deploy-task-container save-ghc-fuel-price-data "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}" - echo "Deploying payment reminder email task service" @@ -1867,9 +1884,9 @@ deploy_app_client_tls_prd: # - echo "Comparing against deployed commit" # - ./scripts/compare-deployed-commit "" $CI_COMMIT_SHA ${TLS_KEY} ${TLS_CERT} ${TLS_CA} - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector Digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=${OTEL_IMAGE_TAG} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app-client-tls service" - ./scripts/ecs-deploy-service-container app-client-tls "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" @@ -1919,9 +1936,9 @@ deploy_app_prd: echo $GO_VERSION > .go-version fi - echo "Getting Digest from AWS" - - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export ECR_DIGEST=$(aws ecr describe-images --repository-name app --image-ids imageTag=git-$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) - echo "Getting otel collector digest from AWS" - - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=$CI_COMMIT_SHORT_SHA --query 'imageDetails[0].imageDigest' --output text) + - export OTEL_ECR_DIGEST=$(aws ecr describe-images --repository-name otel-collector --image-ids imageTag=${OTEL_IMAGE_TAG} --query 'imageDetails[0].imageDigest' --output text) - export OTEL_COLLECTOR_IMAGE="${ECR_REPOSITORY_URI}/otel-collector@${OTEL_ECR_DIGEST}" - echo "Deploying app service" - ./scripts/ecs-deploy-service-container app "${ECR_REPOSITORY_URI}/app@${ECR_DIGEST}" "${APP_ENVIRONMENT}" "/bin/milmove serve" diff --git a/scripts/push-storybook-assets b/scripts/push-storybook-assets index 15523762fa7..9674ed27fc3 100755 --- a/scripts/push-storybook-assets +++ b/scripts/push-storybook-assets @@ -16,4 +16,4 @@ readonly bucket=${1:-} # Sync files from source to destination # encrypt files on upload # delete files at destination that are not on source (bucket versioning is enabled so it only adds a delete marker) -aws s3 sync --delete --sse AES256 /tmp/storybook/storybook-static/ s3://"${bucket}"/ +aws s3 sync --delete --sse AES256 /builds/milmove/mymove/storybook-static s3://"${bucket}"/ diff --git a/scripts/rds-snapshot-app-db b/scripts/rds-snapshot-app-db index d27326e25a3..493be887936 100755 --- a/scripts/rds-snapshot-app-db +++ b/scripts/rds-snapshot-app-db @@ -25,7 +25,7 @@ time aws rds wait db-snapshot-completed --db-instance-identifier "$db_instance_i echo echo "Create database snapshot for ${db_instance_identifier} with identifier ${db_snapshot_identifier}" -aws rds create-db-snapshot --db-instance-identifier "$db_instance_identifier" --db-snapshot-identifier "$db_snapshot_identifier" --tags "${tags[@]}" +aws rds create-db-snapshot --cli-read-timeout 1200 --db-instance-identifier "$db_instance_identifier" --db-snapshot-identifier "$db_snapshot_identifier" --tags "${tags[@]}" echo echo "Wait for current database snapshot ${db_snapshot_identifier} to complete before continuing ..."