diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-02-27 00:20:48 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-02-27 00:20:48 +0000 |
commit | fe0b757bd454f26dd2f2a3423ba5a684899bae61 (patch) | |
tree | 149aeb68abcd50f6ec9fe4fd8791e81379c8bde2 /puppet/deploy-artifacts.sh | |
parent | e23f8e34e1e91f7a46ba3eafb0f0b33b359e7cdd (diff) | |
parent | 55054f02d77ebbca63b6fbd3eab285873452933e (diff) |
Merge "Add support for DeployArtifactURLs"
Diffstat (limited to 'puppet/deploy-artifacts.sh')
-rw-r--r-- | puppet/deploy-artifacts.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/puppet/deploy-artifacts.sh b/puppet/deploy-artifacts.sh new file mode 100644 index 00000000..22fde9a7 --- /dev/null +++ b/puppet/deploy-artifacts.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +TMP_DATA=$(mktemp -d) +function cleanup { + rm -Rf "$TMP_DATA" +} +trap cleanup EXIT + +if [ -n "$artifact_urls" ]; then + for URL in $(echo $artifact_urls | sed -e "s| |\n|g" | sort -u); do + curl -o $TMP_DATA/file_data "$artifact_urls" + if file -b $TMP_DATA/file_data | grep RPM &>/dev/null; then + yum install -y $TMP_DATA/file_data + elif file -b $TMP_DATA/file_data | grep 'gzip compressed data' &>/dev/null; then + pushd / + tar xvzf $TMP_DATA/file_data + popd + else + echo "ERROR: Unsupported file format." + exit 1 + fi + rm $TMP_DATA/file_data + done +else + echo "No artifact_urls was set. Skipping..." +fi |