2020-10-16 21:50:57 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
2020-10-17 20:43:08 +00:00
|
|
|
- name: set version
|
|
|
|
image: golang:1.12
|
|
|
|
commands:
|
|
|
|
- "current_version=$(grep drone/drone: Dockerfile | cut -d' ' -f 2 | cut -d: -f 2)"
|
|
|
|
- timestamp=$(date +%s)
|
|
|
|
- echo -n "$current_version-$timestamp" > .tags
|
|
|
|
- name: docker build
|
|
|
|
image: docker:dind
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
commands:
|
|
|
|
- docker ps -a
|
|
|
|
- docker build -t fbartels/com.github.drone:latest .
|
|
|
|
- name: docker push
|
|
|
|
image: docker:dind
|
2020-10-16 21:50:57 +00:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
environment:
|
|
|
|
DOCKER_USERNAME: {from_secret: DOCKER_USERNAME}
|
|
|
|
DOCKER_PASSWORD: {from_secret: DOCKER_PASSWORD}
|
|
|
|
commands:
|
2020-10-17 20:43:08 +00:00
|
|
|
- current_version=$(cat .tags)
|
|
|
|
- docker tag fbartels/com.github.drone:latest fbartels/com.github.drone:$current_version
|
2020-10-16 21:50:57 +00:00
|
|
|
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
2020-10-17 20:43:08 +00:00
|
|
|
- docker push fbartels/com.github.drone:latest
|
|
|
|
- docker push fbartels/com.github.drone:$current_version
|
2020-10-16 21:50:57 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
2020-10-17 20:43:08 +00:00
|
|
|
event:
|
2020-12-11 08:55:47 +00:00
|
|
|
- promote
|
2020-10-17 20:43:08 +00:00
|
|
|
- name: cloudron update
|
|
|
|
image: fbartels/cloudron-cli:latest
|
|
|
|
environment:
|
|
|
|
CLOUDRON_SERVER: {from_secret: CLOUDRON_SERVER}
|
|
|
|
CLOUDRON_TOKEN: {from_secret: CLOUDRON_TOKEN}
|
|
|
|
commands:
|
|
|
|
- current_version=$(cat .tags)
|
|
|
|
- cloudron update --server $CLOUDRON_SERVER --token $CLOUDRON_TOKEN --app drone --image fbartels/com.github.drone:$current_version
|
2020-10-16 21:50:57 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
2020-10-17 20:43:08 +00:00
|
|
|
event:
|
2020-12-11 08:54:36 +00:00
|
|
|
- promote
|
2020-10-16 21:50:57 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
2020-10-17 20:43:08 +00:00
|
|
|
host:
|
|
|
|
path: /var/run/
|