This implements a gitlab-service for Keptn. If you want to learn more about Keptn visit us on keptn.sh
Keptn Version | gitlab-service Docker Image |
---|---|
0.6.2 | checkelmann/gitlab-service:develop |
The gitlab-service can be installed as a part of Keptn's uniform.
To deploy the current version of the gitlab-service in your Keptn Kubernetes cluster, adjust and apply the deploy/service.yaml
file:
You need to set your GitLab Instance URL and API Token in the service.yaml - This will be moved in a K8s-Secret in the official release!
- name: GITLAB_URL
value: gitlab.com
- name: GITLAB_TOKEN
value: YOURGITLABAPITOKEN
kubectl apply -f deploy/service.yaml
This should install the gitlab-service
together with a Keptn distributor
into the keptn
namespace, which you can verify using
kubectl -n keptn get deployment gitlab-service -o wide
kubectl -n keptn get pods -l run=gitlab-service
You need to configure your gitlab.conf.yaml and add it as project resource
---
spec_version: '0.1.0'
gitlabinstance:
- name: gitlab.com
url: $ENV.GITLAB_URL
token: $ENV.GITLAB_TOKEN
pipelines:
- name: MyGitLabPipeline
instance: gitlab.com
projectid: 19092773
ref: master
variables:
Message: My message from Keptn Project $PROJECT-$STAGE-$SERVICE
WaitTime: 2
Result: SUCCESS
- name: MyGitLabPipelineWithFailure
instance: gitlab.com
projectid: 19092773
ref: error
variables:
Message: My message from Keptn Project $PROJECT-$STAGE-$SERVICE
WaitTime: 2
Result: FAILURE
events:
- event: configuration.change
action: MyGitLabPipeline
timeout: 60
onsuccess:
event: deployment.finished
deploymentURIPublic: http://yourdeployedapp.yourdomain
result: pass
onfailure:
event: deployment.finished
result: failed
Upload the configuration file as keptn resource:
keptn add-resource --project=sockshop --stage=hardening --service=carts --resource=gitlab/gitlab.conf.yaml --resourceUri=gitlab/gitlab.conf.yaml
Adapt and use the following command in case you want to up- or downgrade your installed version (specified by the $VERSION
placeholder):
kubectl -n keptn set image deployment/gitlab-service gitlab-service=checkelmann/gitlab-service:$VERSION --record
To delete a deployed gitlab-service, use the file deploy/*.yaml
files from this repository and delete the Kubernetes resources:
kubectl delete -f deploy/service.yaml
Please find more information in the LICENSE file.