From e7b1033e4ea057e4d92febea46f35b2e5e979427 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Mon, 23 Dec 2019 20:50:27 -0800 Subject: [PATCH 01/26] Pushed image to GCR. --- Dispatchfile.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index 2e72b29..04807df 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -11,7 +11,7 @@ resource "gitops-repo": { resource "docker-image": { type: "image" - param url: "mesosphere/devx-dispatch-demo" + param url: "gcr.io/massive-bliss-781/devx-dispatch-demo" } task "unit-test": { From d8a37e45894570a1445d8eea398dcd4051c62d7e Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Thu, 26 Dec 2019 16:44:39 -0800 Subject: [PATCH 02/26] Deployed via Google Cloud Run. --- Dispatchfile.cue | 73 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index 04807df..f927946 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -4,12 +4,7 @@ resource "src-repo": { param revision: "$(context.git.commit)" } -resource "gitops-repo": { - type: "git" - param url: "https://github.com/mesosphere/devx-dispatch-gitops-demo" -} - -resource "docker-image": { +resource "gcr-image": { type: "image" param url: "gcr.io/massive-bliss-781/devx-dispatch-demo" } @@ -34,34 +29,44 @@ task "unit-test": { task "build-image": { inputs: ["src-repo"] - outputs: ["docker-image"] + outputs: ["gcr-image"] deps: ["unit-test"] steps: [ { name: "build-and-push" image: "gcr.io/kaniko-project/executor" args: [ - "--destination=$(outputs.resources.docker-image.url)", + "--destination=$(outputs.resources.gcr-image.url)", "--context=/workspace/src-repo", - "--oci-layout-path=/builder/home/image-outputs/docker-image", - "--dockerfile=/workspace/src-repo/Dockerfile" - ], + "--oci-layout-path=/builder/home/image-outputs/gcr-image", + "--dockerfile=/workspace/src-repo/Dockerfile", + "--cache=true", + "--cache-ttl=10h" + ] env: [ { - name: "DOCKER_CONFIG" - value: "/builder/home/.docker" + name: "GOOGLE_APPLICATION_CREDENTIALS" + value: "/builder/volumes/gcloud-auth/key.json" } ] } ] + volumes: [ + { + name: "gcloud-auth" + secret: { + secretName: "chhsiao-gcloud-auth" + } + } + ] } task "integration-test": { - inputs: ["docker-image"] + inputs: ["gcr-image"] steps:[ { name: "run-test" - image: "$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)" + image: "$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)" command: ["/hello-app.test"] env: [ { @@ -74,17 +79,41 @@ task "integration-test": { } task "deploy": { - inputs: ["docker-image", "gitops-repo"] + inputs: ["gcr-image"] deps: ["integration-test"] steps: [ { - name: "update-gitops-repo" - image: "mesosphere/update-gitops-repo:v1.0" - workingDir: "/workspace/gitops-repo" + name: "gcloud-auth-sa" + image: "gcr.io/cloud-builders/gcloud" args: [ - "-git-revision=$(context.git.commit)", - "-substitute=imageName=$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)" + "auth", + "activate-service-account", + "chhsiao-onprem-sa@massive-bliss-781.iam.gserviceaccount.com", + "--key-file=/builder/volumes/gcloud-auth/key.json", + "--quiet" ] + }, + { + name: "gcloud-run" + image: "gcr.io/cloud-builders/gcloud" + args: [ + "run", + "deploy", + "devx-dispatch-demo", + "--project=massive-bliss-781", + "--image=gcr.io/massive-bliss-781/devx-dispatch-demo", + "--region=us-central1", + "--platform=managed", + "--quiet" + ] + } + ] + volumes: [ + { + name: "gcloud-auth" + secret: { + secretName: "chhsiao-gcloud-auth" + } } ] } @@ -93,7 +122,7 @@ actions: [ { tasks: ["deploy"] on push: { - branches: ["master"] + branches: ["gcloud"] } }, { From deeeb4561c7c5fc410ca8131a8ff1c5a5774d330 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Thu, 26 Dec 2019 17:00:44 -0800 Subject: [PATCH 03/26] Run CI when creating PRs. --- Dispatchfile.cue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index f927946..cd39763 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -127,8 +127,6 @@ actions: [ }, { tasks: ["integration-test"] - on pull_request: { - chatops: ["test"] - } + on pull_request: {} } ] From cdf2dd275999643c4cdb7ef0c71eb904bd145b47 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Thu, 26 Dec 2019 17:09:10 -0800 Subject: [PATCH 04/26] Updated the service account name. --- Dispatchfile.cue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index cd39763..a4794f1 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -55,7 +55,7 @@ task "build-image": { { name: "gcloud-auth" secret: { - secretName: "chhsiao-gcloud-auth" + secretName: "devx-gcloud-auth" } } ] @@ -88,7 +88,7 @@ task "deploy": { args: [ "auth", "activate-service-account", - "chhsiao-onprem-sa@massive-bliss-781.iam.gserviceaccount.com", + "devx-onprem-sa@massive-bliss-781.iam.gserviceaccount.com", "--key-file=/builder/volumes/gcloud-auth/key.json", "--quiet" ] @@ -112,7 +112,7 @@ task "deploy": { { name: "gcloud-auth" secret: { - secretName: "chhsiao-gcloud-auth" + secretName: "devx-gcloud-auth" } } ] From 4816dccb309b512691e3367afa8c97b070546398 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Thu, 26 Dec 2019 16:57:54 -0800 Subject: [PATCH 05/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index ff4ac1e..9d755b7 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Yes Dispatch is cool!\n") + fmt.Fprintf(w, "Welcome to Dispatch!\n") } // [END all] From 1f7b7a88e3fbdd61fb4a12457f274e573b219ac3 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Thu, 26 Dec 2019 18:14:02 -0800 Subject: [PATCH 06/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9d755b7..8cd414d 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Welcome to Dispatch!\n") + fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") } // [END all] From 04c0182d3f13aaf86ca5f6a76c780c64e14f518e Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 27 Dec 2019 11:28:59 -0800 Subject: [PATCH 07/26] Added build name as image tag. --- Dispatchfile.cue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index a4794f1..e6df154 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -36,7 +36,7 @@ task "build-image": { name: "build-and-push" image: "gcr.io/kaniko-project/executor" args: [ - "--destination=$(outputs.resources.gcr-image.url)", + "--destination=$(outputs.resources.gcr-image.url):$(context.build.name)", "--context=/workspace/src-repo", "--oci-layout-path=/builder/home/image-outputs/gcr-image", "--dockerfile=/workspace/src-repo/Dockerfile", @@ -88,7 +88,7 @@ task "deploy": { args: [ "auth", "activate-service-account", - "devx-onprem-sa@massive-bliss-781.iam.gserviceaccount.com", + "devx-dispatch-demo@massive-bliss-781.iam.gserviceaccount.com", "--key-file=/builder/volumes/gcloud-auth/key.json", "--quiet" ] From dbba6cd19962a4f1769d77f2963ea6359413a535 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 27 Dec 2019 11:52:57 -0800 Subject: [PATCH 08/26] Added digest to deploy. --- Dispatchfile.cue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index e6df154..f7492ad 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -88,7 +88,6 @@ task "deploy": { args: [ "auth", "activate-service-account", - "devx-dispatch-demo@massive-bliss-781.iam.gserviceaccount.com", "--key-file=/builder/volumes/gcloud-auth/key.json", "--quiet" ] @@ -101,7 +100,7 @@ task "deploy": { "deploy", "devx-dispatch-demo", "--project=massive-bliss-781", - "--image=gcr.io/massive-bliss-781/devx-dispatch-demo", + "--image=$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)" "--region=us-central1", "--platform=managed", "--quiet" From af0cd0d2021ae354ecb5526d046f1795f8d3c53c Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 27 Dec 2019 11:55:30 -0800 Subject: [PATCH 09/26] Fixed dispatchfile.cue. --- Dispatchfile.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dispatchfile.cue b/Dispatchfile.cue index f7492ad..6893d59 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile.cue @@ -100,7 +100,7 @@ task "deploy": { "deploy", "devx-dispatch-demo", "--project=massive-bliss-781", - "--image=$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)" + "--image=$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)", "--region=us-central1", "--platform=managed", "--quiet" From de9884a434e787570f29c64a15ba40de85ef1a7b Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Fri, 27 Dec 2019 15:31:45 -0800 Subject: [PATCH 10/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 8cd414d..9c13784 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") + fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") } // [END all] From 2a9b0422bc47633bdf16c55fd052deaf570d26bd Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Fri, 27 Dec 2019 15:40:17 -0800 Subject: [PATCH 11/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9c13784..8cd414d 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") + fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") } // [END all] From 47c2d8f2fc24d3dc9509174b51ef93c5e91358fb Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Fri, 27 Dec 2019 15:50:53 -0800 Subject: [PATCH 12/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 8cd414d..9c13784 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") + fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") } // [END all] From 8ef4b0cde68ca118304d7038ceaf261576783771 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Fri, 27 Dec 2019 15:55:41 -0800 Subject: [PATCH 13/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9c13784..8cd414d 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") + fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") } // [END all] From edefd7af5f2c8727c42ec92fb4b34b4656849c44 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Fri, 27 Dec 2019 15:57:46 -0800 Subject: [PATCH 14/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 8cd414d..9c13784 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Welcome to Dispatch Demo!\n") + fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") } // [END all] From 33c385c40f2daf4783e690ff0bc25b2edc4fce64 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Thu, 9 Jan 2020 14:12:42 -0800 Subject: [PATCH 15/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9c13784..9727084 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") + fmt.Fprintf(w, "This is a Dispatch demo.\n") } // [END all] From 774fbe27d4430185f40d9f89e8da1d75504760be Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Thu, 9 Jan 2020 15:25:16 -0800 Subject: [PATCH 16/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9727084..4db3179 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "This is a Dispatch demo.\n") + fmt.Fprintf(w, "This is a Dispatch demo!\n") } // [END all] From bf58e50dab6fc5231872cecb3d6b39a4422b8162 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Thu, 9 Jan 2020 16:50:32 -0800 Subject: [PATCH 17/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 4db3179..9c13784 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "This is a Dispatch demo!\n") + fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") } // [END all] From 4dc2e14061827a499ad1219f46ccb0f4d7b25f19 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Wed, 12 Feb 2020 20:11:24 -0800 Subject: [PATCH 18/26] Rename Dispatchfile.cue to Dispatchfile --- Dispatchfile.cue => Dispatchfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dispatchfile.cue => Dispatchfile (100%) diff --git a/Dispatchfile.cue b/Dispatchfile similarity index 100% rename from Dispatchfile.cue rename to Dispatchfile From c6494d03e955a489f577ceaee95e435d3f688847 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Wed, 12 Feb 2020 21:27:48 -0800 Subject: [PATCH 19/26] Update Dispatchfile --- Dispatchfile | 73 +++++++--------------------------------------------- 1 file changed, 10 insertions(+), 63 deletions(-) diff --git a/Dispatchfile b/Dispatchfile index 6893d59..c7ec6c0 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -4,9 +4,9 @@ resource "src-repo": { param revision: "$(context.git.commit)" } -resource "gcr-image": { +resource "docker-image": { type: "image" - param url: "gcr.io/massive-bliss-781/devx-dispatch-demo" + param url: "docker.io/chhsia0/devx-dispatch-demo" } task "unit-test": { @@ -29,44 +29,30 @@ task "unit-test": { task "build-image": { inputs: ["src-repo"] - outputs: ["gcr-image"] + outputs: ["docker-image"] deps: ["unit-test"] steps: [ { name: "build-and-push" image: "gcr.io/kaniko-project/executor" args: [ - "--destination=$(outputs.resources.gcr-image.url):$(context.build.name)", + "--destination=$(outputs.resources.docker-image.url):$(context.build.name)", "--context=/workspace/src-repo", - "--oci-layout-path=/builder/home/image-outputs/gcr-image", + "--oci-layout-path=/workspace/output/docker-image", "--dockerfile=/workspace/src-repo/Dockerfile", "--cache=true", "--cache-ttl=10h" ] - env: [ - { - name: "GOOGLE_APPLICATION_CREDENTIALS" - value: "/builder/volumes/gcloud-auth/key.json" - } - ] - } - ] - volumes: [ - { - name: "gcloud-auth" - secret: { - secretName: "devx-gcloud-auth" - } } ] } task "integration-test": { - inputs: ["gcr-image"] + inputs: ["docker-image"] steps:[ { name: "run-test" - image: "$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)" + image: "$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)" command: ["/hello-app.test"] env: [ { @@ -78,50 +64,11 @@ task "integration-test": { ] } -task "deploy": { - inputs: ["gcr-image"] - deps: ["integration-test"] - steps: [ - { - name: "gcloud-auth-sa" - image: "gcr.io/cloud-builders/gcloud" - args: [ - "auth", - "activate-service-account", - "--key-file=/builder/volumes/gcloud-auth/key.json", - "--quiet" - ] - }, - { - name: "gcloud-run" - image: "gcr.io/cloud-builders/gcloud" - args: [ - "run", - "deploy", - "devx-dispatch-demo", - "--project=massive-bliss-781", - "--image=$(inputs.resources.gcr-image.url)@$(inputs.resources.gcr-image.digest)", - "--region=us-central1", - "--platform=managed", - "--quiet" - ] - } - ] - volumes: [ - { - name: "gcloud-auth" - secret: { - secretName: "devx-gcloud-auth" - } - } - ] -} - actions: [ { - tasks: ["deploy"] - on push: { - branches: ["gcloud"] + tasks: ["integration-test"] + on pull_request: { + chatops: ["test"] } }, { From d568fab94ee3f7446449b55394e907d69d440afc Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Wed, 12 Feb 2020 21:32:00 -0800 Subject: [PATCH 20/26] Update Dispatchfile --- Dispatchfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dispatchfile b/Dispatchfile index c7ec6c0..be604a8 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -6,7 +6,7 @@ resource "src-repo": { resource "docker-image": { type: "image" - param url: "docker.io/chhsia0/devx-dispatch-demo" + param url: "docker.io/chhsiao/devx-dispatch-demo" } task "unit-test": { From c315c9a1e216cee1a5d3bb4f9456aeae7511ecab Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Wed, 12 Feb 2020 22:05:06 -0800 Subject: [PATCH 21/26] Update Dispatchfile --- Dispatchfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dispatchfile b/Dispatchfile index be604a8..9c38568 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -39,9 +39,7 @@ task "build-image": { "--destination=$(outputs.resources.docker-image.url):$(context.build.name)", "--context=/workspace/src-repo", "--oci-layout-path=/workspace/output/docker-image", - "--dockerfile=/workspace/src-repo/Dockerfile", - "--cache=true", - "--cache-ttl=10h" + "--dockerfile=/workspace/src-repo/Dockerfile" ] } ] From cb5e97668391b1d7d04ee61301ea2c1d800e8f9a Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 28 Feb 2020 12:39:49 -0800 Subject: [PATCH 22/26] List creds. --- Dispatchfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dispatchfile b/Dispatchfile index 9c38568..0d80b84 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -32,6 +32,16 @@ task "build-image": { outputs: ["docker-image"] deps: ["unit-test"] steps: [ + { + name: "find" + image: "alpine" + command: ["find", "/home/builder"] + }, + { + name: "see-creds" + image: "alpine" + command: ["cat", "/home/builder/.docker/config.json"] + }, { name: "build-and-push" image: "gcr.io/kaniko-project/executor" From 8dc0c1be07caf1600bdbef35d62cfc2a9c9f03e8 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 28 Feb 2020 12:44:22 -0800 Subject: [PATCH 23/26] List creds. --- Dispatchfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dispatchfile b/Dispatchfile index 0d80b84..9f508a7 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -35,12 +35,12 @@ task "build-image": { { name: "find" image: "alpine" - command: ["find", "/home/builder"] + command: ["find", "/tekton/home"] }, { name: "see-creds" image: "alpine" - command: ["cat", "/home/builder/.docker/config.json"] + command: ["cat", "/tekton/home/.docker/config.json"] }, { name: "build-and-push" From c92a362ddcb7cd017dfb4b501102fcd1587a6c31 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 28 Feb 2020 12:48:56 -0800 Subject: [PATCH 24/26] dockerconfig env. --- Dispatchfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dispatchfile b/Dispatchfile index 9f508a7..1ed536c 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -51,6 +51,12 @@ task "build-image": { "--oci-layout-path=/workspace/output/docker-image", "--dockerfile=/workspace/src-repo/Dockerfile" ] + env: [ + { + name: "DOCKER_CONFIG" + value: "/tekton/home/.docker" + } + ] } ] } From d562ba10a036a73d11e496c52413404d9b88ebc1 Mon Sep 17 00:00:00 2001 From: chhsia0 Date: Fri, 28 Feb 2020 12:54:00 -0800 Subject: [PATCH 25/26] docker. --- Dispatchfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dispatchfile b/Dispatchfile index 1ed536c..76dc8c2 100644 --- a/Dispatchfile +++ b/Dispatchfile @@ -6,7 +6,7 @@ resource "src-repo": { resource "docker-image": { type: "image" - param url: "docker.io/chhsiao/devx-dispatch-demo" + param url: "chhsiao/devx-dispatch-demo" } task "unit-test": { From 2c88617511855b7b9c38eecb730f312e39f00be7 Mon Sep 17 00:00:00 2001 From: Chun-Hung Hsiao Date: Wed, 4 Nov 2020 21:09:46 -0800 Subject: [PATCH 26/26] Update main.go --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 9c13784..0a09c94 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,7 @@ func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!\n") fmt.Fprintf(w, "Version: %s\n", Version) fmt.Fprintf(w, "Build time: %s\n", Buildtime) - fmt.Fprintf(w, "Dispatch to Google Cloud Run!\n") + fmt.Fprintf(w, "Hello, Dispatch\n") } // [END all]