dovetail: upload artifacts job added
[releng.git] / jjb / dovetail / dovetail-artifacts-upload.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -o pipefail
11
12 echo "dovetail: pull and save the images"
13
14 [[ -d ${CACHE_DIR} ]] || mkdir -p ${CACHE_DIR}
15
16 cd ${CACHE_DIR}
17 sudo docker pull ${DOCKER_REPO_NAME}:${DOCKER_TAG}
18 sudo docker save -o ${STORE_FILE_NAME} ${DOCKER_REPO_NAME}:${DOCKER_TAG}
19
20 echo "dovetail: upload image to artifacts.opnfv.org, which can be for offline usage"
21 gsutil cp ${CACHE_DIR}/${STORE_FILE_NAME} ${STORE_URL}
22
23 echo "dovetail: uploading done"