-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
29 lines (26 loc) · 973 Bytes
/
.gitlab-ci.yml
File metadata and controls
29 lines (26 loc) · 973 Bytes
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
image: quay.io/element84/e84-build-python:3.12-main
stages:
- lint
- deploy
lint:
stage: lint
script:
- pip3.12 install uv
- uv sync --all-extras
- source .venv/bin/activate
- scripts/lint.sh
deploy:
stage: deploy
image: python:3.12-slim-bookworm
before_script: scripts/gitlab_before_script.sh
script:
- uv sync --all-extras
- source .venv/bin/activate
- CREDS=$(aws sts assume-role --role-arn $DEPLOY_ROLE_ARN --role-session-name "git-lab-pipeline-deploy")
- export AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo $CREDS | jq -r '.Credentials.SessionToken')
- scripts/deploy.sh --auto-approve
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # run if commit on main branch
- if: $CI_PIPELINE_SOURCE == "pipeline" # or run if triggered by another pipeline