Skip to content

Commit

Permalink
Decommission circleci (#5730)
Browse files Browse the repository at this point in the history
This commit decommissions the CircleCI pipeline and removes the
temporary logic we added for development purposes from the GHA one.

Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
  • Loading branch information
Jesús Miguel Benito Calzada authored Nov 30, 2022
1 parent eae6083 commit b915873
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 110 deletions.
File renamed without changes.
15 changes: 4 additions & 11 deletions .github/workflows/gke_e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ on:
type: boolean
required: false
default: false
DEV_MODE:
type: boolean
required: false
default: false
# TODO(bjesus): right now it contains just the version number (eg. 1.22), rename to GKE_VERSION once CircleCI is decommissioned
GKE_BRANCH:
GKE_VERSION:
type: string
description: "The branch of the GKE environment in which we want to test."
GKE_CLUSTER:
type: string
GKE_PROJECT:
Expand Down Expand Up @@ -67,11 +61,10 @@ jobs:
runs-on: ubuntu-latest
env:
CHARTMUSEUM_VERSION: ${{ inputs.CHARTMUSEUM_VERSION }}
DEV_MODE: ${{ inputs.DEV_MODE }}
DEBUG_MODE: ${{ inputs.DEBUG_MODE }}
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
GKE_ADMIN: ${{ secrets.GKE_ADMIN }}
GKE_BRANCH: ${{ inputs.GKE_BRANCH }}
GKE_VERSION: ${{ inputs.GKE_VERSION }}
GKE_CLUSTER: ${{ inputs.GKE_CLUSTER }}
GKE_PROJECT: ${{ inputs.GKE_PROJECT }}
GKE_RELEASE_CHANNEL: ${{ inputs.GKE_RELEASE_CHANNEL }}
Expand All @@ -97,11 +90,11 @@ jobs:
installKubectl "${KUBECTL_VERSION}"
installHelm "${HELM_VERSION_MIN}"
installHelm "${HELM_VERSION_STABLE}" helm-stable
exportEscapedGKEClusterName "${GKE_CLUSTER}" "${GKE_RELEASE_CHANNEL}" "${GITHUB_REF_NAME}" "${TEST_LATEST_RELEASE}" "${DEV_MODE}"
exportEscapedGKEClusterName "${GKE_CLUSTER}" "${GKE_RELEASE_CHANNEL}" "${GITHUB_REF_NAME}" "${TEST_LATEST_RELEASE}"
- name: Start GKE environment
run: |
set -euo pipefail
./script/start-gke-env.sh "${ESCAPED_GKE_CLUSTER}" "${GKE_ZONE}" "${GKE_BRANCH}" "${GKE_ADMIN}" > /dev/null
./script/start-gke-env.sh "${ESCAPED_GKE_CLUSTER}" "${GKE_ZONE}" "${GKE_VERSION}" "${GKE_ADMIN}" > /dev/null
- # TODO(castelblanque) Unify shared resources with kubeapps-local-dev-users-rbac.yaml that only applies to Kind clusters
name: Apply customizations to GKE cluster
run: |
Expand Down
41 changes: 7 additions & 34 deletions .github/workflows/kubeapps-general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ env:
CI_BOT_EMAIL: "tanzu-kubeapps-team@vmware.com"
CI_BOT_GPG: "80B6EB16B1328FB18DFF2A073EBA68F3347E319D"
# DEBUG_MODE allows to activate some SSH debugging steps, and modify the verbosity level of some scripts (eg. e2e-tests.sh)
DEBUG_MODE: "true"
# TODO(bjesus): DEV_MODE is used to enable dev mode, used to activate several hacks along the code:
# - In sync_chart_from/to_bitnami jobs to file shadow PRs while we maintain
# - To add a suffix to the tag of the generated docker images, to prevent collision and overwriting with those generated from CircleCI
# - To add a suffix to the name of the generated GKE clusters to prevent collision with those generated and used from CircleCI
# - Probably some other things I don't remember right now :)
#
# CircleCI and GHA pipelines are running in parallel. This should be removed once the CircleCI pipeline is decommissioned.
DEV_MODE: true
DEBUG_MODE: "false"
SSH_KEY_KUBEAPPS_DEPLOY_FILENAME: "id_rsa_kubeapps_deploy_key"
SSH_KEY_FORKED_CHARTS_DEPLOY_FILENAME: "id_rsa_forked_charts_deploy_key"
KUBEAPPS_REPO: "vmware-tanzu/kubeapps"
Expand All @@ -54,11 +46,11 @@ env:
# as an output of the `setup` job.
IMG_DEV_TAG: "build-${{ github.sha }}"
# Apart from using a dev tag we use a different image ID to avoid polluting the tag history of the production tag
IMG_MODIFIER: "-ci-gha"
IMG_MODIFIER: "-ci"
IMG_PREFIX: "kubeapps/"
# We use IMG_PREFIX_FOR_FORKS for development purposes, it's used when the workflow is run from a fork of the kubeapps repo
IMG_PREFIX_FOR_FORKS: "beni0888/"
# IMG_PLATFORMS: "linux/amd64, linux/arm64"
IMG_PREFIX_FOR_FORKS: "your-dockerhub-username/"
# Currently, we only build the images for linux/amd64 because building cross-platform images is extremely slow...
IMG_PLATFORMS: "linux/amd64"
KAPP_CONTROLLER_VERSION: "v0.42.0"
K8S_KIND_VERSION: "v1.22.15@sha256:bfd5eaae36849bfb3c1e3b9442f3da17d730718248939d9d547e86bbac5da586"
Expand All @@ -81,7 +73,6 @@ jobs:
setup:
runs-on: ubuntu-latest
outputs:
dev_mode: ${{ steps.set-outputs.outputs.dev_mode }}
golang_version: ${{ steps.set-outputs.outputs.golang_version }}
img_modifier: ${{ steps.set-outputs.outputs.img_modifier }}
img_prefix: ${{ steps.set-outputs.outputs.img_prefix }}
Expand Down Expand Up @@ -112,7 +103,7 @@ jobs:
echo "img_prefix=${IMG_PREFIX}" >> $GITHUB_OUTPUT
else
# When running in forks (NOT triggered due to a PR from an external fork, but running the workflow in the
# external repo), we push the images to a personal namespace (if configured)
# external repo), we push the images to a personal dockerhub namespace (or whatever other registry) if configured
echo "img_prefix=${IMG_PREFIX_FOR_FORKS}" >> $GITHUB_OUTPUT
fi;
Expand All @@ -137,13 +128,6 @@ jobs:
echo "running_on_main=false" >> $GITHUB_OUTPUT
fi
# TODO(bjesus) Once we've properly tested the release job, we can/should remove this hack, just leave the content from the else branch
if [[ ${GITHUB_REF_TYPE} == "tag" && ${GITHUB_REF_NAME} == 'test-'* ]]; then
echo "dev_mode=true" >> $GITHUB_OUTPUT
else
echo "dev_mode=${DEV_MODE}" >> $GITHUB_OUTPUT
fi
echo "golang_version=${GOLANG_VERSION}" >> $GITHUB_OUTPUT
echo "ssh_key_kubeapps_deploy_filename=${SSH_KEY_KUBEAPPS_DEPLOY_FILENAME}" >> $GITHUB_OUTPUT
echo "ssh_key_forked_charts_deploy_filename=${SSH_KEY_FORKED_CHARTS_DEPLOY_FILENAME}" >> $GITHUB_OUTPUT
Expand All @@ -153,7 +137,6 @@ jobs:
echo "rust_version=${RUST_VERSION}" >> $GITHUB_OUTPUT
- name: Show outputs
run: |
echo "DEV_MODE: ${{steps.set-outputs.outputs.dev_mode}}"
echo "GOLANG_VERSION: ${{steps.set-outputs.outputs.golang_version}}"
echo "IMG_MODIFIER: ${{steps.set-outputs.outputs.img_modifier}}"
echo "IMG_PREFIX: ${{steps.set-outputs.outputs.img_prefix}}"
Expand Down Expand Up @@ -567,10 +550,6 @@ jobs:
- uses: actions/download-artifact@v3
- run: |
set -eu
if [[ "${DEV_MODE}" == true ]]; then
IMG_PROD_TAG="${IMG_PROD_TAG}-gha"
fi
for artifact in *; do
echo "::debug::Processing artifact '${artifact}'"
Expand Down Expand Up @@ -664,7 +643,6 @@ jobs:
${KUBEAPPS_REPO} \
${BRANCH_KUBEAPPS_REPO} \
${README_GENERATOR_REPO} \
${DEV_MODE}
sync_chart_to_bitnami:
needs:
Expand Down Expand Up @@ -720,7 +698,6 @@ jobs:
${BRANCH_CHARTS_REPO_ORIGINAL} \
${CHARTS_REPO_FORKED} \
${BRANCH_CHARTS_REPO_FORKED} \
${DEV_MODE}
release:
if: inputs.trigger_release
Expand Down Expand Up @@ -762,7 +739,6 @@ jobs:
outputs:
CHARTMUSEUM_VERSION: ${{ steps.set-outputs.outputs.CHARTMUSEUM_VERSION }}
DEBUG_MODE: ${{ steps.set-outputs.outputs.DEBUG_MODE }}
DEV_MODE: ${{ steps.set-outputs.outputs.DEV_MODE }}
GKE_STABLE_VERSION: ${{ steps.set-outputs.outputs.GKE_STABLE_VERSION }}
GKE_REGULAR_VERSION: ${{ steps.set-outputs.outputs.GKE_REGULAR_VERSION }}
GKE_CLUSTER: ${{ steps.set-outputs.outputs.GKE_CLUSTER }}
Expand All @@ -781,7 +757,6 @@ jobs:
run: |
echo "CHARTMUSEUM_VERSION=${CHARTMUSEUM_VERSION}" >> $GITHUB_OUTPUT
echo "DEBUG_MODE=${DEBUG_MODE}" >> $GITHUB_OUTPUT
echo "DEV_MODE=${DEV_MODE}" >> $GITHUB_OUTPUT
echo "GKE_STABLE_VERSION=${GKE_STABLE_VERSION}" >> $GITHUB_OUTPUT
echo "GKE_REGULAR_VERSION=${GKE_REGULAR_VERSION}" >> $GITHUB_OUTPUT
echo "GKE_CLUSTER=${GKE_CLUSTER}" >> $GITHUB_OUTPUT
Expand All @@ -801,9 +776,8 @@ jobs:
- gke_setup
uses: ./.github/workflows/gke_e2e_tests.yaml
with:
GKE_BRANCH: ${{ needs.gke_setup.outputs.GKE_REGULAR_VERSION }}
GKE_VERSION: ${{ needs.gke_setup.outputs.GKE_REGULAR_VERSION }}
DEBUG_MODE: ${{ needs.gke_setup.outputs.DEBUG_MODE == 'true' }}
DEV_MODE: ${{ needs.gke_setup.outputs.DEV_MODE == 'true' }}
CHARTMUSEUM_VERSION: ${{ needs.gke_setup.outputs.CHARTMUSEUM_VERSION }}
GKE_CLUSTER: ${{ needs.gke_setup.outputs.GKE_CLUSTER }}
GKE_PROJECT: ${{ needs.gke_setup.outputs.GKE_PROJECT }}
Expand All @@ -826,9 +800,8 @@ jobs:
- gke_setup
uses: ./.github/workflows/gke_e2e_tests.yaml
with:
GKE_BRANCH: ${{ needs.gke_setup.outputs.GKE_STABLE_VERSION }}
GKE_VERSION: ${{ needs.gke_setup.outputs.GKE_STABLE_VERSION }}
DEBUG_MODE: ${{ needs.gke_setup.outputs.DEBUG_MODE == 'true' }}
DEV_MODE: ${{ needs.gke_setup.outputs.DEV_MODE == 'true' }}
CHARTMUSEUM_VERSION: ${{ needs.gke_setup.outputs.CHARTMUSEUM_VERSION }}
GKE_CLUSTER: ${{ needs.gke_setup.outputs.GKE_CLUSTER }}
GKE_PROJECT: ${{ needs.gke_setup.outputs.GKE_PROJECT }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/kubeapps-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
# TODO(bjesus) Remove the following line once we have tested the release process
- 'test-v[0-9]+.[0-9]+.[0-9]+'

concurrency:
group: ${{ github.head_ref || github.ref_name }}_release
Expand Down
2 changes: 0 additions & 2 deletions chart/kubeapps/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<!--- app-name: Kubeapps -->

# Kubeapps packaged by Bitnami

Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster.
Expand Down
8 changes: 1 addition & 7 deletions script/chart_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ CHARTS_REPO_UPSTREAM=${5:?Missing chart repository upstream (eg. bitnami/charts)
CHARTS_REPO_UPSTREAM_BRANCH=${6:?Missing chart repository upstream\'s main branch name (eg. main)}
CHARTS_REPO_FORK=${7:?Missing chart repository fork (eg. kubeapps-bot/charts)}
CHARTS_REPO_FORK_BRANCH=${8:?Missing chart repository fork\'s main branch name (eg. main)}
DEV_MODE=${9:-false}
LOCAL_KUBEAPPS_REPO_PATH=${PROJECT_DIR:?PROJECT_DIR not defined}

info "LOCAL_KUBEAPPS_REPO_PATH: ${LOCAL_KUBEAPPS_REPO_PATH}"
Expand All @@ -31,11 +30,6 @@ info "CHARTS_REPO_UPSTREAM: ${CHARTS_REPO_UPSTREAM}"
info "CHARTS_REPO_UPSTREAM_BRANCH: ${CHARTS_REPO_UPSTREAM_BRANCH}"
info "CHARTS_REPO_FORK: ${CHARTS_REPO_FORK}"
info "CHARTS_REPO_FORK_BRANCH: ${CHARTS_REPO_FORK_BRANCH}"
info "DEV_MODE: ${DEV_MODE}"

if [[ "${DEV_MODE}" == "true" ]]; then
set -x
fi

currentVersion=$(grep -oP '(?<=^version: ).*' <"${KUBEAPPS_CHART_DIR}/Chart.yaml")
externalVersion=$(curl -s "https://raw.githubusercontent.com/${CHARTS_REPO_UPSTREAM}/${CHARTS_REPO_UPSTREAM_BRANCH}/${CHART_REPO_PATH}/Chart.yaml" | grep -oP '(?<=^version: ).*')
Expand All @@ -59,7 +53,7 @@ if [[ ${semverCompare} -gt 0 ]]; then
prBranchName="kubeapps-bump-${currentVersion}"

updateRepoWithLocalChanges "${CHARTS_FORK_LOCAL_PATH}" "${latestVersion}" "${CHARTS_FORK_SSH_KEY_FILENAME}" "${CHARTS_REPO_UPSTREAM}" "${CHARTS_REPO_UPSTREAM_BRANCH}" "${CHARTS_REPO_FORK_BRANCH}"
commitAndSendExternalPR "${CHARTS_FORK_LOCAL_PATH}" "${prBranchName}" "${currentVersion}" "${CHARTS_REPO_UPSTREAM}" "${CHARTS_REPO_UPSTREAM_BRANCH}" "${CHARTS_FORK_SSH_KEY_FILENAME}" "${DEV_MODE}"
commitAndSendExternalPR "${CHARTS_FORK_LOCAL_PATH}" "${prBranchName}" "${currentVersion}" "${CHARTS_REPO_UPSTREAM}" "${CHARTS_REPO_UPSTREAM_BRANCH}" "${CHARTS_FORK_SSH_KEY_FILENAME}"
elif [[ ${semverCompare} -lt 0 ]]; then
echo "Skipping Chart sync. WARNING Current chart version (${currentVersion}) is less than the chart external version (${externalVersion})"
else
Expand Down
34 changes: 5 additions & 29 deletions script/chart_sync_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ KUBEAPPS_CHART_DIR="${PROJECT_DIR}/chart/kubeapps"
# Paths of the templates files, note they are also used elsewhere
PR_INTERNAL_TEMPLATE_FILE="${PROJECT_DIR}/script/tpl/PR_internal_chart_template.md"
PR_EXTERNAL_TEMPLATE_FILE="${PROJECT_DIR}/script/tpl/PR_external_chart_template.md"
# shellcheck disable=SC2034
RELEASE_NOTES_TEMPLATE_FILE="${PROJECT_DIR}/script/tpl/release_notes.md"


Expand Down Expand Up @@ -109,7 +110,8 @@ replaceImage_latestToProduction() {
fi

# Get the latest tag from the bitnami repository
local tag=$(curl "${curl_opts[@]}" "https://api.github.com/repos/bitnami/${repoName}/tags" | jq -r '.[0].name')
local tag
tag=$(curl "${curl_opts[@]}" "https://api.github.com/repos/bitnami/${repoName}/tags" | jq -r '.[0].name')

if [[ $tag == "" ]]; then
echo "ERROR: Unable to obtain latest tag for ${repoName}. Stopping..."
Expand Down Expand Up @@ -259,7 +261,7 @@ updateRepoWithRemoteChanges() {
cp -R "${targetChartPath}" "${KUBEAPPS_CHART_DIR}"

# Update Chart.yaml with new version
sed -i.bk "s/appVersion: "${targetTagWithoutV}"/appVersion: DEVEL/g" "${localChartYaml}"
sed -i.bk "s/appVersion: ${targetTagWithoutV}/appVersion: DEVEL/g" "${localChartYaml}"
rm "${KUBEAPPS_CHART_DIR}/Chart.yaml.bk"
info "New version ${targetTagWithoutV} applied to file ${localChartYaml}"

Expand Down Expand Up @@ -311,8 +313,6 @@ generateReadme() {
# $4 - CHARTS_REPO_UPSTREAM: Name of the upstream version of the bitnami/charts repo without the GitHub part (eg. bitnami/charts).
# $5 - CHARTS_REPO_UPSTREAM_BRANCH: Name of the main branch in the upstream of the charts repo.
# $6 - CHARTS_FORK_SSH_KEY_FILENAME: Name of the file with the SSH private key to connect with the upstream of the charts fork.
# $7 - DEV_MODE: Indicates if it should be run in development mode, in this case we add a disclaimer to the PR description
# alerting that it's a development PR and shouldn't be taken into account, between other customizations (branch name, etc).
# Returns:
# 0 - Success
# 1 - Failure
Expand All @@ -324,7 +324,6 @@ commitAndSendExternalPR() {
local CHARTS_REPO_UPSTREAM=${4:?}
local CHARTS_REPO_UPSTREAM_BRANCH=${5:?}
local CHARTS_FORK_SSH_KEY_FILENAME=${6:?}
local DEV_MODE=${7-false}

local targetChartPath="${LOCAL_CHARTS_REPO_PATH}/${CHART_REPO_PATH}"
local chartYaml="${targetChartPath}/Chart.yaml"
Expand All @@ -342,14 +341,6 @@ commitAndSendExternalPR() {

PR_TITLE="[bitnami/kubeapps] Bump chart version to ${CHART_VERSION}"

if [[ "${DEV_MODE}" == "true" ]]; then
timestamp=$(date +%s)
TARGET_BRANCH="${TARGET_BRANCH}-DEV-${timestamp}"
PR_TITLE="DEV - ${PR_TITLE} - ${timestamp}"
tmpfile=$(mktemp)
echo "# :warning: THIS IS A DEVELOPMENT PR, DO NOT MERGE!"|cat - "${PR_EXTERNAL_TEMPLATE_FILE}" > "$tmpfile" && mv "$tmpfile" "${PR_EXTERNAL_TEMPLATE_FILE}"
fi

sed -i.bk -e "s/<USER>/$(git config user.name)/g" "${PR_EXTERNAL_TEMPLATE_FILE}"
sed -i.bk -e "s/<EMAIL>/$(git config user.email)/g" "${PR_EXTERNAL_TEMPLATE_FILE}"
git checkout -b "${TARGET_BRANCH}"
Expand All @@ -358,11 +349,7 @@ commitAndSendExternalPR() {
# NOTE: This expects to have a loaded SSH key
if [[ $(GIT_SSH_COMMAND="ssh -i ~/.ssh/${CHARTS_FORK_SSH_KEY_FILENAME}" git ls-remote origin "${TARGET_BRANCH}" | wc -l) -eq 0 ]]; then
GIT_SSH_COMMAND="ssh -i ~/.ssh/${CHARTS_FORK_SSH_KEY_FILENAME}" git push -u origin "${TARGET_BRANCH}"
if [[ "${DEV_MODE}" != "true" ]]; then
gh pr create -d -B "${CHARTS_REPO_UPSTREAM_BRANCH}" -R "${CHARTS_REPO_UPSTREAM}" -F "${PR_EXTERNAL_TEMPLATE_FILE}" --title "${PR_TITLE}"
else
echo "Skipping external PR because we are running in DEV_MODE"
fi
gh pr create -d -B "${CHARTS_REPO_UPSTREAM_BRANCH}" -R "${CHARTS_REPO_UPSTREAM}" -F "${PR_EXTERNAL_TEMPLATE_FILE}" --title "${PR_TITLE}"
else
echo "The remote branch '${TARGET_BRANCH}' already exists, please check if there is already an open PR at the repository '${CHARTS_REPO_UPSTREAM}'"
return 1
Expand All @@ -380,8 +367,6 @@ commitAndSendExternalPR() {
# $3 - CHART_VERSION: New version for the chart.
# $4 - UPSTREAM_REPO: Name of the upstream version of the kubeapps repo without the GitHub part (eg. vmware-tanzu/kubeapps).
# $5 - UPSTREAM_MAIN_BRANCH: Name of the main branch in the upstream repo.
# $6 - DEV_MODE: Indicates if it should be run in development mode, in this case we add a disclaimer to the PR description
# alerting that it's a development PR and shouldn't be taken into account, between other customizations (branch name, etc).
# Returns:
# 0 - Success
# 1 - Failure
Expand All @@ -392,7 +377,6 @@ commitAndSendInternalPR() {
local CHART_VERSION=${3:?}
local UPSTREAM_REPO=${4:?}
local UPSTREAM_MAIN_BRANCH=${5:?}
local DEV_MODE=${6:-false}

local targetChartPath="${KUBEAPPS_CHART_DIR}/Chart.yaml"
local localChartYaml="${KUBEAPPS_CHART_DIR}/Chart.yaml"
Expand All @@ -411,14 +395,6 @@ commitAndSendInternalPR() {

PR_TITLE="Sync chart with bitnami/kubeapps chart (version ${CHART_VERSION})"

if [[ "${DEV_MODE}" == "true" ]]; then
timestamp=$(date +%s)
TARGET_BRANCH="${TARGET_BRANCH}-DEV-${timestamp}"
PR_TITLE="DEV - ${PR_TITLE} - ${timestamp}"
tmpfile=$(mktemp)
echo "# :warning: THIS IS A DEVELOPMENT PR, DO NOT MERGE!"|cat - "${PR_INTERNAL_TEMPLATE_FILE}" > "$tmpfile" && mv "$tmpfile" "${PR_INTERNAL_TEMPLATE_FILE}"
fi

git checkout -b "${TARGET_BRANCH}"
git add --all .
git commit --signoff -m "bump chart version to ${CHART_VERSION}"
Expand Down
12 changes: 1 addition & 11 deletions script/chart_upstream_checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ CHARTS_REPO_FORK_BRANCH=${8:?Missing forked chart repository}
KUBEAPPS_REPO_UPSTREAM=${9:?Missing kubeapps repository}
KUBEAPPS_REPO_UPSTREAM_BRANCH=${10:?Missing kubeapps repository branch}
README_GENERATOR_REPO=${11:?Missing readme generator repository}
DEV_MODE=${12:-false}
LOCAL_KUBEAPPS_REPO_PATH=${PROJECT_DIR:?PROJECT_DIR not defined}

info "LOCAL_KUBEAPPS_REPO_PATH: ${LOCAL_KUBEAPPS_REPO_PATH}"
Expand All @@ -37,11 +36,6 @@ info "CHARTS_REPO_FORK_BRANCH: ${CHARTS_REPO_FORK_BRANCH}"
info "KUBEAPPS_REPO_UPSTREAM: ${KUBEAPPS_REPO_UPSTREAM}"
info "KUBEAPPS_REPO_UPSTREAM_BRANCH: ${KUBEAPPS_REPO_UPSTREAM_BRANCH}"
info "README_GENERATOR_REPO: ${README_GENERATOR_REPO}"
info "DEV_MODE: ${DEV_MODE}"

if [[ "${DEV_MODE}" == "true" ]]; then
set -x
fi

currentVersion=$(grep -oP '(?<=^version: ).*' <"${KUBEAPPS_CHART_DIR}/Chart.yaml")
externalVersion=$(curl -s "https://raw.githubusercontent.com/${CHARTS_REPO_UPSTREAM}/${CHARTS_REPO_UPSTREAM_BRANCH}/${CHART_REPO_PATH}/Chart.yaml" | grep -oP '(?<=^version: ).*')
Expand All @@ -63,13 +57,9 @@ if [[ ${semverCompare} -lt 0 ]]; then
latestVersion=$(latestReleaseTag "${LOCAL_KUBEAPPS_REPO_PATH}")
prBranchName="sync-chart-changes-${externalVersion}"

if [[ "${DEV_MODE}" == "true" ]]; then
prBranchName="${prBranchName}-DEV"
fi

updateRepoWithRemoteChanges "${LOCAL_CHARTS_REPO_FORK}" "${latestVersion}" "${FORKED_SSH_KEY_FILENAME}" "${CHARTS_REPO_UPSTREAM}" "${CHARTS_REPO_UPSTREAM_BRANCH}" "${CHARTS_REPO_FORK_BRANCH}"
generateReadme "${README_GENERATOR_REPO}" "${KUBEAPPS_CHART_DIR}"
commitAndSendInternalPR "${LOCAL_KUBEAPPS_REPO_PATH}" "${prBranchName}" "${externalVersion}" "${KUBEAPPS_REPO_UPSTREAM}" "${KUBEAPPS_REPO_UPSTREAM_BRANCH}" "${DEV_MODE}"
commitAndSendInternalPR "${LOCAL_KUBEAPPS_REPO_PATH}" "${prBranchName}" "${externalVersion}" "${KUBEAPPS_REPO_UPSTREAM}" "${KUBEAPPS_REPO_UPSTREAM_BRANCH}"
elif [[ ${semverCompare} -gt 0 ]]; then
echo "Skipping Chart sync. WARNING Current chart version (${currentVersion}) is greater than the chart external version (${externalVersion})"
else
Expand Down
9 changes: 2 additions & 7 deletions script/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname "$0")/chart_sync_utils.sh
source "$(dirname "$0")/chart_sync_utils.sh"

TAG=${1:?Missing tag}
KUBEAPPS_REPO=${2:?Missing kubeapps repo}
DEV_MODE=${DEV_MODE:-false}
GH_TOKEN=${GH_TOKEN:?Missing GitHub token}

if [[ -z "${TAG}" ]]; then
echo "A git tag is required for creating a release"
exit 1
fi

if [[ "${DEV_MODE}" != "false" ]]; then
gh release create -R "${KUBEAPPS_REPO}" -d "${TAG}" -t "${TAG}" -F "${RELEASE_NOTES_TEMPLATE_FILE}"
else
echo "Skipping release due to DEV_MODE!"
fi
gh release create -R "${KUBEAPPS_REPO}" -d "${TAG}" -t "${TAG}" -F "${RELEASE_NOTES_TEMPLATE_FILE}"
Loading

0 comments on commit b915873

Please sign in to comment.