mirror of
https://github.com/fbartels/cloudron-drone-app.git
synced 2024-11-25 06:20:59 +00:00
eb46932157
Signed-off-by: Felix Bartels <felix@host-consultants.de>
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- 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
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run
|
|
environment:
|
|
DOCKER_USERNAME: {from_secret: DOCKER_USERNAME}
|
|
DOCKER_PASSWORD: {from_secret: DOCKER_PASSWORD}
|
|
commands:
|
|
- current_version=$(cat .tags)
|
|
- docker tag fbartels/com.github.drone:latest fbartels/com.github.drone:$current_version
|
|
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
|
- docker push fbartels/com.github.drone:latest
|
|
- docker push fbartels/com.github.drone:$current_version
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- promote
|
|
- 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
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- promote
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/
|