This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
43 lines (43 loc) · 1.75 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
#Expects AWS image aws/codebuild/nodejs:10.1.0
version: 0.2
env:
variables:
NPM_REGISTRY_URL: "https://registry.npmjs.org"
SOURCE_BRANCH: "master"
parameter-store:
SLACK_INCOMING_WEB_HOOK: "larry-infrastructure-slack-incoming-web-hook"
NPM_TOKEN: "larry-infrastructure-npm-token"
JIRA_USER: "larry-infrastructure-jira-user"
JIRA_PASS: "larry-infrastructure-jira-pass"
GIT_USER: "larry-infrastructure-git-user"
GIT_PASS: "larry-infrastructure-git-pass"
phases:
install:
commands:
# install git
- echo => Setting up git credentials
- git config --global credential.helper 'store' && echo "https://${GIT_USER}:${GIT_PASS}@github.com" > ~/.git-credentials
# clone the repo
- echo => Setting up git credentials
- git clone https://github.com/@lockenj/larry-aws-product cloned-repo
- cd cloned-repo
- git checkout ${SOURCE_BRANCH}
# setup and install npm deps
- echo => Installing NPM Dependencies
- printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL).host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL}\n" >> ~/.npmrc
- npm install
finally:
- if [ $CODEBUILD_BUILD_SUCCEEDING -eq 0 ]; then npx larry slack post-build-failure; fi
#skipped if install, or pre_build fails
build:
commands:
- echo => Releasing NPM package...
- npm publish
- echo => Updating associated JIRA Issues...
- npx larry jira move-issue deploy --git
- echo => Notifying team via slack...
- npx larry slack post-release --terminal
#skipped if install, or pre_build fails. This will run if build fails.
post_build:
finally:
- if [ $CODEBUILD_BUILD_SUCCEEDING -eq 0 ]; then npx larry slack post-build-failure; fi