$ curl -LO https://github.com/tektoncd/cli/releases/download/v0.8.0/tkn_0.8.0_Linux_x86_64.tar.gz
$ tar -xvf tkn_0.8.0_Linux_x86_64.tar.gz
$ sudo mv tkn /usr/bin/
$ oc describe packagemanifest openshift-pipelines-operator -n openshift-marketplace
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/operator/subscription.yaml
$ oc api-resources --api-group=tekton.dev
NAME SHORTNAMES APIGROUP NAMESPACED KIND
clustertasks tekton.dev false ClusterTask
conditions tekton.dev true Condition
eventlisteners el tekton.dev true EventListener
pipelineresources tekton.dev true PipelineResource
pipelineruns pr,prs tekton.dev true PipelineRun
pipelines tekton.dev true Pipeline
taskruns tr,trs tekton.dev true TaskRun
tasks tekton.dev true Task
triggerbindings tb tekton.dev true TriggerBinding
triggertemplates tt tekton.dev true TriggerTemplate
$ oc get pod -n openshift-pipelines
NAME READY STATUS RESTARTS AGE
tekton-pipelines-controller-78f6dd64cc-v5qsk 1/1 Running 0 17m
tekton-pipelines-webhook-78668fcc5b-wb2m8 1/1 Running 0 17m
tekton-triggers-controller-84766fbf76-lm4qq 1/1 Running 0 16m
tekton-triggers-webhook-66456d7fbc-vxjjh 1/1 Running 0 16m
$ oc auth can-i create pipeline.tekton.dev
$ oc auth can-i create Pipeline
$ oc auth can-i create Task
$ oc auth can-i create PipelineResource
$ oc auth can-i create PipelineRun
$ oc get config
NAME AGE
cluster 4m
$ oc new-project lab-tekton
$ oc get serviceaccount pipeline
NAME SECRETS AGE
pipeline 2 4m11s
$ ]$ oc get clustertask
NAME AGE
buildah 28m
buildah-v0-10-0 28m
buildah-v0-8-0 28m
jib-maven 28m
openshift-client 28m
openshift-client-v0-10-0 28m
openshift-client-v0-8-0 28m
s2i 28m
s2i-go 28m
s2i-go-v0-10-0 28m
s2i-go-v0-8-0 28m
s2i-java-11 28m
s2i-java-11-v0-10-0 28m
s2i-java-11-v0-8-0 28m
s2i-java-8 28m
s2i-java-8-v0-10-0 28m
s2i-nodejs 28m
s2i-nodejs-v0-10-0 28m
s2i-perl 28m
s2i-perl-v0-10-0 28m
s2i-php 28m
s2i-php-v0-10-0 28m
s2i-python-3 28m
s2i-python-3-v0-10-0 28m
s2i-ruby 28m
s2i-ruby-v0-10-0 28m
s2i-v0-10-0 28m
s2i-v0-8-0 28m
$ oc new-app centos/mongodb-36-centos7 -e MONGODB_USER=admin MONGODB_DATABASE=mongodb MONGODB_PASSWORD=secret MONGODB_ADMIN_PASSWORD=super-secret
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/sampleapp/sampleapp.yaml
$ oc set env dc/nodejs-ex MONGO_URL="mongodb://admin:secret@mongodb-36-centos7:27017/mongodb"
$ oc get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mongodb-36-centos7 ClusterIP 172.30.227.96 <none> 27017/TCP 32s
nodejs-ex ClusterIP 172.30.18.167 <none> 8080/TCP,8443/TCP,8778/TCP 6m54s
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/tektontasks/s2i-nodejs-task.yaml
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/tektontasks/openshift-client-task.yaml
$ tkn task ls
NAME AGE
openshift-client 35 seconds ago
s2i-nodejs 1 minute ago
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/pipeline/deploy-pipeline.yaml
$ tkn pipeline ls
NAME AGE LAST RUN STARTED DURATION STATUS
deploy-pipeline 9 seconds ago --- --- --- ---
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/resources/git-pipeline-resource.yaml
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/learn-katacoda/master/middleware/pipelines/assets/resources/image-pipeline-resource.yaml
$ tkn resource ls
NAME TYPE DETAILS
nodejs-ex-git git url: https://github.com/sclorg/nodejs-ex
nodejs-ex-image image url: image-registry.openshift-image-registry.svc:5000/lab-tekton/nodejs-ex:latest
$ tkn pipeline start deploy-pipeline -r app-git=nodejs-ex-git -r app-image=nodejs-ex-image -s pipeline
Pipelinerun started: deploy-pipeline-run-hx
In order to track the pipelinerun progress run:
tkn pipelinerun logs deploy-pipeline-run-jxr26 -f -n lab-tekton
$ tkn pipelinerun list
NAME STARTED DURATION STATUS
deploy-pipeline-run-jxr26 1 minute ago --- Running
$ tkn pipeline logs -f
Showing logs...
[build : create-dir-image-jmt46]
...
[build : generate]
...
[build : build]
...
[build : push]
...
[deploy : oc] deploymentconfig.apps.openshift.io/nodejs-ex rolled out
$ tkn pipelinerun ls
NAME STARTED DURATION STATUS
deploy-pipeline-run-vw9vd 9 minutes ago 7 minutes Succeeded