Skip to content

Commit

Permalink
feat: Upgrade to Keptn 0.17 (#9)
Browse files Browse the repository at this point in the history
* feat: Upgrade to Keptn 0.17

Signed-off-by: TannerGabriel <[email protected]>

* Change Keptn connection check in Integration tests

Signed-off-by: TannerGabriel <[email protected]>

* Change Keptn endpoint for Integration tests

Signed-off-by: TannerGabriel <[email protected]>

* Fix Keptn installation in integration tests

Signed-off-by: TannerGabriel <[email protected]>
  • Loading branch information
TannerGabriel authored Jul 11, 2022
1 parent 86b5315 commit a69e43c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
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

0 comments on commit a69e43c

Please sign in to comment.