gitlab-service

command module
v0.0.0-...-a62cfc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gitlab-service

GitHub release (latest by date) Go Report Card

This implements a gitlab-service for Keptn. If you want to learn more about Keptn visit us on keptn.sh

Compatibility Matrix

Keptn Version gitlab-service Docker Image
0.6.2 checkelmann/gitlab-service:develop

Installation

The gitlab-service can be installed as a part of Keptn's uniform.

Deploy in your Kubernetes cluster

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
Configuration

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
Up- or Downgrading

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
Uninstall

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

License

Please find more information in the LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址