Skip to content

Commit

Permalink
fetch full commit sha
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsagtani97 committed Oct 25, 2024
1 parent 1232b55 commit 86084ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-wiab.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy on Hetnzer WIAB setup
name: Deploy on Hetzner WIAB setup
on:
pull_request:
branches:
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions bin/autodeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" <<EOT
ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$SSH_USER"@webapp."$TARGET_SYSTEM" "bash -s" <<EOT
# Making relevant vars and functions available to remote shell via SSH
$(declare -p DEMO_USER)
$(declare -f system_cleanup)
Expand Down Expand Up @@ -378,9 +378,9 @@ 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" || 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 ""
Expand Down Expand Up @@ -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" <<EOT
ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no "$DEMO_USER"@webapp."$TARGET_SYSTEM" "bash -s" <<EOT
# Making relevant vars and functions available to remote shell via SSH
$(declare -p DEMO_USER TARGET_SYSTEM SCRIPT_DIR)
$(declare -f remote_deployment)
Expand Down

0 comments on commit 86084ae

Please sign in to comment.