1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

configure aws region

This commit is contained in:
Giancarlo Rubio 2017-12-05 15:10:59 +00:00
parent 73904be8b8
commit 7cea27a6ff
4 changed files with 23 additions and 3 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#// TODO move this test and dependencies to a docker container
set -o errexit
set -o nounset
set -o pipefail

View file

@ -15,13 +15,14 @@ HELM_CHARTS_PACKAGED_DIR=${3:-"/tmp/helm-packaged"}
wget -q ${HELM_URL}/${HELM_TARBALL}
tar xzfv ${HELM_TARBALL}
export PATH=${PATH}:$(pwd)/linux-amd64/helm
export PATH=${PATH}:$(pwd)/linux-amd64/
# Clean up tarball
rm -f ${HELM_TARBALL}
# Package helm and dependencies
mkdir -p ${HELM_CHARTS_PACKAGED_DIR}
helm init --client-only
# check if charts has dependencies,
for chart in ${HELM_PACKAGES}

View file

@ -7,4 +7,21 @@ set -o xtrace
HELM_BUCKET_NAME="coreos-charts"
HELM_CHARTS_PACKAGED_DIR=${1:-"/tmp/helm-packaged"}
aws s3 sync --acl public-read ${HELM_CHARTS_PACKAGED_DIR} s3://${HELM_BUCKET_NAME}/stable/
AWS_REGION=${2:-"us-west-2"}
aws configure set region ${AWS_REGION}
#Check if the current chart has the same hash from the remote one
for tgz in $(ls ${HELM_CHARTS_PACKAGED_DIR})
do
cur_hash=$(cat ${HELM_CHARTS_PACKAGED_DIR}/${tgz}|md5sum)
remote_hash=$(aws s3api head-object --bucket ${HELM_BUCKET_NAME} --key stable/${tgz} | jq '.ETag' -r| tr -d '"')
if [ "$cur_hash" != "$remote_hash" ]
then
echo "Current hash should be the same as the remote hash. Please bump the version of chart {$tgz}."
exit 1
fi
done
# sync charts
aws s3 sync --acl public-read ${HELM_CHARTS_PACKAGED_DIR} s3://${HELM_BUCKET_NAME}/stable/

View file

@ -6,10 +6,12 @@ dependencies:
- name: prometheus-operator
version: 0.0.7
#e2e-repository: file://../prometheus-operator
repository: https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
- name: grafana
version: 0.0.4
#e2e-repository: file://../grafana
repository: https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
- name: prometheus