-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
57 lines (57 loc) · 1.61 KB
/
buildspec.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
version: 0.2
env:
shell: bash
variables:
APP_NAME: partitionS3Replicate
TERRAFORM_VERSION: 1.9.5
phases:
install:
runtime-versions:
python: 3.11
commands:
- '[[ -e .local/bin ]] || mkdir -p .local/bin'
- 'export PATH="$CODEBUILD_SRC_DIR/.local/bin:$PATH"'
- |
if [[ ! -e .local/bin/terraform ]]; then
curl --silent --fail --location https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip > /tmp/terraform.zip
unzip /tmp/terraform.zip terraform -d .local/bin
chmod a+rx .local/bin/terraform
fi
- 'export TF_DATA_DIR="$CODEBUILD_SRC_DIR/.local/terraform"'
- '[[ -e $TF_DATA_DIR ]] || mkdir -p "$TF_DATA_DIR"'
build:
on-failure: ABORT
commands:
- 'cd "${CODEBUILD_SRC_DIR}/${PROJECT_SUBDIR}"'
- 'make lint-report || :'
- 'make test-report'
- 'make validate'
- 'make build'
post_build:
on-failure: ABORT
commands:
- 'cd "${CODEBUILD_SRC_DIR}/${PROJECT_SUBDIR}"'
- |
if [[ -n $PACKAGE_BUCKET || $PACKAGE_COUNT -gt 0 ]]; then
make package
fi
artifacts:
files:
- $APP_NAME.zip
discard-paths: yes
base-directory: $CODEBUILD_SRC_DIR/$PROJECT_SUBDIR/dist/
reports:
pylint:
files:
- pylint.xml
base-directory: $CODEBUILD_SRC_DIR/$PROJECT_SUBDIR/reports/
file-format: JUNITXML
pytest:
files:
- pytest.xml
base-directory: $CODEBUILD_SRC_DIR/$PROJECT_SUBDIR/reports/
file-format: JUNITXML
cache:
paths:
- .local/**/*
- $CODEBUILD_SRC_DIR/$PROJECT_SUBDIR/.venv