-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload-virtualbox.sh
executable file
·34 lines (27 loc) · 1.03 KB
/
upload-virtualbox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ -z "$ARTIFACTORY_API_KEY" ]
then
echo "Please head to https://artifactory.ccdc.cam.ac.uk/"
echo "Log in, select the ccdc-vagrant-repo repository in the Set me up box, type your password in the password box"
echo "Select the key that appears after curl -H 'X-JFrog-Art-Api:'"
echo "In order for this script to work, you need to export ARTIFACTORY_API_KEY='key'"
exit 1
fi
pushd $DIR
BOX_NAME="ccdc-basebox/rocky-9"
PROVIDER="virtualbox"
BOX_VERSION="$(date +%Y%m%d).0"
FILENAME=$BOX_NAME.$BOX_VERSION.$PROVIDER.box
PATH_TO_FILE=output/$FILENAME
echo "pushing box to artifactory"
# Possible values are: INFO, ERROR, and DEBUG.
export JFROG_CLI_LOG_LEVEL=DEBUG
export JFROG_CLI_OFFER_CONFIG=false
jfrog rt u \
--apikey "$ARTIFACTORY_API_KEY" \
--props "box_name=$BOX_NAME;box_provider=$PROVIDER;box_version=$BOX_VERSION" \
--retries 100 \
--url "https://artifactory.ccdc.cam.ac.uk/artifactory" \
$PATH_TO_FILE \
"ccdc-vagrant-repo/$FILENAME"