From c03f8961e6a7d69aa04eafcca8c7364a9bfd6be9 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Thu, 24 Oct 2024 12:14:52 +0200 Subject: [PATCH 01/20] fix LC_ALL var for Mac devices --- bin/autodeploy.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index 31c077b19..a1a155d41 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -139,7 +139,12 @@ preprovision_hetzner() { msg "INFO: running local ansible playbook for inital server deployment." msg "INFO: This will setup up the Hetzner system with basic defaults, download and unpack the wire-server-deploy artifact." sleep 5 - export LC_ALL="C.UTF-8"; + # on Mac devices C.UTF-8 is not available + if [[ $(uname) == "Darwin" ]]; then + export LC_ALL=en_US.UTF-8 + else + export LC_ALL=C.UTF-8 + fi ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff } From 6c37877bdcc4ceaa2bec04bb55a2bc4846194940 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Thu, 24 Oct 2024 14:53:25 +0200 Subject: [PATCH 02/20] bump ubuntu version on vms --- ansible/hetzner-single-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/hetzner-single-deploy.yml b/ansible/hetzner-single-deploy.yml index 3c446f58c..ac07d4acb 100644 --- a/ansible/hetzner-single-deploy.yml +++ b/ansible/hetzner-single-deploy.yml @@ -2,7 +2,7 @@ become: true vars: artifact_hash: d8fe36747614968ea73ebd43d47b99364c52f9c1 - ubuntu_version: 22.04.4 + ubuntu_version: 22.04.5 ssh_pubkey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDPTGTo1lTqd3Ym/75MRyQvj8xZINO/GI6FzfIadSe5c backend+hetzner-dedicated-operator@wire.com" tasks: - name: set ipv4 forward From 0ea5c231be33b9360996a6749c363ef1bdcd6bd6 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Thu, 24 Oct 2024 14:54:14 +0200 Subject: [PATCH 03/20] add step to install required lib on host machine --- bin/autodeploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index a1a155d41..4eb47c266 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -92,6 +92,7 @@ msg "" msg "INFO: starting Wire-in-a-box deployment for $TARGET_SYSTEM using artifact ID $ARTIFACT_HASH" msg "" + for SUBDOMAIN in $SUBDOMAINS; do if host "$SUBDOMAIN"."$TARGET_SYSTEM" >/dev/null 2>&1 ; then msg "INFO: DNS A record exists: $SUBDOMAIN.$TARGET_SYSTEM" @@ -107,6 +108,7 @@ else die "ERROR: Can't log into $TARGET_SYSTEM via SSH, please check SSH connectivity." fi + if curl --head --silent --fail https://s3-eu-west-1.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-"$ARTIFACT_HASH".tgz >/dev/null 2>&1 ; then msg "INFO: Artifact exists https://s3-eu-west-1.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-$ARTIFACT_HASH.tgz" else @@ -134,6 +136,11 @@ system_cleanup() { rm -f /home/$DEMO_USER/wire-server-deploy-static-*.tgz } +# Make sure the host machine is up to date and has all required packages installed +ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" " + sudo apt update && sudo apt upgrade -y && sudo apt install -y aptitude apt-transport-https bind9-host curl debian-goodies dnsutils git dnsmasq less lsof net-tools rsyslog screen sudo vim wget whois docker.io telnet python3-lxml qemu qemu-kvm qemu-utils libvirt-clients libvirt-daemon-system virtinst bridge-utils +" + preprovision_hetzner() { msg "" msg "INFO: running local ansible playbook for inital server deployment." @@ -392,6 +399,7 @@ if [[ "$EXISTING_CONTAINERS" ]]; then DO_SYSTEM_CLEANUP=true fi + if [ "$DO_SYSTEM_CLEANUP" = false ]; then msg "" msg "INFO: Target system clean, no previous wire-server-deploy installation found." From 544ab08f4ca415b46331da96e8b5dfe333f6be7d Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 12:37:43 +0200 Subject: [PATCH 04/20] create GH action for wiab deployment --- .github/workflows/custom-artifact.yml | 7 ++++- .github/workflows/deploy-wiab.yml | 37 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-wiab.yml diff --git a/.github/workflows/custom-artifact.yml b/.github/workflows/custom-artifact.yml index 8dfb6bc25..9a246a77a 100644 --- a/.github/workflows/custom-artifact.yml +++ b/.github/workflows/custom-artifact.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: offline: - name: Prepare custom offline package + name: Prepare custom offline package # Do not change this name, it is used to trigger deploy-wiab workflow # Useful to skip expensive CI when writing docs if: "!contains(github.event.head_commit.message, 'skip ci')" runs-on: @@ -54,6 +54,11 @@ jobs: env: DOCKER_LOGIN: '${{ secrets.DOCKER_LOGIN }}' + # Set output for deploy-wiab workflow to start + - name: Set output to trigger dependent workflow + if: success() + run: echo "::set-output name=trigger_next_workflow::true" + - name: Deploy offline environment to hetzner run: | ./offline/cd.sh diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml new file mode 100644 index 000000000..861e91d08 --- /dev/null +++ b/.github/workflows/deploy-wiab.yml @@ -0,0 +1,37 @@ +name: Deploy on Hetnzer WIAB setup +on: + workflow_run: + workflows: ["Prepare custom offline package"] + types: + - completed + +jobs: + deploy: + runs-on: ubuntu-latest + concurrency: + group: autodeploy-script + cancel-in-progress: false + + steps: + # Step 1: Checkout the repository code + - name: Checkout code + uses: actions/checkout@v3 + + # Step 2: Set up SSH key for remote access + - name: Set up SSH key + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + # Step 3: Get the latest commit SHA, for the artifact + - name: Get latest commit SHA + id: get_commit_sha + run: | + COMMIT_SHA=$(git rev-parse --short HEAD) + echo "commit_sha=$COMMIT_SHA" >> $GITHUB_ENV + + # Step 4: Run the autodeploy script + - name: Run Auto Deploy Script + run: | + cd bin + ./autodeploy.sh --artifact-hash ${{ env.commit_sha }} --target-domain wiab-test-box.wire.link From 696c179c41c418d172bd4bcaad266f297720c49a Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 14:05:06 +0200 Subject: [PATCH 05/20] update autodeployment script --- bin/autodeploy.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index 4eb47c266..b2d53a512 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -129,18 +129,17 @@ EOT } system_cleanup() { - for VM in $(virsh list --all --name); do virsh destroy "$VM"; virsh undefine "$VM" --remove-all-storage; done - docker system prune -a -f + if which virsh > /dev/null; then + for VM in $(virsh list --all --name); do virsh destroy "$VM"; virsh undefine "$VM" --remove-all-storage; done + fi + if which docker > /dev/null; then + docker system prune -a -f + fi rm -f /home/$DEMO_USER/.ssh/known_hosts rm -rf /home/$DEMO_USER/wire-server-deploy rm -f /home/$DEMO_USER/wire-server-deploy-static-*.tgz } -# Make sure the host machine is up to date and has all required packages installed -ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" " - sudo apt update && sudo apt upgrade -y && sudo apt install -y aptitude apt-transport-https bind9-host curl debian-goodies dnsutils git dnsmasq less lsof net-tools rsyslog screen sudo vim wget whois docker.io telnet python3-lxml qemu qemu-kvm qemu-utils libvirt-clients libvirt-daemon-system virtinst bridge-utils -" - preprovision_hetzner() { msg "" msg "INFO: running local ansible playbook for inital server deployment." @@ -379,27 +378,27 @@ EOF d helm upgrade --install coturn ./charts/coturn --values values/coturn/values.yaml --values values/coturn/secrets.yaml } -EXISTING_INSTALL=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "ls /home/$DEMO_USER/wire-server-deploy-static-*.tgz 2>/dev/null" || true) -EXISTING_VMS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "virsh list --all --name") -EXISTING_CONTAINERS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "docker ps -q --all") +EXISTING_INSTALL=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "ls /home/$DEMO_USER/wire-server-deploy-static-*.tgz 2>/dev/null" || echo "false") +EXISTING_VMS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "virsh list --all --name" || echo "false") +EXISTING_CONTAINERS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "docker ps -q --all" || echo "false") -if [[ "$EXISTING_INSTALL" ]]; then +if [[ "$EXISTING_INSTALL" != "false" && -n "$EXISTING_INSTALL" ]]; then msg "" msg "WARNING: existing wire-server-deploy installation found: $EXISTING_INSTALL" DO_SYSTEM_CLEANUP=true fi -if [[ "$EXISTING_VMS" ]]; then +if [[ "$EXISTING_VMS" != "false" && -n "$EXISTING_VMS" ]]; then msg "" msg "WARNING: existing libvirt VMs found: $EXISTING_VMS" DO_SYSTEM_CLEANUP=true fi -if [[ "$EXISTING_CONTAINERS" ]]; then +if [[ "$EXISTING_CONTAINERS" != "false" && -n "$EXISTING_CONTAINERS" ]]; then + echo "$EXISTING_CONTAINERS" msg "" msg "WARNING: existing Docker containers found." DO_SYSTEM_CLEANUP=true fi - if [ "$DO_SYSTEM_CLEANUP" = false ]; then msg "" msg "INFO: Target system clean, no previous wire-server-deploy installation found." From b0e608497797985c2337b757c35b067d1b17dee5 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 14:37:47 +0200 Subject: [PATCH 06/20] test: trigger on prs --- .github/workflows/deploy-wiab.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index 861e91d08..27d39c0c4 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -1,5 +1,8 @@ name: Deploy on Hetnzer WIAB setup on: + pull_request: + branches: + - master workflow_run: workflows: ["Prepare custom offline package"] types: From dd3dc1812871f9da6ff4b844c07a38761c9bad73 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 14:43:33 +0200 Subject: [PATCH 07/20] use backend hetzner private ssh keys --- .github/workflows/deploy-wiab.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index 27d39c0c4..c51d007d3 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -24,7 +24,7 @@ jobs: - name: Set up SSH key uses: webfactory/ssh-agent@v0.5.3 with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key: ${{ secrets.WIAB_PRIVATE_SSH_KEY }} # Step 3: Get the latest commit SHA, for the artifact - name: Get latest commit SHA @@ -37,4 +37,4 @@ jobs: - name: Run Auto Deploy Script run: | cd bin - ./autodeploy.sh --artifact-hash ${{ env.commit_sha }} --target-domain wiab-test-box.wire.link + ./autodeploy.sh --artifact-hash ${{ env.commit_sha }} --target-domain wiab-test-box.wire.link --force-redeploy From b4c750a97819b81edd5091c88233a76f98c3252a Mon Sep 17 00:00:00 2001 From: Jan Schumacher Date: Fri, 25 Oct 2024 14:48:24 +0200 Subject: [PATCH 08/20] bin/offline-vm-setup.sh: waiting for VM deployment to finish before exiting script --- bin/offline-vm-setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/offline-vm-setup.sh b/bin/offline-vm-setup.sh index 1667a338c..50ad78434 100755 --- a/bin/offline-vm-setup.sh +++ b/bin/offline-vm-setup.sh @@ -223,3 +223,8 @@ for (( i=0; i<${#VM_NAME[@]}; i++ )); do sleep 20 fi done + +while sudo virsh list --all | grep -Fq running; do + sleep 20 + msg "INFO: VM deployment still in progress ..." +done From 1232b55837defb1c11d7b980c7532a4722275a45 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 14:50:06 +0200 Subject: [PATCH 09/20] test: log errors while ssh into machine --- bin/autodeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index b2d53a512..41a2f34c1 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -101,7 +101,7 @@ for SUBDOMAIN in $SUBDOMAINS; do fi done -if ssh -q -o ConnectTimeout=5 -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" id | grep -q "$SSH_USER"; then +if ssh -v -o StrictHostKeyChecking=no -o ConnectTimeout=5 -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" id | grep -q "$SSH_USER"; then msg "" msg "INFO: Successfully logged into $TARGET_SYSTEM as $SSH_USER" else From 86084ae2042325aa1cd07711c7827a1fc5b0f7dd Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 14:56:40 +0200 Subject: [PATCH 10/20] fetch full commit sha --- .github/workflows/deploy-wiab.yml | 4 ++-- bin/autodeploy.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index c51d007d3..cbbc82c1f 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -1,4 +1,4 @@ -name: Deploy on Hetnzer WIAB setup +name: Deploy on Hetzner WIAB setup on: pull_request: branches: @@ -30,7 +30,7 @@ jobs: - name: Get latest commit SHA id: get_commit_sha run: | - COMMIT_SHA=$(git rev-parse --short HEAD) + COMMIT_SHA=$(git rev-parse HEAD) echo "commit_sha=$COMMIT_SHA" >> $GITHUB_ENV # Step 4: Run the autodeploy script diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index 41a2f34c1..baf188a87 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -101,7 +101,7 @@ for SUBDOMAIN in $SUBDOMAINS; do fi done -if ssh -v -o StrictHostKeyChecking=no -o ConnectTimeout=5 -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" id | grep -q "$SSH_USER"; then +if ssh -q -o StrictHostKeyChecking=no -o ConnectTimeout=5 -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" id | grep -q "$SSH_USER"; then msg "" msg "INFO: Successfully logged into $TARGET_SYSTEM as $SSH_USER" else @@ -120,7 +120,7 @@ system_cleanup_meta() { msg "INFO: Cleaning up all VMs, docker resources and wire-server-deploy files on $TARGET_SYSTEM." msg "" sleep 5 - ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "bash -s" </dev/null" || echo "false") -EXISTING_VMS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "virsh list --all --name" || echo "false") -EXISTING_CONTAINERS=$(ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "docker ps -q --all" || echo "false") +EXISTING_INSTALL=$(ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$SSH_USER"@webapp."$TARGET_SYSTEM" "ls /home/$DEMO_USER/wire-server-deploy-static-*.tgz 2>/dev/null" || echo "false") +EXISTING_VMS=$(ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$SSH_USER"@webapp."$TARGET_SYSTEM" "virsh list --all --name" || echo "false") +EXISTING_CONTAINERS=$(ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$SSH_USER"@webapp."$TARGET_SYSTEM" "docker ps -q --all" || echo "false") if [[ "$EXISTING_INSTALL" != "false" && -n "$EXISTING_INSTALL" ]]; then msg "" @@ -418,7 +418,7 @@ fi msg "INFO: Commencing Wire-in-a-box deployment on $TARGET_SYSTEM." preprovision_hetzner -ssh -p "$SSH_PORT" "$DEMO_USER"@webapp."$TARGET_SYSTEM" "bash -s" < Date: Fri, 25 Oct 2024 14:59:34 +0200 Subject: [PATCH 11/20] temp: hard code sha to test the deployment --- .github/workflows/deploy-wiab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index cbbc82c1f..1783564ec 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -37,4 +37,4 @@ jobs: - name: Run Auto Deploy Script run: | cd bin - ./autodeploy.sh --artifact-hash ${{ env.commit_sha }} --target-domain wiab-test-box.wire.link --force-redeploy + ./autodeploy.sh --artifact-hash 2e8e4319ff3a8c309dc0ef5a1800611faa1ab0cb --target-domain wiab-test-box.wire.link --force-redeploy From 1cc571efd6d40ad19f7793481855442f0289040e Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 15:05:51 +0200 Subject: [PATCH 12/20] remove deprecated get_md5 --- ansible/hetzner-single-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/hetzner-single-deploy.yml b/ansible/hetzner-single-deploy.yml index ac07d4acb..d7991246b 100644 --- a/ansible/hetzner-single-deploy.yml +++ b/ansible/hetzner-single-deploy.yml @@ -171,7 +171,6 @@ stat: path: /home/demo/wire-server-deploy-static-{{ artifact_hash }}.tgz get_checksum: False - get_md5: False register: artifact_archive_file_check - name: download wire-server-deploy archive shell: From e76ef6013720b9161b84f1de48d6ad0cdf98983f Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 25 Oct 2024 15:23:56 +0200 Subject: [PATCH 13/20] increse ssh coneection retry timeout --- bin/autodeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index baf188a87..a6634ac0d 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -151,7 +151,7 @@ preprovision_hetzner() { else export LC_ALL=C.UTF-8 fi - ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff + ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -e "ansible_ssh_timeout=120" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff } remote_deployment() { From 58de56764dc6b0d02e42c2f427c22a10c401784b Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Mon, 28 Oct 2024 11:57:31 +0100 Subject: [PATCH 14/20] pass keepalive args to ansible playbook --- bin/autodeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index a6634ac0d..7ce6a417a 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -151,7 +151,7 @@ preprovision_hetzner() { else export LC_ALL=C.UTF-8 fi - ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -e "ansible_ssh_timeout=120" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff + ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -e "ansible_ssh_common_args='-o ServerAliveInterval=60 -o ServerAliveCountMax=3'" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff } remote_deployment() { From 12da73ea9121a7d7b115ae72d290b0919c831f0b Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Mon, 28 Oct 2024 12:10:26 +0100 Subject: [PATCH 15/20] remove deprecated get_md5 argument --- ansible/hetzner-single-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/hetzner-single-deploy.yml b/ansible/hetzner-single-deploy.yml index d7991246b..ffbc63ef8 100644 --- a/ansible/hetzner-single-deploy.yml +++ b/ansible/hetzner-single-deploy.yml @@ -181,7 +181,6 @@ stat: path: /home/demo/wire-server-deploy/containers-helm.tar get_checksum: False - get_md5: False register: artifact_folder_content_check - name: unpack wire-server-deploy archive unarchive: From e17dfcbbb851f8947ae9a40e10be02b89a1e05be Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Mon, 28 Oct 2024 12:39:46 +0100 Subject: [PATCH 16/20] remove deprecated argument from check ubuntu exists step --- ansible/hetzner-single-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/hetzner-single-deploy.yml b/ansible/hetzner-single-deploy.yml index ffbc63ef8..4d086fe32 100644 --- a/ansible/hetzner-single-deploy.yml +++ b/ansible/hetzner-single-deploy.yml @@ -192,7 +192,6 @@ stat: path: /home/demo/wire-server-deploy/ubuntu.iso get_checksum: False - get_md5: False register: iso_file_check - name: download ubuntu {{ ubuntu_version }} iso shell: From 6af8ae9887c4760ef75727d8e838ab1270e63401 Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Mon, 28 Oct 2024 14:42:47 +0100 Subject: [PATCH 17/20] temp: increase session timeout in ansible --- bin/autodeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index 7ce6a417a..151cdcc7c 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -151,7 +151,7 @@ preprovision_hetzner() { else export LC_ALL=C.UTF-8 fi - ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -e "ansible_ssh_common_args='-o ServerAliveInterval=60 -o ServerAliveCountMax=3'" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff + ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -e "ansible_ssh_common_args='-o ServerAliveInterval=30 -o ServerAliveCountMax=10 -o ControlMaster=auto -o ControlPersist=180m'" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff } remote_deployment() { From 9a0712a7826a36b2f7de11d25b3f0d73e7a8f34c Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Mon, 28 Oct 2024 15:01:19 +0100 Subject: [PATCH 18/20] add conn persistent vars to ssh --- bin/autodeploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autodeploy.sh b/bin/autodeploy.sh index 151cdcc7c..7c6bfd18b 100755 --- a/bin/autodeploy.sh +++ b/bin/autodeploy.sh @@ -418,7 +418,7 @@ fi msg "INFO: Commencing Wire-in-a-box deployment on $TARGET_SYSTEM." preprovision_hetzner -ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$DEMO_USER"@webapp."$TARGET_SYSTEM" "bash -s" < Date: Thu, 31 Oct 2024 13:22:16 +0100 Subject: [PATCH 19/20] trigger only after custom artifact is created --- .github/workflows/deploy-wiab.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index 1783564ec..a13d2f163 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -1,8 +1,5 @@ name: Deploy on Hetzner WIAB setup on: - pull_request: - branches: - - master workflow_run: workflows: ["Prepare custom offline package"] types: From 0494f8b8b0dbff94d4f7f5f05898d813cbeff3ed Mon Sep 17 00:00:00 2001 From: Amit Sagtani Date: Fri, 1 Nov 2024 11:46:31 +0100 Subject: [PATCH 20/20] remove hardcoded sha --- .github/workflows/deploy-wiab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-wiab.yml b/.github/workflows/deploy-wiab.yml index a13d2f163..a7c74e289 100644 --- a/.github/workflows/deploy-wiab.yml +++ b/.github/workflows/deploy-wiab.yml @@ -34,4 +34,4 @@ jobs: - name: Run Auto Deploy Script run: | cd bin - ./autodeploy.sh --artifact-hash 2e8e4319ff3a8c309dc0ef5a1800611faa1ab0cb --target-domain wiab-test-box.wire.link --force-redeploy + ./autodeploy.sh --artifact-hash ${{ env.COMMIT_SHA }} --target-domain wiab-test-box.wire.link --force-redeploy