GithubHelp home page GithubHelp logo

perf-org-5krepos / ibm-garage-tekton-tasks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bhaskers-blu-org1/ibm-garage-tekton-tasks

0.0 1.0 0.0 533 KB

Contains a set of generic Tekton Tasks for use with Tekton Pipelines

License: Apache License 2.0

Shell 100.00%

ibm-garage-tekton-tasks's Introduction

IBM Cloud Garage Tekton Pipelines

This repository provides Tekton pipelines and tasks for all nodejs and java application Code Pattern templates.

Install the tasks and pipelines

The best way to install the tasks and template pipelines is through the versioned releases. The following steps will get the tasks installed in your cluster. Note: These instructions assume you have already logged into the cluster.

  1. Look through the releases and select the one that should be installed - https://github.com/IBM/ibm-garage-tekton-tasks/releases
  2. From the command-line, run the following (substituting the RELEASE and NAMESPACE values as appropriate):
    export RELEASE="1.21.0"
    export NAMESPACE="tools"
    kubectl apply -n ${NAMESPACE} -f https://github.com/IBM/ibm-garage-tekton-tasks/releases/download/${RELEASE}/release.yaml

Get the code

Clone this repo.

git clone [email protected]:IBM/ibm-garage-tekton-tasks.git
cd ibm-garage-tekton-tasks

Service account to run Pipeline

If you install Tekton using the OpenShift Pipeline Operator on OCP4, a service account pipeline is already created and you can skip the following commands.

Create a service account like pipeline

oc create serviceaccount pipeline
oc adm policy add-scc-to-user privileged -z pipeline
oc adm policy add-role-to-user edit -z pipeline

Create Pipeline Tasks

IMPORTANT: If Tekton version is lower than 0.7.0 then use the tasks from the pre-0.7.0 directory.

  • Create pipelines tasks for each environment for example the dev namespace:

    kubectl create -f ibm-garage-tekton-tasks/pre-0.7.0/tasks/ -n dev
  • If using Tekton version 0.7.0 or greater use this command instead:

    kubectl create -f ibm-garage-tekton-tasks/tasks/ -n dev

This step will create the following tasks:

  • igc-nodejs-tests
  • igc-java-gradle-tests
  • igc-build-push.yaml
  • igc-build-tag-push.yaml
  • igc-build-tag-push-ibm.yaml
  • igc-deploy
  • igc-health-check
  • igc-helm-package
  • igc-gitops

Create Pipelines

  • Create pipelines for each environment for example the dev namespace.

    kubectl create -f ibm-garage-tekton-tasks/pipelines/ -n dev

This step will create following Pipelines:

  • igc-java-gradle
  • igc-nodejs

Manually run a Pipeline

  • The internal container registry service hostname is different for ocp3 and ocp4

    • ocp3: docker-registry.default.svc:5000
    • ocp4: image-registry.openshift-image-registry.svc:5000
  • To install the input pipeline resources for the respective application template run the following commands:

    For ocp4:

    OCP=ocp4 kubectl apply -f test/resources/$OCP/

    For ocp3:

    OCP=ocp3 kubectl apply -f test/resources/$OCP/
  • Run a pipeline for one of the application templates using the Tekton CLI tkn and the helper script

    Usage: ./test/scripts/run.sh [nodesjs-typescript | nodejs-react | nodejs-angular | java-spring]

    For example to run the pipeline for the application template nodejs-typescript

    ./test/scripts/run.sh nodesjs-typescript

    The script will output the name of the pipelinerun, and a command to follow the logs

    Pipelinerun started: igc-nodejs-run-fqgr7
    
    In order to track the pipelinerun progress run:
    tkn pipelinerun logs igc-nodejs-run-fqgr7 -f -n dev
    

Create Git Webhook

  • Create a Git Webhook on the dev namespace using the tekton dashboard.

Now, your pipeline runs whenever the changes are pushed to the repository.

ibm-garage-tekton-tasks's People

Contributors

seansund avatar csantanapr avatar hemankita avatar

Watchers

James Cloos avatar

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.