mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 22:07:17 +00:00
Implement invalid tag detection
This commit is contained in:
parent
043ae95801
commit
1507a9338b
@ -23,6 +23,7 @@ run() {
|
|||||||
clone_required_repos_ask_ssh_or_https
|
clone_required_repos_ask_ssh_or_https
|
||||||
local tag
|
local tag
|
||||||
tag="${BASEIMAGE_ONLY:-$(remotebase="${REMOTEBASE}" baseimage_latest_upstream_tag)}"
|
tag="${BASEIMAGE_ONLY:-$(remotebase="${REMOTEBASE}" baseimage_latest_upstream_tag)}"
|
||||||
|
tag=${tag} verify_baseimage_tag
|
||||||
tag=${tag} build_baseimage
|
tag=${tag} build_baseimage
|
||||||
|
|
||||||
if [ -z "${BASEIMAGE_ONLY:-}" ]; then
|
if [ -z "${BASEIMAGE_ONLY:-}" ]; then
|
||||||
@ -105,14 +106,6 @@ clone_required_repos() {
|
|||||||
echo "Done!"
|
echo "Done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_frontend_deps() {
|
|
||||||
echo -n "Installing frontend dependencies... "
|
|
||||||
pushd "${FRONTEND_REPO}"
|
|
||||||
spinned logged yarn install
|
|
||||||
popd
|
|
||||||
echo "Done!"
|
|
||||||
}
|
|
||||||
|
|
||||||
baseimage_latest_upstream_tag() {
|
baseimage_latest_upstream_tag() {
|
||||||
echo -n "$(git ls-remote --tags ${remotebase}/${BASEIMAGE_REPO}.git |
|
echo -n "$(git ls-remote --tags ${remotebase}/${BASEIMAGE_REPO}.git |
|
||||||
cut -f2 |
|
cut -f2 |
|
||||||
@ -121,6 +114,18 @@ baseimage_latest_upstream_tag() {
|
|||||||
tail -n 1)"
|
tail -n 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verify_baseimage_tag() {
|
||||||
|
pushd "${BASEIMAGE_REPO}"
|
||||||
|
local statuscode
|
||||||
|
if ! git rev-parse --quiet \
|
||||||
|
--verify \
|
||||||
|
"refs/tags/${tag}" &> /dev/null; then
|
||||||
|
logged echo "${tag} is not a valid tag!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
pin_baseimage() {
|
pin_baseimage() {
|
||||||
echo -n "Pinning TFW baseimage version... "
|
echo -n "Pinning TFW baseimage version... "
|
||||||
echo -n "which is ${tag}... "
|
echo -n "which is ${tag}... "
|
||||||
@ -137,6 +142,14 @@ build_baseimage() {
|
|||||||
echo "Done!"
|
echo "Done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_frontend_deps() {
|
||||||
|
echo -n "Installing frontend dependencies... "
|
||||||
|
pushd "${FRONTEND_REPO}"
|
||||||
|
spinned logged yarn install
|
||||||
|
popd
|
||||||
|
echo "Done!"
|
||||||
|
}
|
||||||
|
|
||||||
cleanup_repos() {
|
cleanup_repos() {
|
||||||
rm -rf "${BASEIMAGE_REPO}"
|
rm -rf "${BASEIMAGE_REPO}"
|
||||||
rm -rf "${CHALLENGE}/.git"
|
rm -rf "${CHALLENGE}/.git"
|
||||||
|
Loading…
Reference in New Issue
Block a user