gitdeploy/examples/deploy.sh

25 lines
503 B
Bash
Raw Normal View History

2020-09-29 03:15:30 +00:00
#!/bin/bash
# These environment variables are set by the caller
2020-09-29 03:15:30 +00:00
my_envs='GIT_REF_NAME
GIT_REF_TYPE
GIT_REPO_ID
2020-09-29 03:15:30 +00:00
GIT_REPO_OWNER
GIT_REPO_NAME
GIT_CLONE_URL'
2020-10-09 08:57:01 +00:00
# The directory of this bash script
base_dir="$(dirname "$(readlink -f "$0")")"
2020-10-09 08:57:01 +00:00
if [[ -f "${base_dir}/${GIT_REPO_ID}/deploy.sh" ]]
then
echo "Running deplay script for ${GIT_REPO_ID}"
2020-10-09 08:57:01 +00:00
bash "${base_dir}/${GIT_REPO_ID}/deploy.sh"
else
echo "Nothing to do for ${GIT_REPO_ID}"
for x in $my_envs; do
echo "$x=${!x}"
done
sleep 1
fi