Giter Site home page Giter Site logo

Comments (13)

michaelsauter avatar michaelsauter commented on August 10, 2024 1

I changed my mind overnight a little :) I think I will just pass through whatever response I get from OpenShift also when forwarding a webhook request...

from ods-core.

michaelsauter avatar michaelsauter commented on August 10, 2024 1

@gerardcl OK for me. I am not sure about if this is still needed, see my last comment. Seems not to be needed for 1.2 at least ...

from ods-core.

metmajer avatar metmajer commented on August 10, 2024

Thanks @clemensutschig.

What's the context? We are building a simple multi-repo orchestration engine that would integrate with ODS components through the webhook. Naturally, if B depends on A, we want to know that A has finished before kicking off B. Here, A could be a repo containing infrastructure as code.

from ods-core.

clemensutschig avatar clemensutschig commented on August 10, 2024

I tried it with curl

$ curl -X POST -k https://...../oapi/v1/namespaces/ods28-cd/buildconfigs/be-docker-plain-master/webhooks/............../generic
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1583  100  1583    0     0   2110      0 --:--:-- --:--:-- --:--:--  2110
{"kind":"Build","apiVersion":"build.openshift.io/v1","metadata":{"name":"be-docker-plain-master-23","namespace":"ods28-cd","selfLink":"/apis/build.openshift.io/v1/namespaces/ods28-cd/buildconfigs/be-docker-plain-master-23/instantiate","uid":"c8e9c214-85fc-11e9-9b41-0050569e63cb","resourceVersion":"129839908","creationTimestamp":"2019-06-03T12:40:36Z","labels":{"buildconfig":"be-docker-plain-master","openshift.io/build-config.name":"be-docker-plain-master","openshift.io/build.start-policy":"Serial"},"annotations":{"openshift.io/build-config.name":"be-docker-plain-master",**"openshift.io/build.number":"23"**},"ownerReferences":[{"apiVersion":"build.openshift.io/v1","kind":"BuildConfig","name":"be-docker-plain-master","uid":"aaf71a4d-6db1-11e9-9bbe-0050569e63cb","controller":true}]},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"..../ods28/ods28-be-docker-plain.git","ref":"master"},"status":{"phase":"New","config":{"kind":"BuildConfig","namespace":"ods28-cd","name":"be-docker-plain-master"},"output":{}}}
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Success",
  "message": "invalid Content-Type on payload, ignoring payload and continuing with build",
  "code": 200
}

a curl against

 https://..../apis/build.openshift.io/v1/namespaces/ods28-cd/builds/be-docker-plain-master-23

  "status": {
    "phase": "Pending",
    "config": {
      "kind": "BuildConfig",
      "namespace": "ods28-cd",
      "name": "be-docker-plain-master"
    },
    "output": {

does the rest then

from ods-core.

clemensutschig avatar clemensutschig commented on August 10, 2024

playing with this uncovered openshift/api#331

from ods-core.

clemensutschig avatar clemensutschig commented on August 10, 2024

@oalyman - can you pick this up - or wait until @michaelsauter is back (3 weeks)

from ods-core.

clemensutschig avatar clemensutschig commented on August 10, 2024

completed looks this way

  "status": {
    "phase": "Complete",
    "startTimestamp": "2019-02-18T17:18:20Z",
    "completionTimestamp": "2019-02-18T17:24:22Z",
    "config": {
      "kind": "BuildConfig",
      "namespace": "prov-cd",
      "name": "prov-app-test"
    },
    "output": {

    }
and pending
  "status": {
    "phase": "Pending",
    "config": {
      "kind": "BuildConfig",
      "namespace": "prov-cd",
      "name": "ods-provisioning-app-dev"
    },
    "output": {

    }
  }

from ods-core.

michaelsauter avatar michaelsauter commented on August 10, 2024

@clemensutschig @metmajer So if I understand this correctly, then you want one pipeline (the orchestrating one) to know about the status of other pipelines. If so, why should the webhook proxy answer that question? For me the proxy is simply the glue between Bitbucket and Jenkins. To me it looks like you can answer your question directly from a Jenkins pipeline as you can talk to the OpenShift API directly (via oc commands). Right?

from ods-core.

michaelsauter avatar michaelsauter commented on August 10, 2024

As a first step, I will work on returning the build ID, such as be-docker-plain-master-23 when the webhook request is forwarded. Response will be:

{"buildId": "be-docker-plain-master-23"}

Next step would be to add some kind of subfolder, e.g. /oapi/namespaces/:NAMESPACE/builds/:ID that queries for a build status. Here I would probably just pass on whatever OpenShift returns. Sounds good?

from ods-core.

metmajer avatar metmajer commented on August 10, 2024

As I understood it, the webhook proxy should act as the central gateway to a Jenkins instance running on OpenShift (see Clemens' first entry). @michaelsauter then what you suggest would be very convenient. Thanks!

from ods-core.

michaelsauter avatar michaelsauter commented on August 10, 2024

@clemensutschig Do we still need a way to query the build ID?

from ods-core.

gerardcl avatar gerardcl commented on August 10, 2024

@clemensutschig @michaelsauter moving this to 2.0 if it is not solved yet, if not feel free to close

from ods-core.

michaelsauter avatar michaelsauter commented on August 10, 2024

Closing due to no response, please open a new issue when a further feature is required.

from ods-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.