From 5703edabea180951baa64399578296e73877f8af Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 18 Sep 2020 15:14:35 -0400 Subject: [PATCH 1/3] document how to disable buildpacks auto-sync --- .../en/docs/pipeline-stages/filesync.md | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/pipeline-stages/filesync.md b/docs/content/en/docs/pipeline-stages/filesync.md index 4f2fe7618fd..eafb7defe87 100644 --- a/docs/content/en/docs/pipeline-stages/filesync.md +++ b/docs/content/en/docs/pipeline-stages/filesync.md @@ -84,8 +84,36 @@ result in a complete rebuild. #### Buildpacks Skaffold requires special collaboration from the Buildpacks for the `auto` sync to work. -The [gcr.io/buildpacks/builder:v1](https://github.com/GoogleCloudPlatform/buildpacks) supports Skaffold -out of the box, currently for Go, NodeJS, and Java. +The GCP Buildpacks builder [gcr.io/buildpacks/builder:v1](https://github.com/GoogleCloudPlatform/buildpacks) +supports Skaffold syncing out of the box, currently for Go, NodeJS, and Java. +Auto sync is now enabled by default. + +Skaffold will automatically sync and relaunch applications for the following file types: + +- Go: *.go +- Java: *.java, *.kt, *.scala, *.groovy, *.clj +- NodeJS: *.js, *.mjs, *.coffee, *.litcoffee, *.json + +Changes to other file types trigger an image rebuild. + +##### Disable Auto Sync for Buildpacks + +To disable auto sync, provide a manual sync rule; this sync rule can reference a file +that does not exist. For example: + +``` +artifacts: +- image: xxx + buildpacks: + builder: gcr.io/buildpacks/builder:v1 + # disable buildpacks auto-sync + sync: + manual: + - src: . + dest: . +``` + +##### How it works Cloud Native Buildpacks set a `io.buildpacks.build.metadata` label on the images they create. This labels points to json description of the [Bill-of-Materials, aka BOM](https://github.com/buildpacks/spec/blob/master/buildpack.md#bill-of-materials-toml) of the build. From d7f8a4f0c792e4b4746dd9c0b48799fd1fa290f7 Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 18 Sep 2020 16:08:09 -0400 Subject: [PATCH 2/3] revise --- .../en/docs/pipeline-stages/filesync.md | 23 +++++++++++-------- examples/buildpacks/skaffold.yaml | 1 + 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/content/en/docs/pipeline-stages/filesync.md b/docs/content/en/docs/pipeline-stages/filesync.md index eafb7defe87..aea5f91c5ea 100644 --- a/docs/content/en/docs/pipeline-stages/filesync.md +++ b/docs/content/en/docs/pipeline-stages/filesync.md @@ -78,28 +78,29 @@ File deletion will always cause a complete rebuild. ### Auto sync mode -In auto sync mode, Skaffold automatically generates sync rules for known file types. Changes to other file types will -result in a complete rebuild. +In auto sync mode, Skaffold automatically generates sync rules for known file types. +Changes to other file types will result in a complete rebuild. #### Buildpacks -Skaffold requires special collaboration from the Buildpacks for the `auto` sync to work. -The GCP Buildpacks builder [gcr.io/buildpacks/builder:v1](https://github.com/GoogleCloudPlatform/buildpacks) -supports Skaffold syncing out of the box, currently for Go, NodeJS, and Java. -Auto sync is now enabled by default. - -Skaffold will automatically sync and relaunch applications for the following file types: +Skaffold works with Cloud Native Buildpacks builders to automatically sync and relaunch +applications on changes to certain types of files. +The GCP Buildpacks builder ([gcr.io/buildpacks/builder:v1](https://github.com/GoogleCloudPlatform/buildpacks)) +supports syncing the following types of source files: - Go: *.go - Java: *.java, *.kt, *.scala, *.groovy, *.clj - NodeJS: *.js, *.mjs, *.coffee, *.litcoffee, *.json +The GCP Buildpacks builder will detect the changed files and +automatically rebuild and relaunch the application. Changes to other file types trigger an image rebuild. ##### Disable Auto Sync for Buildpacks -To disable auto sync, provide a manual sync rule; this sync rule can reference a file -that does not exist. For example: +To disable auto sync, simply provide a manual sync rule. It does +not matter if the sync rule does not match any actual files. +For example: ``` artifacts: @@ -115,6 +116,8 @@ artifacts: ##### How it works +Skaffold requires special collaboration from buildpacks for the `auto` sync to work. + Cloud Native Buildpacks set a `io.buildpacks.build.metadata` label on the images they create. This labels points to json description of the [Bill-of-Materials, aka BOM](https://github.com/buildpacks/spec/blob/master/buildpack.md#bill-of-materials-toml) of the build. In the BOM, under the `metadata.devmode.sync` key, Buildpacks that want to collaborate with Skaffold diff --git a/examples/buildpacks/skaffold.yaml b/examples/buildpacks/skaffold.yaml index f5ee9475dee..3b10ff1f8ba 100644 --- a/examples/buildpacks/skaffold.yaml +++ b/examples/buildpacks/skaffold.yaml @@ -7,6 +7,7 @@ build: builder: "gcr.io/buildpacks/builder:v1" env: - GOPROXY={{.GOPROXY}} + sync: {manual:[{src: ".", dest: "."}]} profiles: - name: gcb build: From c66f37dba6729bdb798e1d065736f725e994c753 Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 18 Sep 2020 16:09:02 -0400 Subject: [PATCH 3/3] revert mistaken skaffold.yaml change --- examples/buildpacks/skaffold.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/buildpacks/skaffold.yaml b/examples/buildpacks/skaffold.yaml index 3b10ff1f8ba..f5ee9475dee 100644 --- a/examples/buildpacks/skaffold.yaml +++ b/examples/buildpacks/skaffold.yaml @@ -7,7 +7,6 @@ build: builder: "gcr.io/buildpacks/builder:v1" env: - GOPROXY={{.GOPROXY}} - sync: {manual:[{src: ".", dest: "."}]} profiles: - name: gcb build: