This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
88 lines (84 loc) · 2.97 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
stages:
- build
- deploy
build_qa:
image: docker:latest
services:
- docker:dind
tags:
- meedan
- meedan-labs
stage: build
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
script:
- apk add --no-cache curl jq python3 py3-pip git
- pip install docutils==0.14
- pip install awscli==1.16.201
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- docker build -f Dockerfile --build-arg INST_ARGS=--production --build-arg TIMESTAMP=$(date '+%Y%m%d%H%M%S') -t "$ECR_API_BASE_URL/qa/check/search:$CI_COMMIT_SHA" .
- docker push "$ECR_API_BASE_URL/qa/check/search:$CI_COMMIT_SHA"
only:
- develop
deploy_qa:
image: python:3.9.13-alpine
stage: deploy
tags:
- meedan
- meedan-labs
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
script:
- apk add --no-cache curl jq python3 py3-pip git
- pip install boto3==1.14.47
- pip install botocore==1.17.47
- pip install ecs-deploy==1.11.0
- ecs deploy ecs-qa qa-check-search --image qa-check-search $ECR_API_BASE_URL/qa/check/search:$CI_COMMIT_SHA --exclusive-env -e qa-check-search DEPLOY_ENV qa -e qa-check-search AWS_DEFAULT_REGION $AWS_DEFAULT_REGION --timeout 1800
- echo "new Image was deployed $ECR_API_BASE_URL/qa/check/search:$CI_COMMIT_SHA"
- sh scripts/clear-cf-cache.sh qa
only:
- develop
build_live:
image: docker:latest
services:
- docker:dind
tags:
- meedan
- meedan-labs
stage: build
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
script:
- apk add --no-cache curl jq python3 py3-pip git
- pip install docutils==0.14
- pip install awscli==1.16.201
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- docker build -f Dockerfile --build-arg INST_ARGS=--production --build-arg TIMESTAMP=$(date '+%Y%m%d%H%M%S') -t "$ECR_API_BASE_URL/live/check/search:$CI_COMMIT_SHA" .
- docker push "$ECR_API_BASE_URL/live/check/search:$CI_COMMIT_SHA"
only:
- main
deploy_live:
image: python:3.9.13-alpine
stage: deploy
when: manual
tags:
- meedan
- meedan-labs
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
script:
- apk add --no-cache curl jq python3 py3-pip git
- pip install boto3==1.14.47
- pip install botocore==1.17.47
- pip install ecs-deploy==1.11.0
- ecs deploy ecs-live live-check-search --image live-check-search $ECR_API_BASE_URL/live/check/search:$CI_COMMIT_SHA --exclusive-env -e live-check-search DEPLOY_ENV live -e live-check-search AWS_DEFAULT_REGION $AWS_DEFAULT_REGION --timeout 1800
- echo "new Image was deployed $ECR_API_BASE_URL/live/check/search:$CI_COMMIT_SHA"
- sh scripts/clear-cf-cache.sh live
only:
- main