diff --git a/docs/content/en/docs/pipeline-stages/builders.md b/docs/content/en/docs/pipeline-stages/builders.md index 5c668c066db..3237210ee5d 100755 --- a/docs/content/en/docs/pipeline-stages/builders.md +++ b/docs/content/en/docs/pipeline-stages/builders.md @@ -15,7 +15,7 @@ Skaffold has native support for several different tools for building images: - on cloud with [Google Cloud Build](https://cloud.google.com/cloud-build/docs/) * [Bazel](https://bazel.build/) locally * Custom script locally -* [CNCF Buildpacks](../tutorials/buildpacks.md) +* [CNCF Buildpacks]({{}}) The `build` section in the Skaffold configuration file, `skaffold.yaml`, controls how artifacts are built. To use a specific tool for building diff --git a/docs/content/en/docs/quickstart/_index.md b/docs/content/en/docs/quickstart/_index.md index 37a9a296879..0c4f9b4c105 100644 --- a/docs/content/en/docs/quickstart/_index.md +++ b/docs/content/en/docs/quickstart/_index.md @@ -141,11 +141,13 @@ Skaffold will perform the workflow described in `skaffold.yaml` exactly once. ## What's next +For getting started with your project, see the [Getting Started With Your Project]({{}}) tutorial. + For more in-depth topics of Skaffold, explore [Configuration]({{< relref "/docs/design/config.md" >}}), -[Skaffold Pipeline](/docs/pipeline-stages), and [Architecture and Design]({{< relref "/docs/design" >}}). +[Skaffold Pipeline]({{}}), and [Architecture and Design]({{< relref "/docs/design" >}}). To learn more about how Skaffold builds, tags, and deploys your app, see the How-to Guides on -using [Builders](/docs/pipeline-stages/builders), [Taggers](/docs/pipeline-stages/taggers), and [Deployers]({{< relref "/docs/pipeline-stages/deployers" >}}). +using [Builders]({{}}), [Taggers]({{< relref "/docs/pipeline-stages/taggers">}}), and [Deployers]({{< relref "/docs/pipeline-stages/deployers" >}}). [Skaffold Tutorials]({{< relref "/docs/tutorials" >}}) details some of the common use cases of Skaffold. diff --git a/docs/content/en/docs/tutorials/_index.md b/docs/content/en/docs/tutorials/_index.md index 252d598781d..b936570e042 100755 --- a/docs/content/en/docs/tutorials/_index.md +++ b/docs/content/en/docs/tutorials/_index.md @@ -16,4 +16,13 @@ As we have gcr.io/k8s-skaffold in our image names, to run the examples, you have 1. skaffold config for current kubectl context: `skaffold config set default-repo ` -:mega: **Please fill out our [quick 5-question survey](https://forms.gle/BMTbGQXLWSdn7vEs6)** to tell us how satisfied you are with Skaffold, and what improvements we should make. Thank you! :dancers: \ No newline at end of file +:mega: **Please fill out our [quick 5-question survey](https://forms.gle/BMTbGQXLWSdn7vEs6)** to tell us how satisfied you are with Skaffold, and what improvements we should make. Thank you! :dancers: + + +## What's next +Take a look at our other guides + +| Tutorials References | +|----------| +| [Getting Started With Your Project]({{< relref "/docs/tutorials/getting-started-with-your-project" >}}) | +| [Custom Builder]({{< relref "/docs/tutorials/buildpacks" >}}) | diff --git a/docs/content/en/docs/tutorials/buildpacks.md b/docs/content/en/docs/tutorials/buildpacks.md index 04fb7314bb6..dddf43ace7b 100644 --- a/docs/content/en/docs/tutorials/buildpacks.md +++ b/docs/content/en/docs/tutorials/buildpacks.md @@ -1,7 +1,7 @@ --- title: "Building Artifacts with CNCF Buildpacks" linkTitle: "Buildpacks" -weight: 100 +weight: 110 --- This page describes building Skaffold artifacts with [buildpacks](https://buildpacks.io/). diff --git a/docs/content/en/docs/tutorials/getting-started-with-your-project.md b/docs/content/en/docs/tutorials/getting-started-with-your-project.md new file mode 100644 index 00000000000..8f0ca0ab73a --- /dev/null +++ b/docs/content/en/docs/tutorials/getting-started-with-your-project.md @@ -0,0 +1,78 @@ +--- +title: "Getting Started With Your Project" +linkTitle: "Getting Started With Your Project" +weight: 100 +--- + +To enable Skaffold for your application you can run [`skaffold init`]({{}}) + +Running `skaffold init` at the root of your project directory, will walk you through a wizard +and create a `skaffold.yaml` with [build](#build-config-initialization) and [deploy](#deploy-config-initialization) config. + +You can further set up [File Sync]({{}}) for file dependencies +that do not need a rebuild. + +If your project contain resources other than services, you can set-up [port-forwarding]({{}}) +to port-forward these resources in [`dev`]({{}}) or [`debug`]({{}}) mode. + +## Build Config Initialization +`skaffold init` currently supports build detection for two builders. + +1. [Docker]({{}}) +2. [Jib]({{}}) + +`skaffold init` will walk your project directory and look for any `Dockerfiles` +or `build.gradle/pom.xml`. + +If you have multiple `Dockerfile` or `build.gradle/pom.xml` files, Skaffold will provide an option +to pair an image with one of the file. + +E.g.: For a multi-services [microservices example](https://github.com/GoogleContainerTools/skaffold/tree/master/examples/microservices) +```bash +skaffold init +? Choose the builder to build image gcr.io/k8s-skaffold/leeroy-app [Use arrows to move, space to select, type to filter] +> Docker (leeroy-app/Dockerfile) + Docker (leeroy-web/Dockerfile) + None (image not built from these sources) + +``` + + +{{< alert title="Note" >}} +You can choose None (image not built from these sources) in case none of the suggested +options are correct.
+You will have to manually set up build config for this artifact +{{}} + +`skaffold` init also recognizes a maven or gradle project and will auto-suggest [`jib`]({{}}) builder. +Currently `jib` artifact detection is disabled by default, you can turn it on using the flag `--XXenableJibInit`. + +You can try it this out on example [jib project](https://github.com/GoogleContainerTools/skaffold/tree/master/examples/jib-multimodule) +```bash +$cd examples/jib-multimodule +$skaffold init --XXenableJibInit +? Choose the builder to build image gcr.io/k8s-skaffold/skaffold-jib-1 [Use arrows to move, space to select, type to filter] +> Jib Maven Plugin (skaffold-project-1, pom.xml) + Jib Maven Plugin (skaffold-project-2, pom.xml) + None (image not built from these sources) +``` + + +In case you want to configure build artifacts on your own, use `--skip-build` flag. + +## Deploy Config Initialization +`skaffold init` currently supports only [`Kubeclt` deployer]({{}}) +Skaffold will walk through all the `yaml` files in your project and find valid kubernetes manifest files. + +These files will be added to `deploy` config in `skaffold.yaml`. + +```yaml +deploy: + kubectl: + manifests: + - leeroy-app/kubernetes/deployment.yaml + - leeroy-web/kubernetes/deployment.yaml +``` + + +