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

feat: Upgrade to Keptn 0.17 #9

Merged
merged 5 commits into from
Jul 11, 2022
Merged
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
48 changes: 25 additions & 23 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
keptn-version: [ "0.15.1", "0.16.0"] # https://github.com/keptn/keptn/releases
keptn-version: [ "0.15.1", "0.16.0", "0.17.0"] # https://github.com/keptn/keptn/releases
env:
GO_VERSION: 1.17
GO111MODULE: "on"
Expand Down Expand Up @@ -68,19 +68,6 @@ jobs:
done;
echo "K3s ready!!!"

- name: Install Keptn
id: install_keptn
uses: keptn-sandbox/[email protected]
timeout-minutes: 10
with:
KEPTN_VERSION: ${{ matrix.keptn-version }}
KEPTN_INSTALL_PARAMETERS: -v --endpoint-service-type=LoadBalancer
KUBECONFIG: ${{ env.KUBECONFIG }}

- name: Test connection to keptn
run: |
curl -X GET "${{ steps.install_keptn.outputs.KEPTN_ENDPOINT }}/v1/metadata" -H "accept: application/json" -H "x-token: ${{ steps.install_keptn.outputs.KEPTN_API_TOKEN }}"

- name: Generate Gitea credentials
id: gitea_credentials
run: |
Expand Down Expand Up @@ -130,19 +117,34 @@ jobs:
--set gitea.admin.password=${GITEA_ADMIN_PASSWORD} \
--wait

- name: Use Provisioner Service in Keptn
- name: Install Keptn
id: install_keptn
uses: keptn-sandbox/[email protected]
timeout-minutes: 10
with:
KEPTN_VERSION: ${{ matrix.keptn-version }}
HELM_VALUES: |
# Keptn 0.17 and newer
apiGatewayNginx:
type: LoadBalancer
features:
automaticProvisioning:
serviceURL: http://keptn-gitea-provisioner-service.default
# Keptn 0.16 compatibility
control-plane:
apiGatewayNginx:
type: LoadBalancer
features:
automaticProvisioningURL: http://keptn-gitea-provisioner-service.default
KUBECONFIG: ${{ env.KUBECONFIG }}

- name: Test connection to keptn
run: |
# get keptn helm chart
helm repo add keptn https://charts.keptn.sh
helm repo update

# reconfigure Keptn installation (Todo: This should eventually be part of the keptn-sandbox/action-install-keptn action)
helm upgrade --install keptn keptn/keptn -n keptn --create-namespace --version=$KEPTN_VERSION --reuse-values \
--set=control-plane.features.automaticProvisioningURL=http://keptn-gitea-provisioner-service.default
curl -X GET "${{ steps.install_keptn.outputs.KEPTN_API_URL }}/v1/metadata" -H "accept: application/json" -H "x-token: ${{ steps.install_keptn.outputs.KEPTN_API_TOKEN }}"

- name: Run integration tests
env:
KEPTN_ENDPOINT: ${{ steps.install_keptn.outputs.KEPTN_ENDPOINT }}
KEPTN_ENDPOINT: ${{ steps.install_keptn.outputs.KEPTN_API_URL }}
KEPTN_API_TOKEN: ${{ steps.install_keptn.outputs.KEPTN_API_TOKEN }}
GITEA_ADMIN_PASSWORD: ${{ steps.gitea_credentials.outputs.GITEA_ADMIN_PASSWORD }}
GITEA_ENDPOINT: ${{ steps.gitea.outputs.GITEA_ENDPOINT }}
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This repository contains a reference implementation for a [Keptn extension which
| Keptn Version* | [Keptn-Service-Template-Go Docker Image](https://hub.docker.com/r/keptn-sandbox/keptn-gitea-provisioner-service/tags) |
|:--------------:|:---------------------------------------------------------------------------------------------------------------------:|
| 0.15, 0.16 | keptn-sandbox/keptn-gitea-provisioner-service:0.1.0 |
| 0.17.0 | keptn-sandbox/keptn-gitea-provisioner-service:0.1.1 |

\* This is the Keptn version we aim to be compatible with. Other versions should work too, but there is no guarantee.

Expand All @@ -31,7 +32,6 @@ instance:
--set gitea.admin.password=${GITEA_ADMIN_PASSWORD} \
--set gitea.endpoint=${GITEA_ENDPOINT} \
--wait

```

*Note*: You can re-use existing credentials by omitting the set parameters of the helm installation; For a full list
Expand All @@ -56,11 +56,16 @@ instance:
--set gitea.config.server.ROOT_URL=http://gitea-http.${NAMESPACE}:3000/
```

* Keptn must be configured to use the keptn-gitea-provisioner-service to automatically provision git repositories:
* Keptn must be configured to use the keptn-gitea-provisioner-service to automatically provision git repositories. The flag is different for Keptn version 0.16 and version 0.17 and onwards:
```bash
#!/bin/bash
NAMESPACE=default

# Keptn 0.17
helm upgrade -n keptn keptn keptn/keptn \
--set "features.automaticProvisioning.serviceURL=http://keptn-gitea-provisioner-service.${NAMESPACE}"

# Keptn 0.16
helm upgrade -n keptn keptn keptn/keptn \
--set "control-plane.features.automaticProvisioningURL=http://keptn-gitea-provisioner-service.${NAMESPACE}"
```
Expand Down