-
Notifications
You must be signed in to change notification settings - Fork 0
/
pa-build.yml
51 lines (51 loc) · 1.73 KB
/
pa-build.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
47
48
49
50
51
version: 0.2
phases:
install:
runtime-versions:
python: 3.7
commands:
- python --version
pre_build:
commands:
- export STARTTIME=`date +%s`
- export BUILDNAME="$GIT_BRANCH-`date +%Y-%m-%d`"
- export BRANCH="$GIT_BRANCH"
- export SOURCE_VERSION="$CODEBUILD_SOURCE_VERSION"
- echo "BRANCH $BRANCH"
- echo "SOURCE_VERSION $SOURCE_VERSION"
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- IMAGE_TAG=build-$(git rev-parse HEAD)
build:
commands:
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- apt-get -y update
- apt-get install -y nfs-common
- echo Build started on `date`
- echo Building the Docker image...
- echo $REPOURL:latest $REPOURL:$IMAGE_TAG
- docker build -t paragon ./paragon/
- docker tag paragon:latest $REPOURL:latest
- docker tag paragon:latest $REPOURL:$IMAGE_TAG
- docker images
- docker create paragon
- CONTAINER=$(docker ps -a | grep paragon | awk '{print $1}')
- docker ps -a
- echo $CONTAINER
- mkdir ./build/
- mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $PA_EFS:/ ./build/
- docker cp -a $CONTAINER:/usr/src/build/build/ ./build/
- chown 1000:1000 -R .
- sleep 3
- echo Pushing the Docker images...
- echo $REPOURL/paragon:latest $REPOURL:$IMAGE_TAG
- docker push $REPOURL:latest
- docker push $REPOURL:$IMAGE_TAG
- aws ecs update-service --force-new-deployment --service paragon --cluster ttrpg-cluster
post_build:
commands:
- echo Build completed on `date`
- pwd
- ls -al
artifacts:
files:
- '**/*'