Deply on commit
continuous-integration/drone/push Build is passing Details

pull/1/head
lars 2023-10-02 11:51:20 -05:00
commit db9de5342f
6 changed files with 99 additions and 0 deletions

16
.drone.yml Normal file
View File

@ -0,0 +1,16 @@
kind: pipeline
type: docker
name: deploy
steps:
- name: Push to Portainer
image: alpine
commands:
- apk update
- apk add envsubst curl
- envsubst < portainer_deploy.template.json > portainer_deploy.json
- curl -d "portainer_deploy.json" -H "X-Api-Key=ptr_RwxH2Cd+htdD2FoFiG46erT9beyvj9VoF3BrQPtDH3Q=" -X POST https://dvportainer.privatedns.org/stacks/create/standalone/repository
trigger:
branch:
- main

2
.env Normal file
View File

@ -0,0 +1,2 @@
HOST=dvdemo.localhost
ECHO_PATH=echo

20
docker-compose.yml Normal file
View File

@ -0,0 +1,20 @@
version: '3.4'
services:
http-echo:
container_name: http-echo
image: mendhak/http-https-echo:latest
expose:
- 8080
environment:
- VIRTUAL_PORT=8080
- VIRTUAL_HOST=${HOST}
- VIRTUAL_PATH=/${ECHO_PATH}/
- VIRTUAL_DEST=/
networks:
- cicd
networks:
cicd:
driver: bridge
external: true

View File

@ -0,0 +1,11 @@
version: '3.4'
services:
http-echo:
networks:
- cicd
networks:
cicd:
driver: bridge
external: true

25
portainer_deploy.json Normal file
View File

@ -0,0 +1,25 @@
{
"additionalFiles": [],
"autoUpdate": {
"forcePullImage": false,
"forceUpdate": false,
"interval": "1m30s",
"jobID": "15",
"webhook": "05de31a2-79fa-4644-9c12-faa67e5c49f0"
},
"composeFile": "docker-compose.yml",
"env": [
{
"HOST": "dvdemo.privatedns.org",
"ECHO_PATH": "deployed_echo"
}
],
"fromAppTemplate": false,
"name": "DeployTest_test1",
"repositoryAuthentication": true,
"repositoryUsername": "cicd",
"repositoryPassword": "gJ6@$7ZjWGyV4%i",
"repositoryReferenceName": "/refs/heads/main",
"repositoryURL": "https://dvgit.privatedns.org/lars/DeployTests",
"tlsskipVerify": false
}

View File

@ -0,0 +1,25 @@
{
"additionalFiles": [],
"autoUpdate": {
"forcePullImage": false,
"forceUpdate": false,
"interval": "1m30s",
"jobID": "15",
"webhook": "05de31a2-79fa-4644-9c12-faa67e5c49f0"
},
"composeFile": "docker-compose.yml",
"env": [
{
"HOST": "dvdemo.privatedns.org",
"ECHO_PATH": "deployed_echo"
}
],
"fromAppTemplate": false,
"name": "DeployTest_${DRONE_COMMIT}",
"repositoryAuthentication": true,
"repositoryUsername": "cicd",
"repositoryPassword": "gJ6@$7ZjWGyV4%i",
"repositoryReferenceName": "${DRONE_COMMIT_REF}",
"repositoryURL": "${DRONE_REPO_LINK}",
"tlsskipVerify": false
}