Commit 385f4322 authored by Simon Steinbeiß's avatar Simon Steinbeiß

helpers: Add 'xfce-build describe' command

This command prints the versions of the components built within this container, which are located in the /git folder.
parent 418ba8d0
Pipeline #5795 passed with stages
in 11 minutes and 57 seconds
......@@ -4,6 +4,8 @@
# Possible arguments:
# - the version of the xfce-build container (if you want to build with a special version)
# - 'pull' to simply update the container and exit
# - 'version' as second positional argument after an actual version (e.g. xfce-build latest version)
# to print all git versions built in the container by build_libs.sh
CONTAINER="xfce/xfce-build"
VERSION="latest"
......@@ -15,19 +17,27 @@ docker_pull () {
docker pull xfce/xfce-build:$VERSION
}
docker_run () {
# Run the build in the docker container
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) --volume $VOLUME:/tmp --env CFLAGS="${CFLAGS}" --env CONTAINER=$CONTAINER --env VERSION=$VERSION $CONTAINER:$VERSION /bin/bash -c "${BUILD_CMD}"
}
# Parse the commandline arguments
if [ -z "$1" ]; then
VERSION="latest"
elif [[ "$1" == "pull" ]]; then
docker_pull
exit 0
else
VERSION=$1
elif [[ "$1" == "describe" ]]; then
if [[ ! -z "$2" ]]; then
VERSION="$2"
fi
BUILD_CMD='printf "\e[1m$CONTAINER:$VERSION contains:\e[0m\n";cat /git/xfce_build_version_info.txt'
docker_run
exit 0
fi
# Make sure we're running the latest version
# Run the local build
docker_pull
# Run the build in the docker container
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) --volume $VOLUME:/tmp --env CFLAGS="${CFLAGS}" $CONTAINER:$VERSION /bin/bash -c "${BUILD_CMD}"
docker_run
printf "\n---\nBuilt using container $CONTAINER:$VERSION on $VOLUME\n"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment