add volumes to share ssh between steps
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Dovi Cowan 2023-02-21 02:00:03 +00:00
parent 7c0b5411b4
commit 9ca3b2daea
Signed by: dcowan
GPG key ID: C110D77558FBC227

View file

@ -6,7 +6,8 @@ platform:
os: linux os: linux
arch: amd64 arch: amd64
image: bitnami/git:2.39.2 pool:
use: ubuntu:latest
environment: environment:
BRANCH: main BRANCH: main
@ -19,11 +20,15 @@ environment:
steps: steps:
- name: configure-environment - name: configure-environment
pull: always pull: always
image: bitnami/git:2.39.2
volumes:
- name: ssh
path: ~/.ssh
environment: environment:
SSH_PRIVATE_KEY: SSH_PRIVATE_KEY:
from_secret: dokku_ssh_key from_secret: dokku_ssh_key
JUMP_PRIVATE_KEY: JUMP_PRIVATE_KEY:
from_secret: dokku_ssh_key from_secret: dokku_ssh_key
commands: commands:
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- echo -e "Host jump\n Hostname $JUMP_HOST\n User $JUMP_USER\n IdentityFile ~/.ssh/id_rsa\n StrictHostKeyChecking no" > ~/.ssh/config - echo -e "Host jump\n Hostname $JUMP_HOST\n User $JUMP_USER\n IdentityFile ~/.ssh/id_rsa\n StrictHostKeyChecking no" > ~/.ssh/config
@ -37,9 +42,17 @@ steps:
- chmod 600 ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa
- apt-get update && apt-get install git -y - apt-get update && apt-get install git -y
- name: add-remote - name: add-remote
image: bitnami/git:2.39.2
volumes:
- name: ssh
path: ~/.ssh
commands: commands:
- git remote add dokku dokku:$DOKKU_APP_NAME - git remote add dokku dokku:$DOKKU_APP_NAME
- name: push-to-dokku - name: push-to-dokku
image: bitnami/git:2.39.2
volumes:
- name: ssh
path: ~/.ssh
commands: commands:
- git push dokku $BRANCH - git push dokku $BRANCH