Pass Gitea credentials to remote-install, clean up after clone
This commit is contained in:
@@ -3,6 +3,9 @@ set -e
|
||||
|
||||
: "${WEBROOT:?WEBROOT is not set}"
|
||||
: "${USER_REPO:?USER_REPO is not set}"
|
||||
: "${GITEA_HOST:?GITEA_HOST is not set}"
|
||||
: "${GITEA_USER:?GITEA_USER is not set}"
|
||||
: "${GITEA_TOKEN:?GITEA_TOKEN is not set}"
|
||||
|
||||
echo "==> Installing PHP extensions"
|
||||
apt-get install -y php-curl php-gd php-mbstring php-xml php-zip php-yaml php-intl
|
||||
@@ -15,8 +18,11 @@ mv grav-admin/* grav-admin/.htaccess .
|
||||
rm -rf grav-admin grav-admin.zip
|
||||
|
||||
echo "==> Cloning user repo"
|
||||
printf 'machine %s\nlogin %s\npassword %s\n' "$GITEA_HOST" "$GITEA_USER" "$GITEA_TOKEN" > ~/.netrc
|
||||
chmod 600 ~/.netrc
|
||||
rm -rf user
|
||||
git clone "$USER_REPO" user
|
||||
rm ~/.netrc
|
||||
|
||||
echo "==> Setting permissions"
|
||||
find "$WEBROOT" -type f -exec chmod 664 {} \;
|
||||
|
||||
Reference in New Issue
Block a user