-
Jean-Baptiste Keck authoredJean-Baptiste Keck authored
pull_docker_image.sh 1.08 KiB
#!/usr/bin/env bash
##
## Copyright (C) HySoP 2011-2022
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
set -euf -o pipefail
DOCKER_IMAGE_TAG=${1:-jammy}
HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr'
docker logout
if [[ -z "${HYSOP_REGISTRY_USERNAME}" ]] || [[ -z "${HYSOP_REGISTRY_TOKEN}" ]]; then
docker login "${HYSOP_REGISTRY_URL}"
else
echo "${HYSOP_REGISTRY_TOKEN}" | docker login "${HYSOP_REGISTRY_URL}" --username "${HYSOP_REGISTRY_USERNAME}" --password-stdin
fi
docker pull "${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}"
docker logout