File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2020
2121cd $( readlink -f $( dirname " $0 " ) )
2222
23- IMAGE=appimagelauncher-build: " $DOCKER_DIST "
23+ IMAGE=quay.io/ appimagelauncher-build/ " $DOCKER_DIST "
2424DOCKERFILE=Dockerfile.build-" $DOCKER_DIST "
2525
2626if [ ! -f " $DOCKERFILE " ]; then
@@ -29,11 +29,15 @@ if [ ! -f "$DOCKERFILE" ]; then
2929fi
3030
3131if [ " $ARCH " == " i386" ]; then
32- IMAGE=appimagelauncher-build: " $DOCKER_DIST " -i386-cross
32+ IMAGE=" $IMAGE " -i386-cross
3333 DOCKERFILE=Dockerfile.build-" $DOCKER_DIST " -i386-cross
3434fi
3535
36- docker build -t " $IMAGE " -f " $DOCKERFILE " .
36+ # speed up build by pulling last built image from quay.io and building the docker file using the old image as a base
37+ docker pull " $IMAGE " || true
38+ # if the image hasn't changed, this should be a no-op
39+ IMAGE=" $IMAGE " :latest
40+ docker build --cache-from " $IMAGE " -t " $IMAGE " -f " $DOCKERFILE " .
3741
3842if [[ " $BUILD_LITE " == " " ]]; then
3943 build_script=travis-build.sh
4953
5054docker run -e ARCH -e TRAVIS_BUILD_NUMBER --rm -it " ${DOCKER_OPTS[@]} " -v $( readlink -f ..) :/ws " $IMAGE " \
5155 bash -xc " export CI=1 && export DEBIAN_DIST=\" $DOCKER_DIST \" && cd /ws && source travis/$build_script "
56+
57+ # push built image as cache for future builds to registry
58+ # credentials shall only be available on (protected) master branch
59+ if [[ " $DOCKER_USERNAME " != " " ]]; then
60+ echo " $DOCKER_PASSWORD " | docker login -u " $DOCKER_USERNAME " --password-stdin quay.io
61+ docker push " $IMAGE "
62+ fi
You can’t perform that action at this time.
0 commit comments