1
0
Fork 0

Replace rancher with portainer deployment

This commit is contained in:
John Ahlroos 2021-09-14 19:45:09 +02:00
parent 3390b2ed71
commit 564d9fc29b
Signed by: john
GPG Key ID: 258D0F70DB84CD5D
1 changed files with 38 additions and 32 deletions

View File

@ -27,6 +27,9 @@ steps:
- ./gradlew --no-daemon --info --build-cache jib - ./gradlew --no-daemon --info --build-cache jib
settings: settings:
use_cache: true use_cache: true
volumes:
- name: docker_config
path: /root/.docker/config.json
environment: environment:
GRADLE_USER_HOME: /drone/src/.gradle-cache GRADLE_USER_HOME: /drone/src/.gradle-cache
ORG_GRADLE_PROJECT_DOCKER_REGISTRY: ORG_GRADLE_PROJECT_DOCKER_REGISTRY:
@ -59,40 +62,43 @@ steps:
GITHUB_PUSH_TOKEN: GITHUB_PUSH_TOKEN:
from_secret: GITHUB_PUSH_TOKEN from_secret: GITHUB_PUSH_TOKEN
- name: publish-to-production - name: publish-to-production
image: fabn/rancher-cli image: maniack/drone-portainer
commands: settings:
- cd infra/$${STACK} portainer:
- echo "key:${RANCHER_ACCESS_KEY}" from_secret: PORTAINER_URL
- echo "secret:${RANCHER_SECRET_KEY}" username:
- rancher up -d -c --upgrade $${SERVICE} from_secret: PORTAINER_USER
environment: password:
STACK: ahlroos.me from_secret: PORTAINER_PASSWORD
SERVICE: pdf-parsers endpoint: ahlroos.me
RANCHER_URL: stack: ahlroos_me
from_secret: RANCHER_URL file: infra/ahlroos.me/docker-compose.yml
RANCHER_ACCESS_KEY: environment:
from_secret: RANCHER_ACCESS_KEY DEBUG: true
RANCHER_SECRET_KEY:
from_secret: RANCHER_SECRET_KEY
- name: save-infra - name: save-infra
image: drone/git image: drone/git
commands: commands:
- cd infra - cd infra
- git diff -U0 - git diff -U0
- git commit -am "Updated $${STACK}/$${SERVICE} to $${TAG}" - git commit -am "Updated $${STACK}/$${SERVICE} to $${TAG}"
- git push origin master - git push origin master
environment: environment:
SERVICE: pdf-parsers SERVICE: pdf-parsers
STACK: ahlroos.me STACK: ahlroos.me
TAG: ${DRONE_TAG} TAG: ${DRONE_TAG}
GITHUB_USERNAME: GITHUB_USERNAME:
from_secret: GITHUB_USERNAME from_secret: GITHUB_USERNAME
GITHUB_PUSH_TOKEN: GITHUB_PUSH_TOKEN:
from_secret: GITHUB_PUSH_TOKEN from_secret: GITHUB_PUSH_TOKEN
trigger: trigger:
ref: ref:
include: include:
- refs/tags/** - refs/tags/**
volumes:
- name: docker_config
host:
path: /root/.docker/config.json