mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-05-22 14:10:52 +02:00
Add SUSE build script
The upstream build script contains lots of logic which is not needed for our use case, instead have build-latest call a simplified script which merely locally builds and tags the latest release, allowing us to more easily update the container stack in the future. Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
parent
a292314d81
commit
e56b23a986
@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Builds the latest released version
|
# Builds the latest released version
|
||||||
|
|
||||||
# Check if we have everything needed for the build
|
|
||||||
source ./build-functions/check-commands.sh
|
|
||||||
|
|
||||||
source ./build-functions/gh-functions.sh
|
source ./build-functions/gh-functions.sh
|
||||||
|
|
||||||
echo "▶️ $0 $*"
|
echo "▶️ $0 $*"
|
||||||
@ -81,5 +78,5 @@ if [ "${PRERELEASE}" == "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
./build.sh "${VERSION}" $@
|
./build-suse.sh "${VERSION}" $@
|
||||||
exit $?
|
exit $?
|
||||||
|
30
build-suse.sh
Executable file
30
build-suse.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh -efux
|
||||||
|
|
||||||
|
SRC_ORG="${SRC_ORG-netbox-community}"
|
||||||
|
SRC_REPO="${SRC_REPO-netbox}"
|
||||||
|
URL="${URL-https://github.com/${SRC_ORG}/${SRC_REPO}.git}"
|
||||||
|
|
||||||
|
NETBOX_BRANCH="${1}"
|
||||||
|
NETBOX_PATH="${NETBOX_PATH-../netbox-git}"
|
||||||
|
|
||||||
|
git clone -q --depth 10 -b "${NETBOX_BRANCH}" "${URL}" "${NETBOX_PATH}"
|
||||||
|
git -C "${NETBOX_PATH}/.git" fetch -qp --depth 10 origin "${NETBOX_BRANCH}"
|
||||||
|
cd "${NETBOX_PATH}"
|
||||||
|
git checkout -qf FETCH_HEAD
|
||||||
|
cd "$OLDPWD"
|
||||||
|
git -C "${NETBOX_PATH}/.git" prune
|
||||||
|
|
||||||
|
GIT_REF="$(git rev-parse HEAD)"
|
||||||
|
PROJECT_VERSION="${PROJECT_VERSION-$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' VERSION)}"
|
||||||
|
NETBOX_GIT_REF="$(git -C "${NETBOX_PATH}/.git" rev-parse HEAD)"
|
||||||
|
NETBOX_GIT_BRANCH="$(git -C "${NETBOX_PATH}/.git" rev-parse --abbrev-ref HEAD)"
|
||||||
|
NETBOX_GIT_URL="$(git -C "${NETBOX_PATH}/.git" remote get-url origin)"
|
||||||
|
|
||||||
|
TAG="${NETBOX_BRANCH}-suse"
|
||||||
|
|
||||||
|
mv "$NETBOX_PATH" .netbox
|
||||||
|
NETBOX_PATH='.netbox'
|
||||||
|
|
||||||
|
NETBOX_PATH="$NETBOX_PATH" TAG="$TAG" docker-compose build
|
||||||
|
|
||||||
|
rm -r "$NETBOX_PATH"
|
Loading…
Reference in New Issue
Block a user