forked from cjuega/typescript-fullstack-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
45 lines (39 loc) · 1.33 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
version: 0.2
env:
git-credential-helper: yes
secrets-manager:
dockerhub_username: $SECRET_ID:username
dockerhub_password: $SECRET_ID:password
phases:
install:
runtime-versions:
nodejs: 14.x
commands:
- apt-get install jq
- pip3 install docker-compose
- npm install --silent --progress=false -g npm
- npm install --silent --progress=false -g yarn
# https://aws.amazon.com/es/premiumsupport/knowledge-center/codebuild-docker-pull-image-error/
- docker login -u $dockerhub_username -p $dockerhub_password
# This is required so AwsSignedConnection can read AWS credentials properly. It seems there is an issue otherwise.
pre_build:
commands:
- export TEMP_ROLE=`curl http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`
- export AWS_ACCESS_KEY_ID=$(echo "${TEMP_ROLE}" | jq -r '.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TEMP_ROLE}" | jq -r '.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TEMP_ROLE}" | jq -r '.Token')
build:
commands:
- make test
- make deploy env=cicd
- yarn test:features:aws cicd
- make deploy env=pro
- yarn publish:docs:aws pro
post_build:
commands:
# - yarn destroy:aws cicd
- make clean
cache:
paths:
- node_modules/**/*
- '**/node_modules/**/*'