-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Added GitLab CI script for the Sandbox deployments (#31)
Co-authored-by: Petr Jurak <petr.jurak@integsoft.cz>
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# GitLab CI configuration file | ||
# INTEGSOFT_DOCKER_IMAGE and DOCKER_IMAGE_VERSION_PR are defined on the Gitlab settings page. | ||
stages: | ||
- push | ||
|
||
variables: | ||
STORAGE_DRIVER: vfs | ||
BUILDAH_FORMAT: docker | ||
|
||
push_integsoft: | ||
stage: push | ||
only: | ||
refs: | ||
- merge_requests | ||
variables: | ||
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "integsoft" | ||
image: | ||
name: noenv/buildah | ||
entrypoint: [''] | ||
variables: | ||
DOCKER_INTEGSOFT_IMAGE: "$INTEGSOFT_DOCKER_REGISTRY/$INTEGSOFT_DOCKER_IMAGE:$DOCKER_IMAGE_VERSION_PR" | ||
DOCKER_INTEGSOFT_IMAGE_LATEST: "$INTEGSOFT_DOCKER_REGISTRY/$INTEGSOFT_DOCKER_IMAGE:latest" | ||
script: | ||
- echo "Preparing Integsoft MBTA Keycloak Docker image release..." | ||
- buildah bud --no-cache -t $DOCKER_INTEGSOFT_IMAGE -t $DOCKER_INTEGSOFT_IMAGE_LATEST . | ||
- buildah push --tls-verify=false $DOCKER_INTEGSOFT_IMAGE | ||
- buildah push --tls-verify=false $DOCKER_INTEGSOFT_IMAGE_LATEST | ||
|
||
push_aws: | ||
stage: push | ||
only: | ||
- tags | ||
image: | ||
name: noenv/buildah | ||
entrypoint: [''] | ||
variables: | ||
DOCKER_INTEGSOFT_IMAGE: "$INTEGSOFT_DOCKER_REGISTRY/$INTEGSOFT_DOCKER_IMAGE:$DOCKER_IMAGE_VERSION_TAGGED" | ||
DOCKER_AWS_IMAGE: "$ECR_DOCKER_REGISTRY/$ECR_DOCKER_IMAGE:$DOCKER_IMAGE_VERSION_TAGGED" | ||
DOCKER_AWS_IMAGE_LATEST: "$ECR_DOCKER_REGISTRY/$ECR_DOCKER_IMAGE:latest" | ||
before_script: | ||
- dnf install -y awscli | ||
- aws --version | ||
script: | ||
- echo "Preparing AWS ECR MBTA Keycloak Docker image release..." | ||
- buildah pull --tls-verify=false $DOCKER_INTEGSOFT_IMAGE | ||
- buildah tag $DOCKER_INTEGSOFT_IMAGE $DOCKER_AWS_IMAGE | ||
- buildah tag $DOCKER_INTEGSOFT_IMAGE $DOCKER_AWS_IMAGE_LATEST | ||
- aws ecr get-login-password | buildah login --username AWS --password-stdin $ECR_DOCKER_REGISTRY | ||
- buildah push $DOCKER_AWS_IMAGE | ||
- buildah push $DOCKER_AWS_IMAGE_LATEST | ||
- aws ecs update-service --cluster $ECS_CLUSTER_NAME --service $ECS_SERVICE_NAME --force-new-deployment | ||
|