-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildspec.yml
43 lines (42 loc) · 2.35 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
version: 0.2
phases:
install:
commands:
- nohup /usr/local/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 "3.9" > .python-version
- echo Logging in to AWS ECR...
- aws --version
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/uktrade
- BUILDER_IMAGE_TAG=$(curl -s 'https://hub.docker.com/v2/repositories/paketobuildpacks/builder-jammy-full/tags?page_size=1' | jq -r '.results[].name')
- BUILDER_REPOSITORY_URI=public.ecr.aws/uktrade/paketobuildpacks/builder
- LIFECYCLE_REPOSITORY_URI=public.ecr.aws/uktrade/buildpacksio/lifecycle
- RUN_REPOSITORY_URI=public.ecr.aws/uktrade/paketobuildpacks/run
build:
commands:
- echo Pull started on `date`
- echo Pulling the Builder Docker image...
- docker pull paketobuildpacks/builder-jammy-full:$BUILDER_IMAGE_TAG
- docker tag paketobuildpacks/builder-jammy-full:$BUILDER_IMAGE_TAG $BUILDER_REPOSITORY_URI:$BUILDER_IMAGE_TAG
- docker tag paketobuildpacks/builder-jammy-full:$BUILDER_IMAGE_TAG $BUILDER_REPOSITORY_URI:latest
- echo Pulling the Lifecycle Docker image...
- LIFECYCLE_IMAGE_TAG=$(docker inspect paketobuildpacks/builder-jammy-full:$BUILDER_IMAGE_TAG | jq -r '.[].Config.Labels."io.buildpacks.builder.metadata"' | jq -r '.lifecycle.version')
- docker pull buildpacksio/lifecycle:$LIFECYCLE_IMAGE_TAG
- docker tag buildpacksio/lifecycle:$LIFECYCLE_IMAGE_TAG $LIFECYCLE_REPOSITORY_URI:$LIFECYCLE_IMAGE_TAG
- docker tag buildpacksio/lifecycle:$LIFECYCLE_IMAGE_TAG $LIFECYCLE_REPOSITORY_URI:latest
- echo Pulling the Run Docker image...
- docker pull paketobuildpacks/run-jammy-full:latest
- docker tag paketobuildpacks/run-jammy-full:latest $RUN_REPOSITORY_URI:latest
post_build:
commands:
- echo Pull completed on `date`
- echo Pushing Builder image to ECR
- docker push $BUILDER_REPOSITORY_URI:$BUILDER_IMAGE_TAG
- docker push $BUILDER_REPOSITORY_URI:latest
- echo Pushing Lifecycle image to ECR
- docker push $LIFECYCLE_REPOSITORY_URI:$LIFECYCLE_IMAGE_TAG
- docker push $LIFECYCLE_REPOSITORY_URI:latest
- echo Pushing Run image to ECR
- docker push $RUN_REPOSITORY_URI:latest