Skip to content

Commit

Permalink
lando/core#71: Wait for user to clone repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec committed Oct 5, 2023
1 parent b57057f commit 12bf137
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipes/acquia/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ module.exports = {
cmd: '/helpers/load-keys.sh --silent',
user: 'root',
},
{
name: 'wait-for-user',
cmd: '/helpers/wait-for-user.sh'
},
{
name: 'clone-repo',
cmd: options =>
Expand Down
19 changes: 19 additions & 0 deletions scripts/acquia-wait-for-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

# user info
user="${1:-$LANDO_WEBROOT_USER}"
id="${2:-$LANDO_HOST_UID}"

# retry settings
attempt=0
delay=1
retry=5

until [ "$attempt" -ge "$retry" ]
do
id "$user"| grep uid | grep "$id" &>/dev/null && break
attempt=$((attempt+1))
sleep "$delay"
done

0 comments on commit 12bf137

Please sign in to comment.