Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasO committed Feb 27, 2020
1 parent 10a4a7e commit 8387c58
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 38 deletions.
15 changes: 10 additions & 5 deletions deploy/tekton-pipeline/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
This Readme will help to build the Tekton pipeline


https://itnext.io/explore-different-methods-to-build-and-push-image-to-private-registry-with-tekton-pipelines-5cad9dec1ddc

### Create Secret

```shell
kubectl create secret docker-registry regcred --docker-server=quay.io/nicolaso/frontend --docker-username=XXXXXXX --docker-password=XXXXXXX --docker-email=XXXXXX
```
### Troubeshoot

tkn pipeline start build-and-deploy
tkn pipelinerun logs build-and-deploy-run-z2rz8 -f -n pipelines-tutorial

```shell
tkn pipeline ls
tkn resource ls
tkn pipeline logs -f
```

If you want to re-run the pipeline again, you can use the following short-hand command to rerun the last pipelinerun again that uses the same pipeline resources and service account used in the previous pipeline run:





```shell
tkn pipeline start build-and-deploy --last
```


```shell
oc adm policy add-cluster-role-to-user cluster-admin -z socks-shop
```
Expand Down
28 changes: 11 additions & 17 deletions deploy/tekton-pipeline/TektonRunScipt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ spec:
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
serviceAccountName: build-registry
name: build-and-deploy
spec:
serviceAccountName: build-registry
resources:
- name: front-end-repo
type: git
Expand All @@ -108,28 +108,22 @@ spec:
- name: TLSVERIFY
value: "false"

- name: apply-front-end-manifests
- name: deploy-web
taskRef:
name: apply-manifests
name: deploy-using-kubectl
resources:
inputs:
- name: source
resource: front-end-repo
runAfter:
- build-front-end

- name: update-front-end-image
taskRef:
name: update-deployment
resources:
inputs:
resource: source-repo
- name: image
resource: front-end-image
resource: web-image
from:
- build-skaffold-web
params:
- name: deployment
value: "front-end"
runAfter:
- apply-front-end-manifests
- name: path
value: /workspace/source/deployment/front-end.yaml
- name: yamlPathToImage
value: "spec.template.spec.containers[0].image"
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
Expand Down
26 changes: 10 additions & 16 deletions deploy/tekton-pipeline/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,19 @@ spec:
- name: TLSVERIFY
value: "false"

- name: apply-front-end-manifests
- name: deploy-web
taskRef:
name: apply-manifests
name: deploy-using-kubectl
resources:
inputs:
- name: source
resource: front-end-repo
runAfter:
- build-front-end

- name: update-front-end-image
taskRef:
name: update-deployment
resources:
inputs:
resource: source-repo
- name: image
resource: front-end-image
resource: web-image
from:
- build-skaffold-web
params:
- name: deployment
value: "front-end"
runAfter:
- apply-front-end-manifests
- name: path
value: /workspace/source/deployment/front-end.yaml
- name: yamlPathToImage
value: "spec.template.spec.containers[0].image"

0 comments on commit 8387c58

Please sign in to comment.