Transfer config files to host

This commit is contained in:
2023-11-09 23:43:18 +01:00
parent bf3a8a150d
commit 8e831a7bc6

View File

@@ -33,7 +33,7 @@ steps:
- name: Compile - name: Compile
image: ubuntu/nginx:1.24-23.10_beta image: ubuntu/nginx:1.24-23.10_beta
commands: commands:
- mkdir -p $DRONE_WORKSPACE/nginx-build - mkdir -p /tmp/nginx-build
- apt update - apt update
- apt install -y - apt install -y
wget wget
@@ -44,14 +44,18 @@ steps:
zlib1g-dev zlib1g-dev
libssl-dev libssl-dev
tree tree
- cd /tmp
- wget "http://nginx.org/download/nginx-$${NGINX_VERSION}.tar.gz" - wget "http://nginx.org/download/nginx-$${NGINX_VERSION}.tar.gz"
- tar -xvzf nginx-$${NGINX_VERSION}.tar.gz - tar -xvzf nginx-$${NGINX_VERSION}.tar.gz
- cd nginx-$${NGINX_VERSION} - cd nginx-$${NGINX_VERSION}
- ./configure --prefix=$DRONE_WORKSPACE/nginx-build - ./configure --prefix=/tmp/nginx-build
--add-dynamic-module=../modules-available/headers-more-nginx-module --add-dynamic-module=$DRONE_WORKSPACE/modules-available/headers-more-nginx-module
--with-compat --with-compat
- make - make
- make install - make install
- cd $DRONE_WORKSPACE
- mv /tmp/nginx-build/modules/* .
- tree
- name: Verify config post build - name: Verify config post build
image: ubuntu/nginx:1.24-23.10_beta image: ubuntu/nginx:1.24-23.10_beta
@@ -62,6 +66,7 @@ steps:
image: alpine/git image: alpine/git
commands: commands:
- mkdir .ssh - mkdir .ssh
- echo $NGINX_FINGERPRINT | base64 -di > .ssh/known_hosts
- echo $NGINX_DEPLOY_KEY | base64 -di > .ssh/id_ed25519 - echo $NGINX_DEPLOY_KEY | base64 -di > .ssh/id_ed25519
- echo "" >> .ssh/id_ed25519 - echo "" >> .ssh/id_ed25519
- chmod 600 .ssh/id_ed25519 - chmod 600 .ssh/id_ed25519
@@ -72,9 +77,7 @@ steps:
- name: Deploy - name: Deploy
image: alpine/git image: alpine/git
commands: commands:
- echo $NGINX_USER - ssh -i .ssh/id_ed25519 $NGINX_USER@$NGINX_HOST ls
- echo $NGINX_HOST
- ssh -i .ssh/id_ed25519 -o StrictHostKeyChecking=no $NGINX_USER@$NGINX_HOST ls
environment: environment:
NGINX_USER: NGINX_USER:
from_secret: NGINX_USER from_secret: NGINX_USER