-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
56 lines (49 loc) · 1.02 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
image: public.ecr.aws/sam/build-python3.9:latest-x86_64
stages:
- test
- build
- package
- publish
variables:
AWS_DEFAULT_OUTPUT: text
AWS_DEFAULT_REGION: eu-west-1
AWS_REGION: eu-west-1
SAM_CLI_TELEMETRY: 0
SERVICE_NAME: elasticache-auth-token-rotator
cache:
key: "$CI_PIPELINE_ID"
test:
stage: test
before_script:
- pip install --quiet cfn-lint
script:
- sam validate
- cfn-lint --template ./template.yml
build:
stage: build
script:
- sam build
artifacts:
paths:
- ./.aws-sam/
package:
stage: package
before_script:
- export BUCKET="$(aws cloudformation list-exports --query "Exports[?Name=='DeploymentBucket'].Value")"
script:
- sam package
--s3-bucket "${BUCKET}"
--s3-prefix "${SERVICE_NAME}"
--output-template-file ./template.out.yml
artifacts:
paths:
- ./template.out.yml
only:
- master
publish:
stage: publish
script:
# Public SAR deployments must go to us-east-1.
- sam publish --region us-east-1 --template ./template.out.yml
only:
- master