Git Product home page Git Product logo

pipeline-library's Introduction

Java CI with Maven License

OpenShift Pipeline Library

What This Repo Is

This is a shared library of Jenkins Pipeline functionality we've developed and use frequently within the CoP. This repo can be imported into a jenkins server (following this doc) and used to add functionality to Pipeline scripts.

You can include this repo in your Jenkins Pipeline by defining following at beginning of your Jenkinsfile:

library identifier: "pipeline-library@master", retriever: modernSCM(
  [$class: "GitSCMSource",
   remote: "https://github.com/redhat-cop/pipeline-library.git"])

Included in this library:

Please see https://github.com/redhat-cop/container-pipelines or https://github.com/redhat-cop/containers-quickstarts for related content.

Other Resources

pipeline-library's People

Contributors

cpeters avatar dwasinge avatar etsauer avatar garethahealy avatar gl4di4torrr avatar itewk avatar kkoller avatar mcanoy avatar pabrahamsson avatar sherl0cks avatar springdo avatar syvanen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipeline-library's Issues

Migrate from travis to prow for CI

@pabrahamsson ; am sure this is already on your radar but this is to just track the work.

Also, i know its been talked about on the weekly calls, but has it been decided on how someone can view/edit the prow config?

error calling binaryBuild

When I try to call the binaryBuild function I am getting this error.

openshift.selector("bc", "${input.buildConfigName}").startBuild("${input.buildFrom}=${input.artifactsDirectoryName}", "--wait").logs('-f')

[logs:build/human-review-backend-245] Receiving source from STDIN as file human-review-backend-1.0-SNAPSHOT.jar
==================================================================
Starting S2I Java Build .....
S2I source build with plain binaries detected
Copying binaries from /tmp/src to /deployments ...
... done

Pushing image docker.artifactory.apps.mgt.devsecops.gov/yellowdog/human-review-backend:latest ...
Pushed 5/6 layers, 84% complete
Pushed 6/6 layers, 100% complete
Push successful

Error running logs on at least one item: [Uploading file "target/human-review-backend-1.0-SNAPSHOT.jar" as binary input for the build ..., build/human-review-backend-245];
{reference={}, err=, verb=logs, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=yellowdog --token=XXXXX logs Uploading file "target/human-review-backend-1.0-SNAPSHOT.jar" as binary input for the build ... -f , out=error: expected 'logs (POD | TYPE/NAME) [CONTAINER_NAME]'.
POD or TYPE/NAME is a required argument for the logs command
See 'oc logs -h' for help and examples., status=1}

Verify Deployment Error

Seems like this issue still occurs. If I add some sort of wait/delay it seems to work but otherwise the loop does not get entered and the pipeline stalls in the state pictured below.

The verify deployment function is running immediately after I deploy the application.

Screen Shot 2019-04-03 at 9 41 42 AM (2)

Screen Shot 2019-04-03 at 9 45 37 AM (2)

Need to document a testing strategy for this repo.

As we are starting to get some real contributions to his repo, I'm noticing that the PR review process is fairly slow. Part of this, I think, is because we don't have a good test strategy in place. CI would be great, but I think there's probably a more MVP solution to making reviews run more smoothly.

What I'm picturing is a standard Applier inventory that spins up a jenkins server with this library baked in (we already have the s2i build), plus a test directory for each contribution, containing a jenkinsfile that can be run to exercise the new functionality.

We should document the things that we expect from a contribution, which should include tests

@pabrahamsson @syvanen @sabre1041 @springdo

Add an example for a Maven Multi-Module Pipeline

I have a Maven Multi-Module project (https://github.com/rhoar-shootout/rhoar-vertx) and I am wondering how to wire up a multimodule Maven project into Jenkins for building several containers for OpenShift. In my example, there are 4 different images which should be built and deployed. Should it be done with a single Jenkinsfile at the top level? One for each service? I will be experimenting with different options and report back here if I do not get other feedback.

verify deployment skip ssl

We have been having issues on one of our clusters where the certificate has expired (yes, we need to update the cert). However, from the app teams perspective, this makes their pipeline fail on verifyDeployment. The upgrade of the certificate is not very high on our priority because releasing a later version of OpenShift is greater than improving this cluster.

Re-factor applier.groovy to get credentials from Jenkins not OCP

This block in applier.groovy:

        openshift.withCluster() {
            def secretData = openshift.selector("secret/${input.secretName}").object().data
            def encodedToken = secretData.token
            env.TOKEN = sh(script:"set +x; echo ${encodedToken} | base64 --decode", returnStdout: true)
        }

Assumes that Jenkins is running on openshift. I think that's not a great assumption.

Change to something like this:

node {
  withCredentials([string(credentialsId: 'mytoken', variable: 'TOKEN')]) {
    sh /* WRONG! */ """
      set +x
      curl -H 'Token: $TOKEN' https://some.api/
    """
    sh /* CORRECT */ '''
      set +x
      curl -H 'Token: $TOKEN' https://some.api/
    '''
  }
}

from: https://jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials

It gets away from that assumption and can still get the secret needed. All you need to know is that you are running on Jenkins. The OCP sync plugin will handle the syncing of an openshift secret to Jenkins (wherever it may live) and then we don't have to worry about knowing that Jenkins is running on Openshift. Jenkins could literally be running wherever and execute this applier.groovy

Strategy to move away from prow

this repo uses prow to test the pipeline lib by deploying Jenkins and creating jobs. those bits are very OCP specific (BuildConfigs etc). need to define how we do builds for OCP bits or what the strategy is to build without any dependency on OCP

Need pipeline library user documentation

As this starts to become more used, documentation for the user base will be nice. What functions are currently supported, the parameters that users are able to pass to the functions, etc. I am thinking an asciidoc or something like that so each company can expose the documentation internally.

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.