mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
33 lines
870 B
YAML
Executable File
33 lines
870 B
YAML
Executable File
sudo: required
|
|
services:
|
|
- docker
|
|
language: node_js
|
|
node_js:
|
|
- "node"
|
|
env:
|
|
global:
|
|
- IMAGE_NAME=acme-corp/cake-service
|
|
- REGISTRY_USER=myrobot
|
|
# Ensure the install happens without prompts
|
|
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
|
|
# REGISTRY_PASS=...
|
|
- secret: "<something long>"
|
|
|
|
before_script:
|
|
- version="$(awk '$2 == "CAKE_SERVICE_VERSION" { print $3; exit }' Dockerfile)"
|
|
- docker pull "$IMAGE_NAME" || true
|
|
script:
|
|
- docker build --pull --cache-from "$IMAGE_NAME" --tag "$IMAGE_NAME" .
|
|
|
|
after_script:
|
|
- docker images
|
|
|
|
before_deploy:
|
|
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
|
|
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:latest"
|
|
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${version}"
|
|
deploy:
|
|
provider: script
|
|
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${version}"
|
|
on:
|
|
branch: master |