-
Notifications
You must be signed in to change notification settings - Fork 11
/
buildspec.yml
46 lines (44 loc) · 2.04 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
version: 0.2
env:
variables:
REACT_APP_INITIALIZE_PAGE_ENABLED: $REACT_APP_INITIALIZE_PAGE_ENABLED
REACT_APP_DEVNET_PROGRAM_ID: $REACT_APP_DEVNET_PROGRAM_ID
REACT_APP_MAINNET_PROGRAM_ID: $REACT_APP_MAINNET_PROGRAM_ID
REACT_APP_DEVNET_DEX_PROGRAM_ID: $REACT_APP_DEVNET_DEX_PROGRAM_ID
REACT_APP_MAINNET_DEX_PROGRAM_ID: $REACT_APP_MAINNET_DEX_PROGRAM_ID
REACT_APP_DEVNET_FAUCET_USDC: $REACT_APP_DEVNET_FAUCET_USDC
REACT_APP_DEVNET_FAUCET_BTC: $REACT_APP_DEVNET_FAUCET_BTC
REACT_APP_DEVNET_FAUCET_PSY: $REACT_APP_DEVNET_FAUCET_PSY
secrets-manager:
SENTRY_AUTH_TOKEN: '${SecretsArn}:SENTRY_AUTH_TOKEN'
phases:
install:
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- printenv > .env
- echo "REACT_APP_DEVNET_PROGRAM_ID is $REACT_APP_DEVNET_PROGRAM_ID"
- echo "REACT_APP_MAINNET_PROGRAM_ID is $REACT_APP_MAINNET_PROGRAM_ID"
- echo Logging in to Amazon ECR...
- aws --version
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $ECR_REPOSITORY_URI
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build --cache-from $ECR_REPOSITORY_URI:latest -t $ECR_REPOSITORY_URI:latest --build-arg SHORT_SHA=${COMMIT_HASH} --build-arg SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} .
- docker tag $ECR_REPOSITORY_URI:latest $ECR_REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $ECR_REPOSITORY_URI:latest
- docker push $ECR_REPOSITORY_URI:$IMAGE_TAG
- printf '{"ImageURI":"%s:%s"}' $ECR_REPOSITORY_URI $IMAGE_TAG > imagedefinitions.json
artifacts:
files:
- imagedefinitions.json