-
Notifications
You must be signed in to change notification settings - Fork 103
/
buildspec.yml
39 lines (39 loc) · 1.28 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
version: 0.2
parameter-store:
build_ssh_key: "/CodeBuild/emobility_build_ssh_key"
phases:
install:
runtime-versions:
nodejs: 16
commands:
- mkdir -p ~/.ssh
- if [ -z ${build_ssh_key} ]; then echo "missing build_ssh_key store parameter, exiting"; exit 1; fi
- echo "${build_ssh_key}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keygen -F github.com || ssh-keyscan github.com >> ~/.ssh/known_hosts
- git config --global url."[email protected]:".insteadOf "https://github.com/"
- git init
- git remote remove origin || true
- if [ -z ${remote_origin} ]; then echo "missing remote_origin env variable, exiting"; exit 1; fi
- git remote add origin ${remote_origin}
- git fetch
- if [ -z $branch_name ]; then echo "missing branch_name env variable, exiting"; exit 1; fi
- git checkout -f ${branch_name}
- git branch --set-upstream-to origin/${branch_name}
- git reset --hard origin/${branch_name}
- git submodule update --init --recursive
- npm install --force
build:
commands:
- npm run build:prod
artifacts:
type: zip
files:
- LICENSE
- NOTICE
- package.json
- package-lock.json
- appspec.yml
- 'src/aws/*.sh'
- 'dist/**/*'
- 'node_modules/**/*'