batch-example/.drone.yml

147 lines
3.4 KiB
YAML
Raw Normal View History

2023-10-18 14:34:15 +00:00
---
kind: pipeline
type: docker
2023-10-18 15:44:27 +00:00
name: convert
2023-10-18 14:34:15 +00:00
platform:
os: linux
arch: amd64
clone:
disable: false
steps:
2023-10-18 21:39:08 +00:00
- name: "git - pre format"
when:
branch:
- format-branch
image: alpine/git:latest
commands:
2023-10-18 23:05:24 +00:00
- git config credential.helper '!f() { sleep 1; echo "username=$${GIT_USER}"; echo "password=$${GIT_PASSWORD}"; }; f'
- git checkout -b master
- git pull origin master
2023-10-18 21:50:24 +00:00
# - git branch -D product-development
2023-10-18 21:48:20 +00:00
- git checkout -b product-development
2023-10-18 23:14:57 +00:00
#- git merge format-branch
2023-10-18 23:40:55 +00:00
#- git merge --squash --no-commit --strategy-option=theirs format-branch
- git checkout format-branch **/*.*
- git log -n 3
2023-10-18 21:39:08 +00:00
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
2023-10-18 20:52:48 +00:00
- name: "convert to xml"
2023-10-18 14:34:15 +00:00
image: sigyl/zone-10-batch2yaml:latest
2023-10-18 15:40:55 +00:00
when:
branch:
- master
2023-10-18 22:12:01 +00:00
- product-development
2023-10-18 14:34:15 +00:00
commands:
- node /app/servers/apps/batch2yaml/build/index.js . xml
2023-10-18 15:40:55 +00:00
volumes:
- name: dockersock
path: /var/run
- name: "convert to yml"
image: sigyl/zone-10-batch2yaml:latest
when:
branch:
2023-10-18 21:39:08 +00:00
- format-branch
2023-10-18 15:40:55 +00:00
commands:
2023-10-18 23:05:24 +00:00
- node /app/servers/apps/batch2yaml/build/index.js . delete
2023-10-18 14:40:25 +00:00
- node /app/servers/apps/batch2yaml/build/index.js . yml
2023-10-18 14:34:15 +00:00
volumes:
- name: dockersock
path: /var/run
2023-10-18 18:15:03 +00:00
- name: "git - status"
when:
branch:
- master
2023-10-18 20:50:42 +00:00
- deployed
2023-10-18 18:15:03 +00:00
image: alpine/git:latest
commands:
- git status
volumes:
- name: dockersock
path: /var/run
2023-10-18 15:58:38 +00:00
- name: "git - deployed"
when:
branch:
- master
2023-10-18 15:40:55 +00:00
image: alpine/git:latest
commands:
2023-10-18 18:22:55 +00:00
- git config credential.helper '!f() { sleep 1; echo "username=$${GIT_USER}"; echo "password=$${GIT_PASSWORD}"; }; f'
2023-10-18 18:09:12 +00:00
- git add -A
2023-10-18 22:32:48 +00:00
- git commit -m "deploying- $${DRONE_COMMIT_MESSAGE}"
2023-10-18 23:05:24 +00:00
- git push -f origin HEAD:deployed
2023-10-18 18:21:52 +00:00
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
2023-10-18 22:12:01 +00:00
- name: "git - product-development - build"
when:
branch:
- product-development
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}"
2023-10-18 22:37:29 +00:00
- git push -f origin HEAD:product-development-build
2023-10-18 22:12:01 +00:00
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
2023-10-18 20:50:42 +00:00
- name: "git - product-development"
when:
branch:
2023-10-18 21:39:08 +00:00
- format-branch
2023-10-18 20:50:42 +00:00
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}"
2023-10-18 23:27:38 +00:00
- git push -f origin HEAD:product-development
2023-10-18 20:50:42 +00:00
environment:
GIT_PASSWORD:
from_secret: GIT_PASSWORD
GIT_USER:
from_secret: GIT_USER
2023-10-18 15:40:55 +00:00
volumes:
- name: dockersock
path: /var/run
2023-10-18 14:34:15 +00:00
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:
2023-10-18 15:40:55 +00:00
branch:
2023-10-18 21:39:08 +00:00
- format-branch
2023-10-18 15:40:55 +00:00
- master
2023-10-18 22:12:01 +00:00
- product-development
2023-10-18 15:48:19 +00:00
event:
- push
2023-10-18 14:41:04 +00:00
2023-10-18 14:34:15 +00:00