Ensure all helper scripts pushd/popd
Make sure all of these move to the root of the repository first, then return to where they were afterwards, using pushd/popd. This allows them to be executed from anywhere in the repo.
This commit is contained in:
parent
b9c30baf80
commit
ac885b855a
|
@ -27,6 +27,9 @@ fi
|
|||
HOSTS=( ${@} )
|
||||
echo "> Deploying to host(s): ${HOSTS[@]}"
|
||||
|
||||
# Move to repo root if we're not
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
|
||||
# Prepare code
|
||||
echo "Preparing code (format and lint)..."
|
||||
./prepare || exit
|
||||
|
@ -64,3 +67,5 @@ done
|
|||
if [[ -z ${KEEP_ARTIFACTS} ]]; then
|
||||
rm ../pvc*_${version}*
|
||||
fi
|
||||
|
||||
popd &>/dev/null
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
ver="$( head -1 debian/changelog | awk -F'[()-]' '{ print $2 }' )"
|
||||
git pull
|
||||
rm ../pvc_*
|
||||
|
@ -6,3 +7,4 @@ find . -name "__pycache__" -exec rm -r {} \;
|
|||
dh_make -p pvc_${ver} --createorig --single --yes
|
||||
dpkg-buildpackage -us -uc
|
||||
dh_clean
|
||||
popd &>/dev/null
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
set -o xtrace
|
||||
exec 3>&1
|
||||
exec 1>&2
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
# Ensure we're up to date
|
||||
git pull --rebase
|
||||
# Update the version to a sensible git revision for easy visualization
|
||||
|
@ -37,3 +38,4 @@ cp -a ${tmpdir}/api-Daemon.py api-daemon/pvcapid/Daemon.py
|
|||
# Clean up
|
||||
rm -r ${tmpdir}
|
||||
dh_clean
|
||||
popd &>/dev/null
|
||||
|
|
|
@ -7,6 +7,8 @@ if [[ -z ${new_version} ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
|
||||
current_version="$( cat .version )"
|
||||
echo "${current_version} -> ${new_version}"
|
||||
|
||||
|
@ -47,6 +49,8 @@ mv ${deb_changelog_file} debian/changelog
|
|||
git add node-daemon/pvcnoded/Daemon.py api-daemon/pvcapid/Daemon.py client-cli/setup.py debian/changelog CHANGELOG.md .version
|
||||
git commit -v
|
||||
|
||||
popd &>/dev/null
|
||||
|
||||
echo
|
||||
echo "GitLab release message:"
|
||||
echo
|
||||
|
|
4
format
4
format
|
@ -5,10 +5,14 @@ if ! which black &>/dev/null; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
|
||||
echo "Formatting..."
|
||||
black --safe --exclude api-daemon/migrations .
|
||||
ret=$?
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "Successfully formatted project!"
|
||||
fi
|
||||
|
||||
popd &>/dev/null
|
||||
exit $ret
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
|
||||
VERSION="$( head -1 debian/changelog | awk -F'[()-]' '{ print $2 }' )"
|
||||
|
||||
pushd api-daemon
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
pushd api-daemon &>/dev/null
|
||||
export PVC_CONFIG_FILE="./pvcapid.sample.yaml"
|
||||
./pvcapid-manage.py db migrate -m "PVC version ${VERSION}"
|
||||
./pvcapid-manage.py db upgrade
|
||||
popd
|
||||
popd &>/dev/null
|
||||
popd &>/dev/null
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
# Generate the Zookeeper migration files
|
||||
|
||||
pushd api-daemon
|
||||
pushd $( git rev-parse --show-toplevel ) &>/dev/null
|
||||
pushd api-daemon &>/dev/null
|
||||
./pvcapid-manage-zk.py
|
||||
popd
|
||||
popd &>/dev/null
|
||||
popd &>/dev/null
|
||||
|
|
Loading…
Reference in New Issue