-
Notifications
You must be signed in to change notification settings - Fork 39
/
buildspec.yml
110 lines (101 loc) · 3.21 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#
# Author: Hari Sekhon
# Date: [% DATE # 2020-12-15 22:23:33 +0000 (Tue, 15 Dec 2020) %]
#
# [% URL %]
#
# [% LICENSE %]
#
# [% MESSAGE %]
#
# [% LINKEDIN %]
#
# ============================================================================ #
# A W S C o d e B u i l d
# ============================================================================ #
# References:
#
# https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
# Operating System should be set to Ubuntu, not Amazon Linux 2
# - this is both recommended since programming language runtimes are now included in standard image of ubuntu, but also to avoid this error:
#
# /usr/bin/amazon-linux-extras
# /root/.pyenv/versions/3.8.3/bin/python: No module named amazon_linux_extras
version: 0.2
# only on Linux, the user to run as - global setting, alternatively set inside a phase section below for localized user
#run-as: linux-username
env:
shell: bash
# don't store sensitive stuff like AWS secret keys in variables, use parameter-store or secrets-manager below
# any environment variables replace existing environment variables, ie. beware if setting PATH that it'll replace the existing PATH with a non-interpolated literal
# project env vars take precedence over these, with start build vars taking highest precedence
#variables:
# DEBUG: "1"
#exported-variables:
# - DEBUG
#parameter-store:
# key: "value"
# key: "value"
#secrets-manager:
# key: secret-id:json-key:version-stage:version-id
#git-credential-helper: no | yes
phases:
# install prerequisites / languages / frameworks / packages to allow build to work
install:
commands:
- setup/ci_bootstrap.sh
# languages to install
runtime-versions:
#java: openjdk11
# AWS LTS release of OpenJDK 11
java: corretto11
golang: 1.14
#python: 3.7
python: 3.8
#ruby: 2.6
ruby: 2.7
# eg. sign in to Amazon ECR or install package dependencies
pre_build:
commands:
- setup/ci_bootstrap.sh
build:
commands:
- echo Build started on `date`
#- mvn install
# my builds are much more holistic and generalized through Make than calling Maven/SBT/Gradle/pip/cpan etc directly
- make
- echo Build completed on `date`
- make test
- echo Tests completed on `date`
# XXX: always runs regardless of build status
post_build:
commands:
- echo Post-build started on `date`
- make test
- echo Post-build completed on `date`
# listed artifacts are uploaded to the output S3 bucket
#artifacts:
# files:
# # Java jar - preferably a standalone fat jar
# - target/someApp-1.0.jar
# # Perl fatpack tarball containing all the self-contained Perl programs
# - fatpacks.tar.gz
# uploads to an S3 cache bucket
#cache:
# paths:
# - $HOME/.cache
# - $HOME/.cpan
# - $HOME/.cpanm
# - $HOME/.gem
# - $HOME/.m2
# - $HOME/.ivy
# - $HOME/.ivy2
# - $HOME/.gradle
# - $HOME/.sbt
# - $HOME/.groovy
# - $HOME/.rvm
# - $HOME/go/pkg
# # only cache bash-tools is downloaded and not a submodule of the repo
# #- bash-tools
# # pytools_checks is downloaded so safe to cache
# - bash-tools/pytools_checks