2021-08-19 11:07:57 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- id: build-base
|
2024-01-30 12:23:46 -05:00
|
|
|
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
|
2021-08-20 04:28:31 -04:00
|
|
|
dir: server-ce
|
2021-08-19 11:07:57 -04:00
|
|
|
args:
|
|
|
|
- 'build-base'
|
2024-01-30 12:23:46 -05:00
|
|
|
- 'OVERLEAF_BASE_CACHE=${_IMAGE_BASE_CACHE}'
|
|
|
|
- 'OVERLEAF_BASE_TAG=${_IMAGE_BASE}'
|
2021-08-19 11:07:57 -04:00
|
|
|
- id: build-community
|
2024-01-30 12:23:46 -05:00
|
|
|
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
|
2021-08-20 04:28:31 -04:00
|
|
|
dir: server-ce
|
2021-08-19 11:07:57 -04:00
|
|
|
args:
|
|
|
|
- build-community
|
2024-01-30 12:23:46 -05:00
|
|
|
- 'OVERLEAF_BASE_CACHE=${_IMAGE_BASE_CACHE}'
|
|
|
|
- 'OVERLEAF_BASE_TAG=${_IMAGE_BASE}'
|
|
|
|
- 'OVERLEAF_TAG=${_IMAGE_TAG}'
|
|
|
|
- id: tag_main_latest_base
|
2021-08-19 11:07:57 -04:00
|
|
|
name: gcr.io/cloud-builders/docker
|
2024-01-30 12:23:46 -05:00
|
|
|
script: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
if [ ${BRANCH_NAME} == main ]; then
|
|
|
|
docker tag ${_IMAGE_BASE} ${_IMAGE_BASE_CACHE};
|
|
|
|
docker push ${_IMAGE_BASE_CACHE};
|
|
|
|
fi
|
|
|
|
automapSubstitutions: true
|
|
|
|
- id: tag_main_latest
|
2021-08-19 11:07:57 -04:00
|
|
|
name: gcr.io/cloud-builders/docker
|
2024-01-30 12:23:46 -05:00
|
|
|
script: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
if [ $BRANCH_NAME == main ]; then
|
|
|
|
docker tag ${_IMAGE_TAG} ${_IMAGE_CE};
|
|
|
|
docker push ${_IMAGE_CE};
|
|
|
|
fi
|
|
|
|
automapSubstitutions: true
|
2021-08-19 11:07:57 -04:00
|
|
|
timeout: 3600s
|
|
|
|
options:
|
2023-10-10 03:26:45 -04:00
|
|
|
machineType: E2_HIGHCPU_32
|
2021-08-19 11:07:57 -04:00
|
|
|
env:
|
|
|
|
- 'BRANCH_NAME=${BRANCH_NAME}'
|
|
|
|
images:
|
|
|
|
- '${_IMAGE_BASE}'
|
|
|
|
- '${_IMAGE_TAG}'
|
|
|
|
substitutions:
|
2024-01-31 04:46:31 -05:00
|
|
|
_IMAGE_BASE: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}'
|
|
|
|
_IMAGE_BASE_CACHE: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:latest'
|
|
|
|
_IMAGE_CE: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:latest'
|
|
|
|
_IMAGE_TAG: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}'
|
2021-08-19 11:07:57 -04:00
|
|
|
tags:
|
|
|
|
- 'overleaf-public'
|
|
|
|
- '${BRANCH_NAME}'
|
|
|
|
- '${SHORT_SHA}'
|