forked from specklesystems/speckle-server
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from arup-group/dn/dev/2.16.0
upstream changes until 2.16.0
- Loading branch information
Showing
1,078 changed files
with
125,692 additions
and
16,183 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,47 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
RELEASE_VERSION=${IMAGE_VERSION_TAG} | ||
|
||
echo "Releasing Helm Chart version $RELEASE_VERSION" | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI" | ||
|
||
git clone [email protected]:specklesystems/helm.git ~/helm | ||
|
||
# before overwriting the chart with the build version, check if the current chart version | ||
# is not newer than the currently build one | ||
|
||
CURRENT_VERSION="$(grep ^version ~/helm/charts/speckle-server/Chart.yaml | grep -o '2\..*')" | ||
echo "${CURRENT_VERSION}" | ||
|
||
.circleci/check_version.py "${CURRENT_VERSION}" "${RELEASE_VERSION}" | ||
if [ $? -eq 1 ] | ||
then | ||
echo "The current helm chart version is newer than the currently built. Exiting" | ||
exit 1 | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
GIT_REPO=$( pwd ) | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
# shellcheck disable=SC1090,SC1091 | ||
source "${SCRIPT_DIR}/common.sh" | ||
|
||
RELEASE_VERSION="${IMAGE_VERSION_TAG}" | ||
HELM_STABLE_BRANCH="${HELM_STABLE_BRANCH:-"main"}" | ||
|
||
echo "Releasing Helm Chart version ${RELEASE_VERSION}" | ||
|
||
git clone [email protected]:specklesystems/helm.git "${HOME}/helm" | ||
|
||
yq e -i ".version = \"${RELEASE_VERSION}\"" "${GIT_REPO}/utils/helm/speckle-server/Chart.yaml" | ||
yq e -i ".appVersion = \"${RELEASE_VERSION}\"" "${GIT_REPO}/utils/helm/speckle-server/Chart.yaml" | ||
yq e -i ".docker_image_tag = \"${RELEASE_VERSION}\"" "${GIT_REPO}/utils/helm/speckle-server/values.yaml" | ||
|
||
if [[ -n "${CIRCLE_TAG}" || "${CIRCLE_BRANCH}" == "${HELM_STABLE_BRANCH}" ]]; then | ||
# before overwriting the chart with the build version, check if the current chart version | ||
# is not newer than the currently build one | ||
|
||
CURRENT_VERSION="$(grep ^version "${HOME}/helm/charts/speckle-server/Chart.yaml" | grep -o '2\..*')" | ||
echo "${CURRENT_VERSION}" | ||
|
||
.circleci/check_version.py "${CURRENT_VERSION}" "${RELEASE_VERSION}" | ||
if [ $? -eq 1 ] | ||
then | ||
echo "The current helm chart version '${CURRENT_VERSION}' is newer than the version '${RELEASE_VERSION}' we are attempting to publish. Exiting" | ||
exit 1 | ||
fi | ||
rm -rf "${HOME}/helm/charts/speckle-server" | ||
cp -r "${GIT_REPO}/utils/helm/speckle-server" "${HOME}/helm/charts/speckle-server" | ||
else | ||
# overwrite the name of the chart | ||
yq e -i ".name = \"speckle-server-branch-${BRANCH_NAME_TRUNCATED}\"" "${GIT_REPO}/utils/helm/speckle-server/Chart.yaml" | ||
rm -rf "${HOME}/helm/charts/speckle-server-branch-${BRANCH_NAME_TRUNCATED}" | ||
cp -r "${GIT_REPO}/utils/helm/speckle-server" "${HOME}/helm/charts/speckle-server-branch-${BRANCH_NAME_TRUNCATED}" | ||
fi | ||
|
||
rm -rf ~/helm/charts/speckle-server | ||
cp -r utils/helm/speckle-server ~/helm/charts/speckle-server | ||
|
||
sed -i 's/version: [^\s]*/version: '"${RELEASE_VERSION}"'/g' ~/helm/charts/speckle-server/Chart.yaml | ||
sed -i 's/appVersion: [^\s]*/appVersion: '\""${RELEASE_VERSION}"\"'/g' ~/helm/charts/speckle-server/Chart.yaml | ||
|
||
sed -i 's/docker_image_tag: [^\s]*/docker_image_tag: '"${RELEASE_VERSION}"'/g' ~/helm/charts/speckle-server/values.yaml | ||
|
||
cd ~/helm | ||
|
||
git add . | ||
git commit -m "CircleCI commit" | ||
git -c user.email="[email protected]" -c user.name="CI" commit -m "CircleCI commit for version '${RELEASE_VERSION}'" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,55 +17,55 @@ GIT_ROOT="$(git rev-parse --show-toplevel)" | |
README_GENERATOR_DIR="${GIT_ROOT}/../readme-generator-for-helm" | ||
HELM_DIR="${GIT_ROOT}/../speckle-helm" | ||
HELM_GIT_TARGET_BRANCH="gh-pages" | ||
HELM_GIT_PR_BRANCH="${HELM_GIT_TARGET_BRANCH}-$(openssl rand -hex 6)" | ||
|
||
JSON_SCHEMA_PATH="${GIT_ROOT}/utils/helm/speckle-server/values.schema.json" | ||
|
||
if [ ! -d "${README_GENERATOR_DIR}" ]; then | ||
echo "🔭 Could not find readme-generator-for-helm in a sibling directory to speckle-server" | ||
echo "👩👩👧👧 Proceeding with cloning readme-generator-for-helm to a sibling directory, readme-generator-for-helm" | ||
echo "🔭 Could not find 'readme-generator-for-helm' in a sibling directory" | ||
echo "👩👩👧👧 Proceeding with cloning readme-generator-for-helm to a sibling directory, 'readme-generator-for-helm'" | ||
git clone [email protected]:bitnami-labs/readme-generator-for-helm.git "${README_GENERATOR_DIR}" | ||
fi | ||
|
||
if [ -n "${CI}" ]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI" | ||
fi | ||
|
||
pushd "${README_GENERATOR_DIR}" | ||
echo "✨ Updating to the latest version of readme-generator-for-helm" | ||
git switch main | ||
git pull origin main | ||
npm install | ||
popd | ||
|
||
if [ ! -d "${HELM_DIR}" ]; then | ||
echo "🔭 Could not find Speckle Helm in a sibling directory (named speckle-helm) to speckle-server" | ||
echo "👩👩👧👧 Proceeding with cloning Speckle's helm repository to a sibling directory, speckle-helm" | ||
echo "🔭 Could not find Speckle Helm in a sibling directory (named 'speckle-helm')" | ||
echo "👩👩👧👧 Proceeding with cloning Speckle's helm repository to a sibling directory, 'speckle-helm'" | ||
git clone [email protected]:specklesystems/helm.git "${HELM_DIR}" | ||
fi | ||
|
||
pushd "${HELM_DIR}" | ||
echo "✨ Updating to the latest version of Speckle helm" | ||
git switch main | ||
git pull origin main | ||
echo "🍽 Preparing forked branch for updates" | ||
echo "🍽 Preparing gh-pages branch for updates" | ||
git switch "${HELM_GIT_TARGET_BRANCH}" | ||
git pull origin "${HELM_GIT_TARGET_BRANCH}" | ||
git switch -c "${HELM_GIT_PR_BRANCH}" | ||
popd | ||
|
||
pushd "${GIT_ROOT}" | ||
echo "🏗 Generating the documentation" | ||
node "${README_GENERATOR_DIR}/bin/index.js" \ | ||
--config "${GIT_ROOT}/utils/helm/.helm-readme-configuration.json" \ | ||
--values "${GIT_ROOT}/utils/helm/speckle-server/values.yaml" \ | ||
--readme "${HELM_DIR}/README.md" \ | ||
--schema "${JSON_SCHEMA_PATH}" | ||
|
||
echo "🐛 Workaround for bug in generator for schema.json: https://github.com/bitnami-labs/readme-generator-for-helm/issues/34" | ||
TMP_OUTPUT="$(mktemp -t speckle-server-json-schema)" | ||
jq --arg replacement 'object' '(.. | .items? | select(.type == "")).type |= $replacement' "${JSON_SCHEMA_PATH}" > "${TMP_OUTPUT}" && mv "${TMP_OUTPUT}" "${JSON_SCHEMA_PATH}" | ||
--readme "${HELM_DIR}/README.md" | ||
popd | ||
|
||
pushd "${HELM_DIR}" | ||
echo "🌳 Preparing Pull Request for Helm README..." | ||
git add README.md | ||
git commit -m "Updating README with revised parameters from values.yaml" | ||
git push --set-upstream origin "${HELM_GIT_PR_BRANCH}" | ||
echo "🙏 Please create a Pull Request, ❗️selecting gh-pages as the target branch❗️: https://github.com/specklesystems/helm/pull/new/${HELM_GIT_PR_BRANCH}" | ||
echo "🌳 Preparing commit to branch '${HELM_GIT_TARGET_BRANCH}' for Helm README..." | ||
if [[ $(git status --porcelain) ]]; then | ||
git add README.md | ||
git commit -m "Updating README with revised parameters from values.yaml of Helm Chart." | ||
git push --set-upstream origin "${HELM_GIT_TARGET_BRANCH}" | ||
fi | ||
popd | ||
|
||
echo "✅ All done 🎉" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["prod", "hs2", "staging", "hk", "alr", "et"] | ||
["prod", "hs2", "staging", "hk", "alr", "et", "px-prod", "px-uat", "px-dev", "amr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["staging"] | ||
["staging", "px-dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.