Thursday, September 14, 2017

Openshift CI images: S2i image builder + gitlab CI webhook 3 / 3 (Gitlab)


To configure the deployment key in gitlab, go to:

your repository -> settings -> Repository ->Deploy keys



Introduce the public key in the box that will open. Consider using these keys as read only.


Next, we have to configure the CI integration with the webhook URL we obtained before - you will need Gitlab runner.

Add this to your .gitlab-ci.yml:
openshift_job:
  stage: deploy
  tags:
   - docker
   script:
   - "https_proxy= curl -k -XPOST -H'Content-Type: application/json' -d'{}' <your build CI webhook URL>"
   only:
    - master
We rebuild the image:

oc start-build mydocsproject
And it should all work now :)

No comments:

Post a Comment