diff --git a/Dispatchfile.cue b/Dispatchfile similarity index 61% rename from Dispatchfile.cue rename to Dispatchfile index 2e72b29..76dc8c2 100644 --- a/Dispatchfile.cue +++ b/Dispatchfile @@ -4,14 +4,9 @@ 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": { type: "image" - param url: "mesosphere/devx-dispatch-demo" + param url: "chhsiao/devx-dispatch-demo" } task "unit-test": { @@ -37,19 +32,29 @@ task "build-image": { outputs: ["docker-image"] deps: ["unit-test"] steps: [ + { + name: "find" + image: "alpine" + command: ["find", "/tekton/home"] + }, + { + name: "see-creds" + image: "alpine" + command: ["cat", "/tekton/home/.docker/config.json"] + }, { name: "build-and-push" image: "gcr.io/kaniko-project/executor" args: [ - "--destination=$(outputs.resources.docker-image.url)", + "--destination=$(outputs.resources.docker-image.url):$(context.build.name)", "--context=/workspace/src-repo", - "--oci-layout-path=/builder/home/image-outputs/docker-image", + "--oci-layout-path=/workspace/output/docker-image", "--dockerfile=/workspace/src-repo/Dockerfile" - ], + ] env: [ { name: "DOCKER_CONFIG" - value: "/builder/home/.docker" + value: "/tekton/home/.docker" } ] } @@ -73,33 +78,15 @@ task "integration-test": { ] } -task "deploy": { - inputs: ["docker-image", "gitops-repo"] - deps: ["integration-test"] - steps: [ - { - name: "update-gitops-repo" - image: "mesosphere/update-gitops-repo:v1.0" - workingDir: "/workspace/gitops-repo" - args: [ - "-git-revision=$(context.git.commit)", - "-substitute=imageName=$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)" - ] - } - ] -} - actions: [ - { - tasks: ["deploy"] - on push: { - branches: ["master"] - } - }, { tasks: ["integration-test"] on pull_request: { chatops: ["test"] } + }, + { + tasks: ["integration-test"] + on pull_request: {} } ] diff --git a/main.go b/main.go index ff4ac1e..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, "Yes Dispatch is cool!\n") + fmt.Fprintf(w, "Hello, Dispatch\n") } // [END all]