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 ##############################################################################
12 echo "dovetail: pull and save the images"
14 [[ -d ${CACHE_DIR} ]] || mkdir -p ${CACHE_DIR}
17 sudo docker pull ${DOCKER_REPO_NAME}:${DOCKER_TAG}
18 sudo docker save -o ${STORE_FILE_NAME} ${DOCKER_REPO_NAME}:${DOCKER_TAG}
21 # clone releng repository
22 echo "Cloning releng repository..."
23 [ -d releng ] && rm -rf releng
24 git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng/ &> /dev/null
25 #this is where we import the siging key
26 if [ -f $WORKSPACE/releng/utils/gpg_import_key.sh ]; then
27 source $WORKSPACE/releng/utils/gpg_import_key.sh
32 gpg2 -vvv --batch --yes --no-tty \
33 --default-key opnfv-helpdesk@rt.linuxfoundation.org \
34 --passphrase besteffort \
35 --detach-sig ${CACHE_DIR}/${STORE_FILE_NAME}
37 gsutil cp ${CACHE_DIR}/${STORE_FILE_NAME}.sig ${STORE_URL}/${STORE_FILE_NAME}.sig
38 echo "signature Upload Complete!"
43 echo "Uploading to artifact. This could take some time..."
47 # upload artifact and additional files to google storage
48 gsutil cp ${CACHE_DIR}/${STORE_FILE_NAME} ${STORE_URL}/${STORE_FILE_NAME}
51 -h "Cache-Control:private, max-age=0, no-transform" \
52 ${STORE_URL}/${STORE_FILE_NAME} > /dev/null 2>&1
54 # disabled errexit due to gsutil setmeta complaints
55 # BadRequestException: 400 Invalid argument
56 # check if we uploaded the file successfully to see if things are fine
57 gsutil ls ${STORE_URL}/${STORE_FILE_NAME} > /dev/null 2>&1
58 if [[ $? -ne 0 ]]; then
59 echo "Problem while uploading artifact!"
63 echo "dovetail: uploading Done!"
65 echo "--------------------------------------------------------"