batch-example/.drone.yml

143 lines
2.7 KiB
YAML

---
kind: pipeline
type: docker
name: register
platform:
os: linux
arch: amd64
clone:
disable: true
trigger:
event:
exclude:
- promote
---
kind: pipeline
type: docker
name: convert
platform:
os: linux
arch: amd64
clone:
disable: false
steps:
- name: "check out product-development"
when:
branch:
- format-branch
image: alpine/git:latest
commands:
- git config credential.helper '!f() { sleep 1; echo "username=${GIT_USER}"; echo "password=${GIT_PASSWORD}"; }; f'
- git fetch
- git checkout -b product-development
- git merge format-branch
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
- name: "check out deployed"
when:
branch:
- master
image: alpine/git:latest
commands:
- git config credential.helper '!f() { sleep 1; echo "username=$${GIT_USER}"; echo "password=$${GIT_PASSWORD}"; }; f'
- git fetch
- git checkout -b deployed
- git merge master
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
- name: "convert to xml"
image: sigyl/zone-10-batch2yaml:latest
when:
branch:
- master
commands:
- node /app/servers/apps/batch2yaml/build/index.js . xml
volumes:
- name: dockersock
path: /var/run
- name: "convert to yml"
image: sigyl/zone-10-batch2yaml:latest
when:
branch:
- format-branch
commands:
- node /app/servers/apps/batch2yaml/build/index.js . yml
volumes:
- name: dockersock
path: /var/run
- name: "git - status"
when:
branch:
- master
- format-branch
image: alpine/git:latest
commands:
- git status
volumes:
- name: dockersock
path: /var/run
- name: "git - deployed"
when:
branch:
- master
- format-branch
image: alpine/git:latest
commands:
- git config credential.helper '!f() { sleep 1; echo "username=$${GIT_USER}"; echo "password=$${GIT_PASSWORD}"; }; f'
- git add -A
- git commit -m '$${DRONE_COMMIT_MESSAGE}'
- git push origin --set-upstream $$(git symbolic-ref --short HEAD)
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
volumes:
- name: dockersock
path: /var/run
services:
- name: docker
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
privileged: true
volumes:
- name: dockersock
path: /var/run
- name: ca
path: /etc/docker/certs.d
- name: daemonjson
path: /etc/docker/daemon.json
volumes:
- name: dockersock
temp: {}
- name: ca
host:
path: /etc/docker/certs.d
- name: daemonjson
host:
path: /etc/docker/daemon.json
trigger:
branch:
- format-branch
- master
event:
- push