-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
63 lines (57 loc) · 1.76 KB
/
.gitlab-ci.yml
File metadata and controls
63 lines (57 loc) · 1.76 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
variables:
PROJECT_NAME: poc
DOMAIN_NAME: datalake_test
STAGE_NAME: $CI_COMMIT_REF_SLUG
PYTHON_CODE_PATH: "./"
PYENV_VERSION: 3.13
TARGET_REPO_NAME: "aws-data-platform-framework"
include:
- project: 'erwan.simon/devops-platform-ci-templates'
ref: 'v2.0.3'
file:
- 'base.yml'
- 'docker.yml'
- 'python.yml'
- 'mirror_to_github.yml'
stages:
- init
- format
- security
- unit_tests
- deploy_integration_tests
- run_integration_tests
- mirror_to_github
#############################################################
######################## INTEGRATION-TESTS ##################
#############################################################
deploy_integration_tests:
stage: deploy_integration_tests
allow_failure: false
script:
- mkdir -p ~/.aws
- echo "${CI_JOB_JWT_V2}" > /tmp/web_identity_token
- echo -e "[profile default]\nrole_arn=${GITLAB_ROLE_ARN}\nweb_identity_token_file=/tmp/web_identity_token" > ~/.aws/config
- cd test
- terraform init -backend-config="bucket=$TERRAFORM_BACKEND_BUCKET" -backend-config="dynamodb_table=$TERRAFORM_BACKEND_DYNAMODB"
- terraform workspace new $CI_COMMIT_BRANCH || terraform workspace select $CI_COMMIT_BRANCH
- terraform apply --auto-approve
needs:
- init_ecr_token
except:
refs:
- tags
run_integration_tests:
stage: run_integration_tests
allow_failure: false
script:
- export step_function_arn="arn:aws:states:${AWS_DEFAULT_REGION}:${ACCOUNT_ID}:stateMachine:${PROJECT_NAME}_datalake_test_${STAGE_NAME}_tests"
- pip install boto3
- python test/utils/run_integration_tests.py ${step_function_arn}
needs:
- init_ecr_token
- deploy_integration_tests
variables:
PYTHONUNBUFFERED: "1"
except:
refs:
- tags