Skip to content

Commit

Permalink
Cherry pick fixes to release channel (#349)
Browse files Browse the repository at this point in the history
* fix reference to release name (#342)

* add missing env vars for IMG and MODULE_REGISTERY (#343)

* add missing env vars for IMG and MODULE_REGISTERY

* remove arg

* add KUSTOMIZE_VERSION

* fix wrong token (#344)

* add missing env vars for IMG and MODULE_REGISTERY

* remove arg

* replace the BOT_GITHUB_TOKEN with the GITHUB_TOKEN

* remove call of make module-build (#347)

* remove call of make module-build

We really only need to render the manifests so lets remove module-build.

* revert removal of MODULE_REGISTERY

* fix spelling of env var name (#348)
  • Loading branch information
friedrichwilken authored Dec 15, 2023
1 parent e0a307d commit 1817db9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ jobs:

- name: Create and upload eventing-manager.yaml and eventing-default-cr.yaml
env:
PULL_BASE_REF: ${{ PULL_BASE_REF }}
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
PULL_BASE_REF: ${{ github.event.inputs.name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMG: "europe-docker.pkg.dev/kyma-project/prod/eventing-manager:${{ github.event.inputs.name }}"
MODULE_REGISTRY: "europe-docker.pkg.dev/kyma-project/prod/unsigned"
KUSTOMIZE_VERSION: "v4.5.6"
run: |
./scripts/render_and_upload_manifests.sh ${{ PULL_BASE_REF }} ${{ BOT_GITHUB_TOKEN }}
./scripts/render_and_upload_manifests.sh
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}
Expand Down
9 changes: 4 additions & 5 deletions scripts/render_and_upload_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -o pipefail # prevents errors in a pipeline from being masked

# Expected variables:
# PULL_BASE_REF - name of the tag
# BOT_GITHUB_TOKEN - github token used to upload the template yaml
# GITHUB_TOKEN - github token used to upload the template yaml

uploadFile() {
filePath=${1}
Expand All @@ -17,7 +17,7 @@ uploadFile() {
echo "Uploading ${filePath} as ${ghAsset}"
response=$(curl -s -o output.txt -w "%{http_code}" \
--request POST --data-binary @"$filePath" \
-H "Authorization: token $BOT_GITHUB_TOKEN" \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: text/yaml" \
$ghAsset)
if [[ "$response" != "201" ]]; then
Expand All @@ -37,8 +37,7 @@ MODULE_VERSION=${PULL_BASE_REF} make render-manifest
echo "Generated eventing-manager.yaml:"
cat eventing-manager.yaml

MODULE_VERSION=${PULL_BASE_REF} make module-build

# MODULE_VERSION=${PULL_BASE_REF} make module-build
# TODO completly remove the rendering of the module-template from the repository.
# echo "Generated moduletemplate.yaml:"
# cat module-template.yaml
Expand All @@ -48,7 +47,7 @@ echo "Updating github release with eventing-manager.yaml"
echo "Finding release id for: ${PULL_BASE_REF}"
CURL_RESPONSE=$(curl -w "%{http_code}" -sL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $BOT_GITHUB_TOKEN" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/kyma-project/eventing-manager/releases)
JSON_RESPONSE=$(sed '$ d' <<<"${CURL_RESPONSE}")
HTTP_CODE=$(tail -n1 <<<"${CURL_RESPONSE}")
Expand Down

0 comments on commit 1817db9

Please sign in to comment.