2023-10-03 01:36:18 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
steps:
|
2023-10-04 02:17:38 +00:00
|
|
|
- name: Deploy to Portainer
|
2023-10-03 01:36:18 +00:00
|
|
|
image: alpine
|
|
|
|
commands:
|
|
|
|
- apk update
|
|
|
|
- apk add envsubst curl python3
|
|
|
|
- python3 -m ensurepip
|
|
|
|
- pip3 install requests python-dotenv --quiet
|
2023-10-03 01:41:02 +00:00
|
|
|
- python3 deploy/portainer/deploy.py
|
|
|
|
--PORTAINER https://dvportainer.privatedns.org
|
2023-10-03 19:29:22 +00:00
|
|
|
--PORTAINER_API_KEY=ptr_RwxH2Cd+htdD2FoFiG46erT9beyvj9VoF3BrQPtDH3Q=
|
2023-10-03 01:41:02 +00:00
|
|
|
--PORTAINER_EP=CICD-runner
|
2023-10-03 19:29:22 +00:00
|
|
|
--GITEA_API_KEY=f449c74ec7f04e54fe1e481eae43492b34cea406
|
2023-10-03 01:41:02 +00:00
|
|
|
--DEPLOY_REPO_URL=${DRONE_REPO_LINK}
|
2023-10-03 20:16:09 +00:00
|
|
|
--DEPLOY_BRANCH=${DRONE_SOURCE_BRANCH}
|
2023-10-03 01:41:02 +00:00
|
|
|
--DEPLOY_HOST=dvdemo.privatedns.org
|
2023-10-03 01:36:18 +00:00
|
|
|
|
|
|
|
trigger:
|
2023-10-03 19:29:22 +00:00
|
|
|
event:
|
|
|
|
- pull_request
|
|
|
|
action:
|
2023-10-04 02:17:38 +00:00
|
|
|
- opened
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: undeploy
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Undeploy from Portainer
|
|
|
|
image: alpine
|
|
|
|
commands:
|
|
|
|
- apk update
|
|
|
|
- apk add envsubst curl python3
|
|
|
|
- python3 -m ensurepip
|
|
|
|
- pip3 install requests python-dotenv --quiet
|
|
|
|
- python3 deploy/portainer/undeploy.py
|
|
|
|
--PORTAINER https://dvportainer.privatedns.org
|
|
|
|
--PORTAINER_API_KEY=ptr_RwxH2Cd+htdD2FoFiG46erT9beyvj9VoF3BrQPtDH3Q=
|
|
|
|
--PORTAINER_EP=CICD-runner
|
|
|
|
--GITEA_API_KEY=f449c74ec7f04e54fe1e481eae43492b34cea406
|
|
|
|
--DEPLOY_REPO_URL=${DRONE_REPO_LINK}
|
|
|
|
--DEPLOY_BRANCH=${DRONE_COMMIT_BRANCH}
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- pull_request
|
|
|
|
action:
|
|
|
|
- closed, merged
|