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
0e644a34
Commit
0e644a34
authored
2 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): new CI flow to support staging, canary and production
parent
adce7fc7
master
feat/self-declare-nsfw
goal/boost-campaigns-e24
No related merge requests found
Pipeline
#73938275
waiting for manual action with stages
in 10 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
19 deletions
+77
-19
.gitlab-ci.yml
.gitlab-ci.yml
+73
-15
opcache.ini
containers/php-fpm/opcache.ini
+1
-1
php-fpm.conf
containers/php-fpm/php-fpm.conf
+1
-1
php.ini
containers/php-fpm/php.ini
+2
-2
No files found.
.gitlab-ci.yml
View file @
0e644a34
...
...
@@ -8,7 +8,9 @@ stages:
-
test
-
prepare
-
review
-
deploy
-
deploy:staging
-
deploy:canary
-
deploy:production
cache
:
paths
:
...
...
@@ -94,44 +96,100 @@ review:stop:
-
master
-
test/gitlab-ci
deploy
:fpm
:
stage
:
deploy
staging
:fpm
:
stage
:
deploy
:staging
image
:
minds/ci:latest
script
:
-
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 production registry
-
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_BUILD_REF $REPOSITORY_URL_FPM
-
docker push $REPOSITORY_URL_FPM
# 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
-
aws ecs update-service --service=$SERVICE_FPM --force-new-deployment --region us-east-1 --cluster=$CLUSTER
# 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://www.minds.com/?staging=1
only
:
refs
:
-
master
-
test/gitlab-ci
canary:fpm
:
stage
:
deploy:canary
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 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
:
-
master
-
test/gitlab-ci
environment
:
name
:
canary
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:production
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 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/
when
:
delayed
start_in
:
2 hours
# reduce? can always be deployed manually earlier too
deploy
:runners
:
stage
:
deploy
production
:runners
:
stage
:
deploy
:production
image
:
minds/ci:latest
script
:
-
$(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/runners:$CI_BUILD_REF
# Push to production register
-
docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $REPOSITORY_URL_RUNNERS
-
docker push $
REPOSITORY_URL_RUNNERS
-
docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $
ECR_
REPOSITORY_URL_RUNNERS
-
docker push $
ECR_REPOSITORY_URL_RUNNERS:production
# Push gitlab registry
-
docker tag $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF $CI_REGISTRY_IMAGE/runners:latest
-
docker push $CI_REGISTRY_IMAGE/runners:latest
-
aws ecs update-service --service=$
SERVICE_RUNNERS --force-new-deployment --region us-east-1 --cluster=$
CLUSTER
-
aws ecs update-service --service=$
ECS_RUNNERS_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/
This diff is collapsed.
Click to expand it.
containers/php-fpm/opcache.ini
View file @
0e644a34
opcache.enable
=
1
opcache.memory_consumption
=
2046
opcache.memory_consumption
=
1024
opcache.interned_strings_buffer
=
64
opcache.max_accelerated_files
=
65407
opcache.validate_timestamps
=
0
...
...
This diff is collapsed.
Click to expand it.
containers/php-fpm/php-fpm.conf
View file @
0e644a34
...
...
@@ -8,7 +8,7 @@ listen.backlog = -1
pm
=
static
pm
.
max_children
=
50
0
pm
.
max_children
=
25
0
pm
.
max_requests
=
2000
pm
.
status_path
= /
status
...
...
This diff is collapsed.
Click to expand it.
containers/php-fpm/php.ini
View file @
0e644a34
log_errors
=
On
error_log
=
/dev/stderr
upload_max_filesize
=
4G
post_max_size
=
4G
\ No newline at end of file
upload_max_filesize
=
1G
post_max_size
=
1G
\ No newline at end of file
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