ibm-cloud-architecture / devops-demo-pipelines

1 stars 5 forks source link

Update default Kabanero pipelines to include additional stages #31

Closed hollisc closed 4 years ago

hollisc commented 4 years ago

Currently the "*-build-deploy-pl" kabanero pipelines out of the box will execute the following tasks:

Create a custom stack to include additional tasks so the order will be the following:

Refer to this link for more info (https://kabanero.io/guides/working-with-pipelines/#creating-and-updating-your-own-tasks-and-pipelines).

When the product operator activates the CRD, it associates the pipelines in the pipelines archive with each of the stacks in the stack hub. The default pipelines are intended to work with all the stacks in the stack hub in the previous example. All of the pipeline-related resources (such as the tasks, trigger bindings, and pipelines) prefix the name of the resource with the keyword StackId. When the operator activates these resources, it replaces the keyword with the name of the stack it is activating.
oiricaud commented 4 years ago

Refer to this link to learn how to create a custom stack https://github.com/odrodrig/my-nodejs-express-stack/blob/master/customStack.md

oiricaud commented 4 years ago

Important to note this is for kabanero v0.9 -> https://kabanero.io/guides/working-with-pipelines/#creating-and-updating-your-own-tasks-and-pipelines

oiricaud commented 4 years ago

Note

I refactored nodejs-mcm-pl to StackId-mcm-pl and I get

\"StackId-mcm-pl\" is invalid: metadata.name: Invalid value: \"StackId-mcm-pl\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')} 

The CRD

    stacks:
      repositories:
      - https:
          name: central
          url: https://github.com/kabanero-io/kabanero-stack-hub/releases/download/0.6.3/kabanero-stack-hub-index.yaml
      - https:
          name: custom-node-stack
          url: https://github.com/odrodrig/custom-node-stack/releases/download/0.5.0/custom-node-stack-index.yaml
      pipelines:
      - https:
          url: https://github.com/kabanero-io/kabanero-pipelines/releases/download/0.6.1/default-kabanero-pipelines.tar.gz
        id: default
        sha256: 64aee2805d36127c2f1e0e5f0fc6fdae5cef19360c1bb506137584f3bd0988cc
      - https:
          url: https://github.com/oiricaud/devops-demo-kabanero-pipelines/releases/download/v1.31/default-kabanero-pipelines.tar.gz
        id: nodejs-mcm
        sha256: cfbe25c9650304601273fac167521a1c1c73e4ea2de2dd672d574abf0c033a9a

Not sure if this is due to mismatch on versions, the example shows v0.9 and we are using v0.6.1

However it is important to note in the docs it mentions

When the operator activates these resources, it replaces the keyword with the name of the stack it is activating. The operator is not activating these resources correctly

oiricaud commented 4 years ago

I submitted an issue on the kabanero repo https://github.com/kabanero-io/kabanero-pipelines/issues/395

oiricaud commented 4 years ago

@hollisc Quick question, should I do this for the pipelines as well or should I only do the tasks?

Screen Shot 2020-06-04 at 12 10 46 PM Screen Shot 2020-06-04 at 12 11 44 PM
oiricaud commented 4 years ago

We currently have the following stacks

I bound the directory mcm-pipelines to all of the stacks.

This directory include the following tasks:

oiricaud commented 4 years ago

Feedback

oiricaud commented 4 years ago

@hollisc Can you take a look at the pull request #34