From 9321c229b4244d8d49598977e7c8ca3dda4282e6 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 9 Nov 2023 22:40:12 +0100 Subject: [PATCH] Deploy credentials setup & deploy --- .drone.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index c273437..e2e75da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,6 +15,7 @@ environment: NGINX_MODULES_DIR: /opt/nginx-modules HEADERS_MORE_VERSION: 'v0.35' + steps: - name: Clone w/ submodules image: alpine/git @@ -22,13 +23,14 @@ steps: - git clone $DRONE_REPO_LINK . - git checkout $DRONE_COMMIT - git submodule update --init --recursive + - ls -l - - name: Verify nginx config + - name: Verify config image: ubuntu/nginx:1.24-23.10_beta commands: - nginx -t - - name: Compile nginx + - name: Compile image: ubuntu/nginx:1.24-23.10_beta commands: - mkdir -p $DRONE_WORKSPACE/nginx-build @@ -51,10 +53,33 @@ steps: - make - make install + - name: Verify config post build + image: ubuntu/nginx:1.24-23.10_beta + commands: + - nginx -t + + - name: Setup credentials + image: alpine/git + commands: + - mkdir .ssh + - echo $NGINX_DEPLOY_KEY | base64 -di > .ssh/id_ed25519 + - echo "" >> .ssh/id_ed25519 + - chmod 600 .ssh/id_ed25519 + environment: + NGINX_DEPLOY_KEY: + from_secret: NGINX_DEPLOY_KEY + - name: Deploy image: alpine/git commands: - - tree $DRONE_WORKSPACE/nginx-build + - echo $NGINX_USER + - echo $NGINX_HOST + - ssh -i .ssh/id_ed25519 -o StrictHostKeyChecking=no $NGINX_USER@$NGINX_HOST ls + environment: + NGINX_USER: + from_secret: NGINX_USER + NGINX_HOST: + from_secret: NGINX_HOST --- kind: signature