-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuildspec.yml
32 lines (32 loc) · 1.2 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
version: 0.1
phases:
install:
commands:
- chmod +x /usr/bin/nohup
- chmod +x /usr/bin/dockerd
- /usr/bin/nohup /usr/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
- echo $(echo $COMMIT_HASH)
- echo `image tag:` $(echo $IMAGE_TAG)
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- cd ./site && composer install --no-dev && composer update --no-dev
- docker build -t $REPOSITORY_URI-fpm:latest -f ./fpm.Dockerfile .
- docker build -t $REPOSITORY_URI-nginx:latest -f ./nginx.Dockerfile .
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI-fpm:latest
- docker push $REPOSITORY_URI-nginx:latest
artifacts:
files: