blob: 504a42029ae34424e677181d239f2045afdf8e54 [file]
version: 3
vars:
NAME: apache/openserverless-devcontainer
TAG:
sh: git tag --sort=-creatordate | head -n 1 || "latest"
tasks:
default: task --list-all
show: "echo {{.NAME}}:{{.TAG}}"
update-opsroot:
silent: true
cmds:
- jq . ../olaris/opsroot.json >_opsroot.orig
- jq '.config.images.devcontainer = "{{.NAME}}:{{.TAG}}"' ../olaris/opsroot.json >_opsroot.json
- diff _opsroot.orig _opsroot.json || cp -v _opsroot.json ../olaris/opsroot.json
image-tag:
- git tag -d "$(git tag)" || true
- git tag "0.1.0-incubating.$(date +%y%m%d%H%M)"
- echo {{.NAME}}:$(git tag --sort=-creatordate | head -n 1)
build:
- docker build -t "{{.NAME}}:{{.TAG}}" . --load
- task: show
clean:
- docker rm -f ssh-devcontainer || true
- docker images | awk '/<none>|devcontainer/{print $3}' | xargs docker rmi -f || true
all:
- task: image-tag
# warning: the ':' is missing intentionally to reload the tag
- task build
- task update-opsroot
publish:
- git commit -m "publishing $(date)" -a || true
- task: image-tag
- task update-opsroot
- git push origin main --tags