forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec-remodel.yaml
41 lines (39 loc) · 1.37 KB
/
buildspec-remodel.yaml
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
version: 0.2
env:
secrets-manager:
TOKEN: $TOKEN_SECRET_ARN
variables:
NODE_OPTIONS: --max_old_space_size=8192
phases:
install:
commands:
# CodeBuild always runs as root, allow npm to operate as such
- npm config set unsafe-perm true
- mkdir ${HOME}/aws-cdk && cd ${HOME}/aws-cdk
# Configure git and git credentials
- git config --global user.email "${COMMIT_EMAIL}"
- git config --global user.name "${COMMIT_USERNAME}"
- echo "Retrieving gh token from secretsmanager"
- git clone https://$TOKEN@github.com/aws/aws-cdk -b feat/repo-restructure .
- git checkout ${CODEBUILD_RESOLVED_SOURCE_VERSION}
# Install yarn if it wasn't already present in the image
- yarn --version || npm -g install yarn
- yarn install --frozen-lockfile
- /sbin/sysctl -w vm.max_map_count=2251954
build:
commands:
- cd ${HOME}/aws-cdk
- npx lerna run build --scope @aws-cdk/remodel --include-dependencies
- npx remodel ${PWD} --tmp-dir ${HOME}/remodel --no-clean --dry-run
post_build:
commands:
- cd ${HOME}/remodel
- git add -A
- git commit -m "Execute remodel"
- git remote add aws-cdk https://$TOKEN@github.com/aws/aws-cdk
- git fetch aws-cdk
- git push aws-cdk +feat/repo-restructure:feat/remodel
artifacts:
files:
- "**/*"
base-directory: ${HOME}/remodel