Skip to content

Commit

Permalink
Modifies build-push-gke-deploy task from gke-deploy directory accordi…
Browse files Browse the repository at this point in the history
…ng to the new reorg proposal

**NOTE: This only modifies the content of the yaml, changing
        the location of the file will be done in a different
        commit to make review easier

Changes include:
  - adds version label
  - adds a minimum pipeline versions supported by the task
  - adds tags for task
  - adds display name for task
  - modified description to add a summary

Issue: tektoncd#386

Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Jun 30, 2020
1 parent ab849bd commit 1bc11a5
Showing 1 changed file with 114 additions and 104 deletions.
218 changes: 114 additions & 104 deletions gke-deploy/build-push-gke-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,135 +2,145 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-and-push
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tags: deploy
displayName: "build push gke deploy"
spec:
description: >-
This Pipeline builds, pushes, and deploys your application to a Google Kubernetes
Engine cluster using gke-deploy.
params:
- name: pathToContext
description: The path to the build context relative to your source repo's root. This is used by Kaniko.
default: .
- name: pathToDockerFile
description: The path to the dockerfile to build, relative to the context.
default: Dockerfile
- name: imageUrl
description: URL of image repository.
- name: imageTag
description: Tag to apply to the built image.
default: latest
- name: pathToContext
description: The path to the build context relative to your source repo's root. This is used by Kaniko.
default: .
- name: pathToDockerFile
description: The path to the dockerfile to build, relative to the context.
default: Dockerfile
- name: imageUrl
description: URL of image repository.
- name: imageTag
description: Tag to apply to the built image.
default: latest
workspaces:
- name: source
- name: source
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor
command:
- /kaniko/executor
args:
- --dockerfile=$(params.pathToDockerFile)
- --destination=$(params.imageUrl):$(params.imageTag)
- --context=$(workspaces.source.path)/$(params.pathToContext)
- name: build-and-push
image: gcr.io/kaniko-project/executor
command:
- /kaniko/executor
args:
- --dockerfile=$(params.pathToDockerFile)
- --destination=$(params.imageUrl):$(params.imageTag)
- --context=$(workspaces.source.path)/$(params.pathToContext)
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: deploy-using-gke-deploy
spec:
params:
- name: pathToKubernetesConfigs
description: The path to the Kubernetes configs to deploy, relative to your source repo's root.
- name: imageUrl
description: URL of image repository
- name: imageTag
description: Tag of the images to be used.
default: latest
- name: clusterName
description: Name of target GKE cluster to deploy to.
- name: clusterLocation
description: Zone/region of target GKE cluster to deploy to.
- name: clusterProject
description: Project of target GKE cluster to deploy to.
default: ""
- name: pathToKubernetesConfigs
description: The path to the Kubernetes configs to deploy, relative to your source repo's root.
- name: imageUrl
description: URL of image repository
- name: imageTag
description: Tag of the images to be used.
default: latest
- name: clusterName
description: Name of target GKE cluster to deploy to.
- name: clusterLocation
description: Zone/region of target GKE cluster to deploy to.
- name: clusterProject
description: Project of target GKE cluster to deploy to.
default: ""
workspaces:
- name: source
- name: source
steps:
- name: deploy-using-gke-deploy
image: gcr.io/cloud-builders/gke-deploy
workingDir: $(workspaces.source.path)
command: ["/gke-deploy"]
args:
- "run"
- "--image=$(params.imageUrl):$(params.imageTag)"
- "--filename=$(workspaces.source.path)/$(params.pathToKubernetesConfigs)"
- "--cluster=$(params.clusterName)"
- "--location=$(params.clusterLocation)"
- "--project=$(params.clusterProject)"
- "--output=/var/tmp/gke-deploy"
- name: deploy-using-gke-deploy
image: gcr.io/cloud-builders/gke-deploy
workingDir: $(workspaces.source.path)
command: ["/gke-deploy"]
args:
- "run"
- "--image=$(params.imageUrl):$(params.imageTag)"
- "--filename=$(workspaces.source.path)/$(params.pathToKubernetesConfigs)"
- "--cluster=$(params.clusterName)"
- "--location=$(params.clusterLocation)"
- "--project=$(params.clusterProject)"
- "--output=/var/tmp/gke-deploy"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: build-push-gke-deploy
spec:
workspaces:
- name: source
- name: source
params:
- name: pathToContext
type: string
description: The path to the build context relative to your source repo's root. This is used by Kaniko.
default: .
- name: pathToDockerFile
type: string
description: The path to the dockerfile to build, relative to the context.
default: Dockerfile
- name: pathToKubernetesConfigs
type: string
description: The path to the Kubernetes configs to deploy, relative to your source repo's root.
- name: imageUrl
type: string
description: URL of image repository.
- name: imageTag
type: string
description: Tag to apply to the built image.
default: latest
- name: clusterName
type: string
description: Name of target GKE cluster to deploy to.
- name: clusterLocation
type: string
description: Zone/region of target GKE cluster to deploy to.
- name: clusterProject
type: string
description: Project of target GKE cluster to deploy to.
default: ""
tasks:
- name: build-and-push
taskRef:
name: build-and-push
params:
- name: pathToContext
value: "$(params.pathToContext)"
- name: imageUrl
value: "$(params.imageUrl)"
- name: imageTag
value: "$(params.imageTag)"
workspaces:
- name: source
workspace: source
- name: deploy-using-gke-deploy
taskRef:
name: deploy-using-gke-deploy
runAfter:
- build-and-push
params:
type: string
description: The path to the build context relative to your source repo's root. This is used by Kaniko.
default: .
- name: pathToDockerFile
type: string
description: The path to the dockerfile to build, relative to the context.
default: Dockerfile
- name: pathToKubernetesConfigs
value: "$(params.pathToKubernetesConfigs)"
type: string
description: The path to the Kubernetes configs to deploy, relative to your source repo's root.
- name: imageUrl
value: "$(params.imageUrl)"
type: string
description: URL of image repository.
- name: imageTag
value: "$(params.imageTag)"
type: string
description: Tag to apply to the built image.
default: latest
- name: clusterName
value: "$(params.clusterName)"
type: string
description: Name of target GKE cluster to deploy to.
- name: clusterLocation
value: "$(params.clusterLocation)"
type: string
description: Zone/region of target GKE cluster to deploy to.
- name: clusterProject
value: "$(params.clusterProject)"
workspaces:
- name: source
workspace: source
type: string
description: Project of target GKE cluster to deploy to.
default: ""
tasks:
- name: build-and-push
taskRef:
name: build-and-push
params:
- name: pathToContext
value: "$(params.pathToContext)"
- name: imageUrl
value: "$(params.imageUrl)"
- name: imageTag
value: "$(params.imageTag)"
workspaces:
- name: source
workspace: source
- name: deploy-using-gke-deploy
taskRef:
name: deploy-using-gke-deploy
runAfter:
- build-and-push
params:
- name: pathToKubernetesConfigs
value: "$(params.pathToKubernetesConfigs)"
- name: imageUrl
value: "$(params.imageUrl)"
- name: imageTag
value: "$(params.imageTag)"
- name: clusterName
value: "$(params.clusterName)"
- name: clusterLocation
value: "$(params.clusterLocation)"
- name: clusterProject
value: "$(params.clusterProject)"
workspaces:
- name: source
workspace: source

0 comments on commit 1bc11a5

Please sign in to comment.