-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yaml
More file actions
48 lines (44 loc) · 1.18 KB
/
.gitlab-ci.yaml
File metadata and controls
48 lines (44 loc) · 1.18 KB
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
stages:
- test
- build
- deploy
# ENV Vars are define in Gitlab UI at project scope
# variables:
# AWS_DEFAULT_REGION: 'us-east-1'
# AWS_ACCESS_KEY_ID: 'AWS_ACCESS_KEY_ID'
# AWS_SECRET_ACCESS_KEY: 'AWS_SECRET_ACCESS_KEY'
# AlertEmail: 'example@example.com'
# UserName: 'my_username'
# SshPublicKey: 'ssh-rsa AaA...'
test:
stage: test
image: python:3.11
script:
- python -m pip install --upgrade pip
- pip install -r app/requirements.txt
- python -m unittest discover -s test -p 'test.py'
build:
stage: build
image: 'public.ecr.aws/sam/build-python3.11:1.125.0-20240926224215'
script:
- sam build
artifacts:
paths:
- .aws-sam
deploy:
stage: deploy
image: 'public.ecr.aws/sam/build-python3.11:1.125.0-20240926224215'
script:
- |
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
ParameterKey=AlertEmail,ParameterValue=${AlertEmail} \
ParameterKey=UserName,ParameterValue=${UserName} \
ParameterKey=SshPublicKey,ParameterValue=${SshPublicKey}
dependencies:
- build
only:
- master