Skip to content

Commit

Permalink
Revert "Release script (#15)"
Browse files Browse the repository at this point in the history
This reverts commit 1ea953f.
  • Loading branch information
barchw authored Sep 8, 2022
1 parent 1ea953f commit ed7ddf5
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 48 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ info.json
*.tmpl-e

# Vscode directory
.vscode
dist/
.vscode
37 changes: 0 additions & 37 deletions .goreleaser.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

.PHONY: test-for-release
test-for-release: fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

##@ Build

Expand All @@ -123,10 +120,6 @@ run: build
docker-build: pull-licenses test ## Build docker image with the manager.
docker build -t $(APP_NAME):latest .

.PHONY: docker-build-release
docker-build-release: pull-licenses test-for-release ## Build docker image with the manager.
docker build -t $(APP_NAME):latest .

.PHONY: docker-build-certificates
docker-build-certificates: ## Build docker image for certificates management
docker build -f Dockerfile-certificates -t $(CERTIFICATES_APP_NAME):latest .
Expand Down
22 changes: 22 additions & 0 deletions config/crd/bases/gateway.kyma-project.io_apirules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ spec:
keys vary per handler.
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
jwks_urls:
type: array
items:
type: string
pattern: ^(https://|file://).*$
trusted_issuers:
type: array
items:
type: string
pattern: ^(https://|file://).*$
handler:
description: Name is the name of a handler
type: string
Expand Down Expand Up @@ -223,6 +234,17 @@ spec:
keys vary per handler.
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
jwks_urls:
type: array
items:
type: string
pattern: ^(https://|file://).*$
trusted_issuers:
type: array
items:
type: string
pattern: ^(https://|file://).*$
handler:
description: Name is the name of a handler
type: string
Expand Down
33 changes: 31 additions & 2 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,39 @@ set -E # needs to be set if we want the ERR trap

readonly API_GATEWAY_DIR="/home/prow/go/src/github.com/kyma-project/api-gateway"

# locally delete the stable tag in order to have all the change logs listed under the new release version
delete_stable_tag() {
if [[ $(git tag -l stable) ]]; then
git tag -d stable
fi
}

get_new_release_version() {
# get the list of tags in a reverse chronological order
TAG_LIST=($(git tag --sort=-creatordate))
NEW_RELEASE_VERSION=${TAG_LIST[0]}
}

get_current_release_version() {
# get the list of tags in a reverse chronological order excluding release candidate tags
TAG_LIST_WITHOUT_RC=($(git tag --sort=-creatordate | grep -v -e "-rc"))
if [[ $NEW_RELEASE_VERSION == *"-rc"* ]]; then
CURRENT_RELEASE_VERSION=${TAG_LIST_WITHOUT_RC[0]}
else
CURRENT_RELEASE_VERSION=${TAG_LIST_WITHOUT_RC[1]}
fi
}

main() {
git remote add origin git@github.com:kyma-project/api-gateway.git
# release api-gateway with goreleaser
curl -sL https://git.io/goreleaser | VERSION=v1.11.2 bash -s --
delete_stable_tag
get_new_release_version
get_current_release_version

# generate release changelog
docker run --rm -v "${API_GATEWAY_DIR}":/repository -w /repository -e FROM_TAG="${CURRENT_RELEASE_VERSION}" -e NEW_RELEASE_TITLE="${NEW_RELEASE_VERSION}" -e GITHUB_AUTH="${BOT_GITHUB_TOKEN}" -e CONFIG_FILE=.github/package.json eu.gcr.io/kyma-project/changelog-generator:0.2.0 sh /app/generate-release-changelog.sh
# release api-gateway with release notes generated by changelog-generator
curl -sL https://git.io/goreleaser | VERSION=v0.118.2 bash -s -- --release-notes .changelog/release-changelog.md
}

main

0 comments on commit ed7ddf5

Please sign in to comment.