Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
191
Issues
191
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
9b26f8b3
Commit
9b26f8b3
authored
1 hour ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): entire deploy flow now in master and making use of environments for production deployments
parent
ac5db0b5
test/gitlab-ci
No related merge requests found
Pipeline
#73884911
canceled with stages
in 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
35 deletions
+44
-35
.gitlab-ci.yml
.gitlab-ci.yml
+44
-35
No files found.
.gitlab-ci.yml
View file @
9b26f8b3
...
...
@@ -8,6 +8,7 @@ stages:
-
test
-
prepare
-
review
-
staging
-
deploy
cache
:
...
...
@@ -73,8 +74,7 @@ review:start:
on_stop
:
review:stop
except
:
refs
:
-
master
#staging
-
production
-
master
-
test/gitlab-ci
review:stop
:
...
...
@@ -92,70 +92,79 @@ review:stop:
when
:
manual
except
:
refs
:
-
master
#staging
-
production
-
master
-
test/gitlab-ci
staging
:
staging:
fpm
:
stage
:
deploy
image
:
minds/helm-eks:latest
script
:
-
aws eks update-kubeconfig --name=sandbox
-
git clone --branch=sandbox-wip https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/minds/helm-charts.git
-
"
helm
upgrade
\
--install
\
--values=values-staging.yaml
\
--set
phpfpm.image.repository=$CI_REGISTRY_IMAGE/fpm
\
--set
phpfpm.image.tag=$CI_BUILD_REF
\
--set
runners.image.repository=$CI_REGISTRY_IMAGE/runners
\
--set
runners.image.tag=$CI_BUILD_REF
\
--wait
\
staging
\
./helm-charts/minds"
-
IMAGE_LABEL="staging"
-
$(aws ecr get-login --no-include-email --region us-east-1)
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker pull $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF
# Push to AWS registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
-
docker push $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
# Push to Gitlab registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
-
docker push $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
# Deploy to staging
-
aws ecs update-service --service=$ECS_APP_STAGING_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
environment
:
name
:
staging
url
:
https://
staging.minds.io/
url
:
https://
www.minds.com/?staging=1
only
:
refs
:
-
master
#staging
-
test/
staging
-
master
-
test/
gitlab-ci
canary:fpm
:
stage
:
deploy
image
:
minds/ci:latest
script
:
-
IMAGE_LABEL="canary"
-
$(aws ecr get-login --no-include-email --region us-east-1)
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker pull $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF
# Push to production registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $ECR_REPOSITORY_URL_FPM:canary
-
docker push $ECR_REPOSITORY_URL_FPM:canary
# Push to gitlab register
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $CI_REGISTRY_IMAGE/fpm:canary
-
docker push $CI_REGISTRY_IMAGE/fpm:canary
# Push to AWS registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
-
docker push $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
# Push to Gitlab registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
-
docker push $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
# Deploy to ECS
-
aws ecs update-service --service=$ECS_APP_CANARY_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only
:
refs
:
-
production
-
master
-
test/gitlab-ci
environment
:
name
:
canary
url
:
https://www.minds.com/
#requires canary cookie
url
:
https://www.minds.com/?canary=1
# requires canary cookie
when
:
manual
allow_failure
:
false
# prevents auto deploy to full production
production:fpm
:
stage
:
deploy
image
:
minds/ci:latest
script
:
-
IMAGE_LABEL="production"
-
$(aws ecr get-login --no-include-email --region us-east-1)
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker pull $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF
# Push to production registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $ECR_REPOSITORY_URL_FPM:latest
-
docker push $ECR_REPOSITORY_URL_FPM:production
# Push to gitlab register
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $CI_REGISTRY_IMAGE/fpm:latest
-
docker push $CI_REGISTRY_IMAGE/fpm:latest
# Push to AWS registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
-
docker push $ECR_REPOSITORY_URL_FPM:$IMAGE_LABEL
# Push to Gitlab registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
-
docker push $CI_REGISTRY_IMAGE/fpm:$IMAGE_LABEL
# Delpoy to ECS
-
aws ecs update-service --service=$ECS_APP_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only
:
refs
:
-
master
-
test/gitlab-ci
environment
:
name
:
production
url
:
https://www.minds.com/
...
...
@@ -178,7 +187,7 @@ production:runners:
-
aws ecs update-service --service=$ECS_RUNNERS_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only
:
refs
:
-
production
-
master
-
test/gitlab-ci
environment
:
name
:
production
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment