1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2026-04-24 01:27:37 +00:00
Files
buildpack-nginx/bin/ci-pre-deploy
Jose Diaz-Gonzalez e5f2625df2 feat: set buildpack ref on main branch deploys
The ci-pre-deploy script already sets the buildpack ref for review
apps via a .buildpacks file. For main/master branch deploys, use
dokku buildpacks:set to pin the buildpack to the current branch ref.
2026-04-23 03:16:18 -04:00

32 lines
1.2 KiB
Bash

#!/bin/sh -l
if [ "$IS_REVIEW_APP" = "true" ]; then
git config --global user.name 'Dokku Bot'
git config --global user.email no-reply@dokku.com
echo "-----> Purging repo cache"
ssh "$SSH_REMOTE" -- repo:purge-cache "$APP_NAME"
echo "-----> Setting the test domain name"
ssh "$SSH_REMOTE" -- domains:set "$APP_NAME" "$APP_NAME.dokku.net"
echo "-----> Ensure test includes vendored app-nginx.conf.sigil"
cp conf/app-nginx.conf.sigil app-nginx.conf.sigil
git add app-nginx.conf.sigil
git commit -qm "feat: specify custom app-nginx.conf.sigil"
echo "-----> Ensure test includes vendored mime.types"
cp conf/mime.types mime.types
git add mime.types
git commit -qm "feat: specify custom mime.types"
echo "-----> Setting the buildpack to the current ref $GITHUB_HEAD_REF"
echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_HEAD_REF" >.buildpacks
git add .buildpacks
git commit -qm "feat: specify $GITHUB_SHA as buildpack"
git rev-parse HEAD >ci-commit-override
else
echo "-----> Setting the buildpack to the current ref $GITHUB_REF_NAME"
ssh "$SSH_REMOTE" -- buildpacks:set "$APP_NAME" "https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_REF_NAME}"
fi