diff --git a/deploy.yaml b/deploy.yaml index d92f7d5..c41f3be 100644 --- a/deploy.yaml +++ b/deploy.yaml @@ -107,7 +107,7 @@ spec: spec: containers: - name: front-end - image: beppev/server-d:latest + image: beppev/server-d:master ports: - containerPort: 6000 --- diff --git a/manifests/full-pipeline.yaml b/manifests/full-pipeline.yaml index b0b4507..5efb611 100644 --- a/manifests/full-pipeline.yaml +++ b/manifests/full-pipeline.yaml @@ -109,14 +109,15 @@ spec: command: - /kaniko/executor args: - - "--dockerfile=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/dockerfile" + - "--dockerfile=$(inputs.resources.git-source.path)/$(inputs.params.context)/dockerfile" - "--destination=beppev/$(inputs.params.image-name):$(inputs.params.version)" - - "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/" + - "--context=$(inputs.resources.git-source.path)/$(inputs.params.context)/" --- apiVersion: tekton.dev/v1alpha1 kind: Task metadata: - name: deploy-application + name: destroy-application + namespace: tekton-pipeline-istio-project-1 spec: inputs: resources: @@ -130,6 +131,18 @@ spec: - "delete" - "-f" - "$(inputs.resources.git-source.path)/deploy.yaml" +--- +apiVersion: tekton.dev/v1alpha1 +kind: Task +metadata: + name: deploy-application + namespace: tekton-pipeline-istio-project-1 +spec: + inputs: + resources: + - name: git-source + type: git + steps: - name: deploy-new-app image: lachlanevenson/k8s-kubectl command: ["kubectl"] @@ -150,6 +163,13 @@ spec: - name: git-experimental type: git tasks: + - name: destroy-application #@TODO make it so that the delete can be skipped if error + taskRef: + name: destroy-application + resources: + inputs: + - name: git-source + resource: git-master - name: build-and-push-a taskRef: name: build-and-push @@ -167,8 +187,6 @@ spec: - name: build-and-push-b-stable taskRef: name: build-and-push - runAfter: - - build-and-push-a params: - name: context value: "serverB" @@ -183,8 +201,6 @@ spec: - name: build-and-push-b-experimental taskRef: name: build-and-push - runAfter: - - build-and-push-b params: - name: context value: "serverB" @@ -199,28 +215,28 @@ spec: - name: build-and-push-d taskRef: name: build-and-push - runAfter: - - build-and-push-b-experimental params: - - name: pathToContext + - name: context value: "serverD" - - name: imageUrl + - name: image-name value: "server-d" + - name: version + value: "master" resources: inputs: - name: git-source resource: git-master - - name: deploy-application + - name: deploy-application #@TODO make it so that the delete can be skipped if error taskRef: name: deploy-application runAfter: - build-and-push-d - params: - - name: pathToContext - value: "." - - name: pathToYamlFile - value: "deploy.yaml" + - build-and-push-b-experimental + - build-and-push-a + - build-and-push-b-stable + - destroy-application resources: inputs: - name: git-source resource: git-master +# DO NOT FORGET TO SET REGCREDS FOR DOCKER diff --git a/manifests/github-trigger-setup.yaml b/manifests/github-trigger-setup.yaml new file mode 100644 index 0000000..9cb0342 --- /dev/null +++ b/manifests/github-trigger-setup.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: tekton.dev/v1alpha1 +kind: TriggerBinding +metadata: + name: github-trigger-binding + namespace: tekton-pipeline-istio-project-1 +spec: + params: + - name: gitrevision + value: $(body.pull_request.head.sha) + - name: gitrepositoryurl + value: $(body.pull_request.head.repo.clone_url) + - name: prurl + value: $(body.pull_request.html_url) + - name: repo + value: $(body.pull_request.base.repo.full_name) + - name: source + value: github +--- +apiVersion: tekton.dev/v1alpha1 +kind: TriggerTemplate +metadata: + name: github-trigger-template + namespace: tekton-pipeline-istio-project-1 +spec: + params: + - name: gitrevision + description: The git revision + default: master + - name: gitrepositoryurl + description: The git repository url + resourcetemplates: + - apiVersion: tekton.dev/v1alpha1 + kind: PipelineRun + metadata: + name: application-pipeline-run + namespace: tekton-pipeline-istio-project-1 + spec: + serviceAccountName: service-acc + pipelineRef: + name: application-pipeline + resources: + - name: git-master + resourceRef: + name: git-master + - name: git-experimental + resourceRef: + name: git-experimental +--- +apiVersion: tekton.dev/v1alpha1 +kind: EventListener +metadata: + name: github-event-listener +spec: + serviceAccountName: service-acc + triggers: + - binding: + name: github-trigger-binding + template: + name: github-trigger-template \ No newline at end of file diff --git a/manifests/github-webhook-setup.yaml b/manifests/github-webhook-setup.yaml new file mode 100644 index 0000000..4c498f7 --- /dev/null +++ b/manifests/github-webhook-setup.yaml @@ -0,0 +1,93 @@ +# MAKE SURE TO SET UP SECRETS.YAML BEFORE EXAMPLE: +# +# this sets up webhooks for github. you can also do this manually in web gui +# +# +# +# apiVersion: v1 +# kind: Secret +# metadata: +# name: webhook-secret +# namespace: tekton-pipeline-istio-project-1 +# stringData: +# token: GITHUBTOKEN +# secret: random-string-data +--- +apiVersion: tekton.dev/v1alpha1 +kind: Task +metadata: + name: create-webhook + namespace: tekton-pipeline-istio-project-1 +spec: + volumes: + - name: github-secret + secret: + secretName: $(inputs.params.GitHubSecretName) + inputs: + params: + - name: ExternalDomain + description: "The external domain for the EventListener e.g. `$(inputs.params.EventListenerName)..nip.io`" + - name: GitHubUser + description: "The GitHub user" + - name: GitHubRepo + description: "The GitHub repo where the webhook will be created" + - name: GitHubOrg + description: "The GitHub organization where the webhook will be created" + - name: GitHubSecretName + description: "The Secret name for GitHub access token. This is always mounted and must exist" + - name: GitHubAccessTokenKey + description: "The GitHub access token key name" + - name: GitHubSecretStringKey + description: "The GitHub secret string key name" + - name: GitHubDomain + description: "The GitHub domain. Override for GitHub Enterprise" + default: "github.com" + - name: WebhookEvents + description: "List of events the webhook will send notifications for" + default: '[\"push\",\"pull_request\"]' + steps: + - name: create-webhook + image: pstauffer/curl:latest + volumeMounts: + - name: github-secret + mountPath: /var/secret + command: + - sh + args: + - -ce + - | + set -e + echo "Create Webhook" + if [ $(inputs.params.GitHubDomain) = "github.com" ];then + curl -v -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://api.github.com/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + else + curl -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)/\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://$(inputs.params.GitHubDomain)/api/v3/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + fi +--- +# https://medium.com/@nikhilthomas1/cloud-native-cicd-on-openshift-with-openshift-pipelines-tektoncd-pipelines-part-3-github-1db6dd8e8ca7 +apiVersion: tekton.dev/v1alpha1 +kind: TaskRun +metadata: + name: create-repo-webhook + namespace: tekton-pipeline-istio-project-1 +spec: + taskRef: + name: create-webhook + inputs: + params: + - name: GitHubOrg + value: "beppevanrolleghem" + - name: GitHubUser + value: "beppevanrolleghem" + - name: GitHubRepo + value: "cicdTest" + - name: GitHubSecretName + value: webhook-secret + - name: GitHubAccessTokenKey + value: token + - name: GitHubSecretStringKey + value: secret + - name: ExternalDomain + value: 35.233.93.220 + timeout: 1000s + serviceAccount: service-acc diff --git a/manifests/pipeline-run.yaml b/manifests/pipeline-run.yaml index f9368fa..1794ace 100644 --- a/manifests/pipeline-run.yaml +++ b/manifests/pipeline-run.yaml @@ -8,7 +8,9 @@ spec: pipelineRef: name: application-pipeline resources: - - name: git-source + - name: git-master resourceRef: - name: git - + name: git-master + - name: git-experimental + resourceRef: + name: git-experimental diff --git a/manifests/pipeline/pipeline.yaml b/manifests/pipeline/pipeline.yaml index b0560f9..5fb715d 100644 --- a/manifests/pipeline/pipeline.yaml +++ b/manifests/pipeline/pipeline.yaml @@ -2,111 +2,82 @@ apiVersion: tekton.dev/v1alpha1 kind: Pipeline metadata: name: application-pipeline + namespace: tekton-pipeline-istio-project-1 spec: resources: - - name: git-source + - name: git-master + type: git + - name: git-experimental type: git - params: - - name: pathToYamlFile - description: path to deploy.yaml for final application deploy - default: config.yaml - - name: pathToContext - description: The path to the build context, used by Kaniko - within the workspace - default: . - - name: imageUrl-a - description: Url of image repository a - default: deploy_target - - name: imageTag-a - description: Tag to apply to the built image a - default: latest - - name: pathToContext-a - description: The path to the build context, used by Kaniko - within the workspace - default: . - - name: imageUrl-b - description: Url of image repository - default: deploy_target - - name: imageTag-b - description: Tag to apply to the built image - default: latest - - name: pathToContext-b - description: The path to the build context, used by Kaniko - within the workspace - default: . - - name: imageUrl-c - description: Url of image repository - default: deploy_target - - name: imageTag-c - description: Tag to apply to the built image - default: latest - - name: pathToContext-c - description: The path to the build context, used by Kaniko - within the workspace - default: . - tasks: - name: build-and-push-a taskRef: name: build-and-push params: - - name: pathToContext - value: "$(params.pathToContext-a)" - - name: imageUrl - value: "$(params.imageUrl-a)" - - name: imageTag - value: "$(params.imageTag-a)" + - name: context + value: "serverA" + - name: image-name + value: "server-a" + - name: version + value: "master" resources: inputs: - name: git-source - resource: git-source - - name: build-and-push-b + resource: git-master + - name: build-and-push-b-stable taskRef: name: build-and-push runAfter: - build-and-push-a params: - - name: pathToContext - value: "$(params.pathToContext-b)" - - name: imageUrl - value: "$(params.imageUrl-b)" - - name: imageTag - value: "$(params.imageTag-b)" + - name: context + value: "serverB" + - name: image-name + value: "server-b" + - name: version + value: "master" resources: inputs: - name: git-source - resource: git-source - - name: build-and-push-c + resource: git-master + - name: build-and-push-b-experimental taskRef: name: build-and-push runAfter: - - build-and-push-b + - build-and-push-b-stable params: - - name: pathToContext - value: "$(params.pathToContext-c)" - - name: imageUrl - value: "$(params.imageUrl-c)" - - name: imageTag - value: "$(params.imageTag-c)" + - name: context + value: "serverB" + - name: image-name + value: "server-b" + - name: version + value: "experimental" resources: inputs: - name: git-source - resource: git-source + resource: git-experimental + - name: build-and-push-d + taskRef: + name: build-and-push + runAfter: + - build-and-push-b-experimental + params: + - name: context + value: "serverD" + - name: image-name + value: "server-d" + - name: version + value: "master" + resources: + inputs: + - name: git-source + resource: git-master - name: deploy-application taskRef: name: deploy-application runAfter: - - build-and-push-c - params: - - name: pathToContext - value: "." - - name: pathToYamlFile - value: "deploy.yaml" - - name: imageUrl-a - value: "$(params.imageUrl-a)" - - name: imageTag-a - value: "$(params.imageTag-a)" - - name: imageUrl-b - value: "$(params.imageUrl-b)" - - name: imageTag-b - value: "$(params.imageTag-b)" + - build-and-push-d resources: inputs: - name: git-source - resource: git-source + resource: git-master diff --git a/manifests/pipeline/pipelineRun.yaml b/manifests/pipeline/pipelineRun.yaml index b29cf46..1794ace 100644 --- a/manifests/pipeline/pipelineRun.yaml +++ b/manifests/pipeline/pipelineRun.yaml @@ -2,35 +2,15 @@ apiVersion: tekton.dev/v1alpha1 kind: PipelineRun metadata: name: application-pipeline-run + namespace: tekton-pipeline-istio-project-1 spec: - serviceAccountName: tutorial-service + serviceAccountName: service-acc pipelineRef: name: application-pipeline resources: - - name: git-source + - name: git-master resourceRef: - name: git - params: - - name: pathToYamlFile - value: "deploy.yaml" - - name: pathToContext - value: "." - - name: imageUrl-a - value: "server-a" - - name: imageTag-a - value: "latest" - - name: pathToContext-a - value: "./serverA" - - name: imageUrl-b - value: "server-b" - - name: imageTag-b - value: "latest" - - name: pathToContext-b - value: "./serverB" - - name: imageUrl-c - value: "server-c" - - name: imageTag-c - value: "latest" - - name: pathToContext-c - value: "./serverC" - + name: git-master + - name: git-experimental + resourceRef: + name: git-experimental diff --git a/manifests/resources/cluster-role-binding.yaml b/manifests/resources/cluster-role-binding.yaml new file mode 100644 index 0000000..159019c --- /dev/null +++ b/manifests/resources/cluster-role-binding.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: allow-creation-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: allow-creation +subjects: + - kind: ServiceAccount + name: service-acc + namespace: tekton-pipeline-istio-project-1 \ No newline at end of file diff --git a/manifests/resources/cluster-role.yaml b/manifests/resources/cluster-role.yaml new file mode 100644 index 0000000..75caf6d --- /dev/null +++ b/manifests/resources/cluster-role.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: allow-creation +rules: + - apiGroups: + - "" + - "apps" + - "deploy" + - "networking.istio.io" + resources: + - pods + - serviceaccounts + - namespaces + - services + - deployments + - deployments.apps + - destinationrules + - gateways + - virtualservices + verbs: + - list + - watch + - get + - create + - update + - patch + - delete \ No newline at end of file diff --git a/manifests/triggers/webhook-run.yaml b/manifests/resources/create-repo-webhook.yaml similarity index 66% rename from manifests/triggers/webhook-run.yaml rename to manifests/resources/create-repo-webhook.yaml index 5ec3839..7a059a4 100644 --- a/manifests/triggers/webhook-run.yaml +++ b/manifests/resources/create-repo-webhook.yaml @@ -1,7 +1,10 @@ +--- +# https://medium.com/@nikhilthomas1/cloud-native-cicd-on-openshift-with-openshift-pipelines-tektoncd-pipelines-part-3-github-1db6dd8e8ca7 apiVersion: tekton.dev/v1alpha1 kind: TaskRun metadata: - name: create-webhook-run + name: create-repo-webhook + namespace: tekton-pipeline-istio-project-1 spec: taskRef: name: create-webhook @@ -22,4 +25,4 @@ spec: - name: ExternalDomain value: 35.233.93.220 timeout: 1000s - serviceAccountName: tekton-triggers-createwebhook \ No newline at end of file + serviceAccount: tekton-triggers-createwebhook \ No newline at end of file diff --git a/manifests/triggers/create-webhook.yaml b/manifests/resources/create-webhook.yaml similarity index 64% rename from manifests/triggers/create-webhook.yaml rename to manifests/resources/create-webhook.yaml index 68e8a9e..157f2d0 100644 --- a/manifests/triggers/create-webhook.yaml +++ b/manifests/resources/create-webhook.yaml @@ -1,7 +1,9 @@ +--- apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: create-webhook + namespace: tekton-pipeline-istio-project-1 spec: volumes: - name: github-secret @@ -43,7 +45,7 @@ spec: set -e echo "Create Webhook" if [ $(inputs.params.GitHubDomain) = "github.com" ];then - curl -v -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"https://$(inputs.params.ExternalDomain)\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://api.github.com/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + curl -v -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://api.github.com/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks else - curl -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"https://$(inputs.params.ExternalDomain)/\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://$(inputs.params.GitHubDomain)/api/v3/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks + curl -d "{\"name\": \"web\",\"active\": true,\"events\": $(inputs.params.WebhookEvents),\"config\": {\"url\": \"$(inputs.params.ExternalDomain)/\",\"content_type\": \"json\",\"insecure_ssl\": \"1\" ,\"secret\": \"$(cat /var/secret/$(inputs.params.GitHubSecretStringKey))\"}}" -X POST -u $(inputs.params.GitHubUser):$(cat /var/secret/$(inputs.params.GitHubAccessTokenKey)) -L https://$(inputs.params.GitHubDomain)/api/v3/repos/$(inputs.params.GitHubOrg)/$(inputs.params.GitHubRepo)/hooks fi \ No newline at end of file diff --git a/manifests/resources/git.yaml b/manifests/resources/git.yaml index 221303f..beb5866 100644 --- a/manifests/resources/git.yaml +++ b/manifests/resources/git.yaml @@ -2,12 +2,25 @@ apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: - name: git + name: git-master namespace: tekton-pipeline-istio-project-1 spec: type: git params: - name: revision value: master + - name: url + value: git://github.com/beppevanrolleghem/cicdTest +--- +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: git-experimental + namespace: tekton-pipeline-istio-project-1 +spec: + type: git + params: + - name: revision + value: experimental - name: url value: git://github.com/beppevanrolleghem/cicdTest \ No newline at end of file diff --git a/manifests/pipeline/serviceAcc.yaml b/manifests/resources/service-account.yaml similarity index 53% rename from manifests/pipeline/serviceAcc.yaml rename to manifests/resources/service-account.yaml index dbd47e0..bb26e12 100644 --- a/manifests/pipeline/serviceAcc.yaml +++ b/manifests/resources/service-account.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: tutorial-service + name: service-acc + namespace: tekton-pipeline-istio-project-1 secrets: - name: regcred \ No newline at end of file diff --git a/manifests/tasks/build-and-push.yaml b/manifests/tasks/build-and-push.yaml index a5f354b..d9a64da 100644 --- a/manifests/tasks/build-and-push.yaml +++ b/manifests/tasks/build-and-push.yaml @@ -3,22 +3,20 @@ apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: build-and-push + namespace: tekton-pipeline-istio-project-1 spec: inputs: resources: - name: git-source type: git params: - - name: pathToContext + - name: context description: The path to the build context, used by Kaniko - within the workspace default: . - - name: pathToDockerfile - description: The path to the dockerfile to build - default: Dockerfile - - name: imageUrl - description: value should be like - us.icr.io/test_namespace/builtImageApp - - name: imageTag - description: Tag to apply to the built image + - name: image-name + description: dockerhub url + - name: version + description: image-version (for instance latest or beta) steps: - name: build-and-push image: gcr.io/kaniko-project/executor @@ -28,6 +26,6 @@ spec: command: - /kaniko/executor args: - - "--dockerfile=dockerfile" - - "--destination=beppev/$(inputs.params.imageUrl):$(inputs.params.imageTag)" - - "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/" + - "--dockerfile=$(inputs.resources.git-source.path)/$(inputs.params.context)/dockerfile" + - "--destination=beppev/$(inputs.params.image-name):$(inputs.params.version)" + - "--context=$(inputs.resources.git-source.path)/$(inputs.params.context)/" \ No newline at end of file diff --git a/manifests/tasks/deploy-application.yaml b/manifests/tasks/deploy-application.yaml index 3e2f055..5a37ec5 100644 --- a/manifests/tasks/deploy-application.yaml +++ b/manifests/tasks/deploy-application.yaml @@ -3,51 +3,24 @@ apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: deploy-application + namespace: tekton-pipeline-istio-project-1 spec: inputs: resources: - name: git-source type: git - params: - - name: pathToContext - description: The path to the build context, used by Kaniko - within the workspace - default: . - - name: pathToYamlFile - description: The path to the yaml file to deploy within the git source - default: deploy.yaml - - name: imageUrl-a - description: Url of image repository - default: url - - name: imageTag-a - description: Tag of the images to be used. - default: "latest" - - name: imageUrl-b - description: Url of image repository - default: url - - name: imageTag-b - description: Tag of the images to be used. - default: "latest" steps: - - name: replace-imagea - image: alpine - command: ["sed"] + - name: delete-old-deployment + image: lachlanevenson/k8s-kubectl + command: ["kubectl"] args: - - "-i" - - "-e" - - "s;IMAGE-A;$(inputs.params.imageUrl-a):$(inputs.params.imageTag-a);g" - - "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)" - - name: replace-imageb - image: alpine - command: ["sed"] - args: - - "-i" - - "-e" - - "s;IMAGE-b;$(inputs.params.imageUrl-b):$(inputs.params.imageTag-b);g" - - "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)" - - name: deploy-app + - "delete" + - "-f" + - "$(inputs.resources.git-source.path)/deploy.yaml" + - name: deploy-new-app image: lachlanevenson/k8s-kubectl command: ["kubectl"] args: - "apply" - "-f" - - "$(inputs.resources.git-source.path)/deploy.yaml" + - "$(inputs.resources.git-source.path)/deploy.yaml" \ No newline at end of file diff --git a/manifests/tasks/test-run.yaml b/manifests/tasks/test-run.yaml deleted file mode 100644 index ce1fc2b..0000000 --- a/manifests/tasks/test-run.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: test-run -spec: - serviceAccountName: tutorial-service - taskRef: - name: build-and-push - inputs: - resources: - - name: git-source - resourceRef: - name: git - params: - - name: pathToContext - value: /serverA/ #configure: may change according to your source - - name: imageUrl - value: "server-a" - - name: imageTag - value: "latest" diff --git a/manifests/triggers/create-ingress-run.yaml b/manifests/triggers/create-ingress-run.yaml deleted file mode 100644 index df4df74..0000000 --- a/manifests/triggers/create-ingress-run.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: create-ingress-run -spec: - taskRef: - name: create-ingress - inputs: - params: - - name: CreateCertificate - value: "true" - - name: CertificateKeyPassphrase - value: asecretphrase - - name: CertificateSecretName - value: ingresssecret - - name: ExternalDomain - value: 35.233.93.220 - - name: Service - value: getting-started - - name: ServicePort - value: "443" - timeout: 1000s - serviceAccountName: tekton-triggers-createwebhook \ No newline at end of file diff --git a/manifests/triggers/create-ingress.yaml b/manifests/triggers/create-ingress.yaml deleted file mode 100644 index 035bd6e..0000000 --- a/manifests/triggers/create-ingress.yaml +++ /dev/null @@ -1,120 +0,0 @@ -apiVersion: tekton.dev/v1alpha1 -kind: Task -metadata: - name: create-ingress -spec: - volumes: - - name: work - emptyDir: {} - - inputs: - params: - - name: CreateCertificate - description: "Enables/disables the creation of a self-signed certificate for $(inputs.params.ExternalDomain)" - default: "true" - - name: CertificateKeyPassphrase - description: "Phrase that protects private key. This must be provided when the self-signed certificate is created" - - name: CertificateSecretName - description: "Secret name for Ingress certificate. The Secret should not exist if the self-signed certificate creation is enabled" - - name: ExternalDomain - description: "The external domain for the EventListener e.g. `$(inputs.params.EventListenerName).PROXYIP.nip.io`" - - name: Service - description: "The name of the Service used in the Ingress. This will also be the name of the Ingress." - - name: ServicePort - description: "The service port that the ingress is being created on" - - name: ServiceUID - description: "The uid of the service. If set, this creates an owner reference on the service" - default: "" - - steps: - - name: generate-certificate - image: frapsoft/openssl - volumeMounts: - - name: work - mountPath: /var/tmp/work - command: - - sh - args: - - -ce - - | - set -e - cat <