Last active
May 12, 2019 01:42
-
-
Save castlemilk/2e6263da6e8bcac5fbb8b2c6f62860a9 to your computer and use it in GitHub Desktop.
Tekton CI Pipeline - local environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: tekton.dev/v1alpha1 | |
kind: PipelineResource | |
metadata: | |
name: dev-xp-git | |
spec: | |
type: git | |
params: | |
- name: revision | |
value: master | |
- name: url | |
value: https://github.com/castlemilk/next-dev-xp | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: PipelineResource | |
metadata: | |
name: dev-xp-image | |
spec: | |
type: image | |
params: | |
- name: url | |
value: host.docker.local:5000/dev-xp/webapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: tekton.dev/v1alpha1 | |
kind: Task | |
metadata: | |
name: build-docker-image-from-git-source | |
spec: | |
inputs: | |
resources: | |
- name: docker-source | |
type: git | |
params: | |
- name: pathToDockerFile | |
description: The path to the dockerfile to build | |
default: /workspace/docker-source/Dockerfile | |
- name: pathToContext | |
description: | |
The build context used by Kaniko | |
(https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts) | |
default: /workspace/docker-source | |
outputs: | |
resources: | |
- name: builtImage | |
type: image | |
steps: | |
- name: build-and-push | |
image: gcr.io/kaniko-project/executor | |
command: | |
- /kaniko/executor | |
args: | |
- --dockerfile=${inputs.params.pathToDockerFile} | |
- --destination=${outputs.resources.builtImage.url} | |
- --context=${inputs.params.pathToContext} | |
- --insecure | |
- --verbosity=debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: tekton.dev/v1alpha1 | |
kind: TaskRun | |
metadata: | |
name: build-docker-image-from-git-source-task-run | |
spec: | |
taskRef: | |
name: build-docker-image-from-git-source | |
trigger: | |
type: manual | |
inputs: | |
resources: | |
- name: docker-source | |
resourceRef: | |
name: dev-xp-git | |
params: | |
- name: pathToDockerFile | |
value: /workspace/docker-source/webapp/Dockerfile | |
- name: pathToContext | |
value: /workspace/docker-source/webapp | |
outputs: | |
resources: | |
- name: builtImage | |
resourceRef: | |
name: dev-xp-image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment