Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zip version #323

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions carto-service-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "carto-tnt-onp-jmtorres-helm",
"private_key_id": "3e774ccd856459529e5b01e99a6cf297b68eb680",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTo6UWlHTR6obF\nODkH+9pTEVZlA7Gbldw16xUrxSQaeWhNk1DwGv3oIsDcXIVwrDx46ObaLNuyDwRx\nOSnWlx566kAeiBfhVuTcfir/DJBgmkhzJmGBj0YBH3RptK0nblq/9NFiG2slMcSY\naYHuvGKi34Wu6yES82XhkptiHXv0B4RA8t+lWbJ8bnEscubrRWjMn2LXKpYPDV2k\nkpb9LlQlNj0HtIgI2Co8Wox5yz1rjl9AvV06CfwqMHXjc9OCwYjBhy8nkTGHG9Vo\nZMl+fkg8AcmsG40B35H/S9DhjKMRaaO1Wo1mJZaIcvS+e5t8AextW4JlEQz+59FU\nQtTfeZQnAgMBAAECggEAX5WWNxd/l1sj2SjmYRu3ZDL9YQwFCC7r0RJGcolMIATb\nPcYeFQMrz876acwDnHq9qSIPOVRvOQEdUYGuyrNf2cW4hdGTb3uOS6NUCfMDtg2Y\nUSFxglFSHam2KxOl7JwjsnSAqJ2Xi6npj6h/PXKp3cO0Hecl/egeCH3tXafRVsnH\n60VSL3NdU5hZLD/EboMeIskK4lQNguUGpjBGToTmvDp0u0ne2vmdoh/T89KGaeWa\nMt1mvCaJH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orres-helm.iam.gserviceaccount.com",
"client_id": "117214994925590767450",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/serv-onp-jmtorres-helm%40carto-tnt-onp-jmtorres-helm.iam.gserviceaccount.com"
}
18 changes: 17 additions & 1 deletion tools/carto-download-customer-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ CUSTOMER_PACKAGE_NAME_PREFIX="carto-selfhosted-${SELFHOSTED_MODE}-customer-packa
CUSTOMER_PACKAGE_FOLDER="customer-package"
##########################################

function _check_deps_gsutil_file()
{
file_path=${1}
gsutil -q stat $file_path
return $?
}

function _check_deps()
{
for DEP in ${DEPENDENCIES} ; do
Expand Down Expand Up @@ -161,8 +168,17 @@ CUSTOMER_PACKAGE_FILE_LATEST="$(gsutil ls "gs://${CLIENT_STORAGE_BUCKET}/${CUSTO
SELFHOSTED_VERSION_LATEST="$(echo "${CUSTOMER_PACKAGE_FILE_LATEST}" | grep -Eo "${CLIENT_ID}-[0-9]+-[0-9]+-[0-9]+")"
SELFHOSTED_VERSION_LATEST="${SELFHOSTED_VERSION_LATEST/#${CLIENT_ID}-}"

# Check if exist the latest stable release
STABLE_CUSTOMER_PACKAGE_DOWNLOAD_URL="gs://${CLIENT_STORAGE_BUCKET}/${CUSTOMER_PACKAGE_FOLDER}/${CUSTOMER_PACKAGE_NAME_PREFIX}-${CLIENT_ID}-${SELFHOSTED_VERSION_LATEST}.zip"
if _check_deps_gsutil_file ${STABLE_CUSTOMER_PACKAGE_DOWNLOAD_URL}
then
CUSTOMER_PACKAGE_DOWNLOAD_URL=${STABLE_CUSTOMER_PACKAGE_DOWNLOAD_URL}
else
_error "stable version ${SELFHOSTED_VERSION_LATEST} not found: ${STABLE_CUSTOMER_PACKAGE_DOWNLOAD_URL}" 404
fi

# Double-check customer package download URI
[[ "${CUSTOMER_PACKAGE_FILE_LATEST}" != "gs://${CLIENT_STORAGE_BUCKET}/${CUSTOMER_PACKAGE_FOLDER}/${CUSTOMER_PACKAGE_NAME_PREFIX}-${CLIENT_ID}-${SELFHOSTED_VERSION_LATEST}.zip" ]] && \
[[ "${CUSTOMER_PACKAGE_FILE_LATEST}" != "${CUSTOMER_PACKAGE_DOWNLOAD_URL}" ]] && \
_error "customer package download URI mismatch" 7

# Download package
Expand Down
Loading