diff options
author | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-12-14 11:31:57 +0100 |
---|---|---|
committer | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-12-14 11:31:57 +0100 |
commit | 3ba3f2e1c53638d322d83d332e93efda7c79f2e8 (patch) | |
tree | 61f4f2027ea0cb8054905b441fe46a709e37a9af | |
parent | 27fc51ab63e9e41b72ec1aaaa7546a19d23070e4 (diff) | |
download | xfce4-dev-tools-3ba3f2e1c53638d322d83d332e93efda7c79f2e8.tar.gz |
helpers: Add xfce-build 'pull' argument
This command simply updates the container and then exits.
-rwxr-xr-x | helpers/xfce-build | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/helpers/xfce-build b/helpers/xfce-build index 1c89c25..30298c5 100755 --- a/helpers/xfce-build +++ b/helpers/xfce-build @@ -1,6 +1,9 @@ #!/bin/bash # Just a small script that runs the same build that we have on gitlab-ci locally. +# 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 CONTAINER="xfce/xfce-build" VERSION="latest" @@ -8,15 +11,23 @@ CFLAGS="-Wall -Wno-deprecated-declarations -Werror=implicit-function-declaration VOLUME=$(pwd) BUILD_CMD='cd /tmp; ./autogen.sh && make distcheck' +docker_pull () { + docker pull xfce/xfce-build:$VERSION +} + if [ -z "$1" ]; then VERSION="latest" +elif [[ "$1" == "pull" ]]; then + docker_pull + exit 0 else VERSION=$1 fi # Make sure we're running the latest version -docker pull xfce/xfce-build:$VERSION +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}" printf "\n---\nBuilt using container $CONTAINER:$VERSION on $VOLUME\n" |