Skip to content
Snippets Groups Projects
Commit e6440303 authored by Moritz Maxeiner's avatar Moritz Maxeiner
Browse files

Detect gpu driver version change and only disable cache when necessary

parent 871c705d
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,11 @@ build-ubuntu-18.04:
before_script:
- echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script:
- docker build --no-cache --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu-18.04" ubuntu-18.04
- GPU_DRIVER_VERSION="$(dpkg-query --showformat='${Version}' --show 'nvidia-driver-*')"
- echo $GPU_DRIVER_VERSION
- if [[ -f $XDG_RUNTIME_DIR/rf_docker-gpu-driver-version ]] && [[ "$(cat $XDG_RUNTIME_DIR/rf_docker-gpu-driver-version)" == "$GPU_DRIVER_VERSION" ]]; then OPTS=''; else OPTS='--no-cache'; fi
- echo -n $GPU_DRIVER_VERSION > $XDG_RUNTIME_DIR/rf_docker-gpu-driver-version
- docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu-18.04" ubuntu-18.04
- docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu-18.04"
after_script:
- docker logout "${CI_REGISTRY}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment