Skip to content

Commit

Permalink
init docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 committed Nov 1, 2019
1 parent 78e4b4a commit b0d98b1
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/content/en/docs/pipeline-stages/builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]({{<relref "docs/tutorials/buildpacks">}})

The `build` section in the Skaffold configuration file, `skaffold.yaml`,
controls how artifacts are built. To use a specific tool for building
Expand Down
6 changes: 4 additions & 2 deletions docs/content/en/docs/quickstart/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]({{<relref "/docs/tutorials/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]({{<relref "/docs/pipeline-stages" >}}), 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]({{<relref "/docs/pipeline-stages/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.

Expand Down
11 changes: 10 additions & 1 deletion docs/content/en/docs/tutorials/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <myrepo>`


: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:
: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" >}}) |
2 changes: 1 addition & 1 deletion docs/content/en/docs/tutorials/buildpacks.md
Original file line number Diff line number Diff line change
@@ -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/).
Expand Down
Original file line number Diff line number Diff line change
@@ -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`]({{<relref "docs/references/cli#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]({{<relref "docs/pipeline-stages/filesync" >}}) for file dependencies
that do not need a rebuild.

If your project contain resources other than services, you can set-up [port-forwarding]({{<relref "docs/pipeline-stages/port-forwarding" >}})
to port-forward these resources in [`dev`]({{<relref "docs/workflows/dev" >}}) or [`debug`]({{<relref "docs/workflows/debug" >}}) mode.

## Build Config Initialization
`skaffold init` currently supports build detection for two builders.

1. [Docker]({{<relref "/docs/pipeline-stages/builders#dockerfile-locally-with-docker">}})
2. [Jib]({{<relref "/docs/pipeline-stages/builders#jib-maven-and-gradle-locally">}})

`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 <code>None (image not built from these sources)</code> in case none of the suggested
options are correct. <br>
You will have to manually set up build config for this artifact
{{</alert>}}

`skaffold` init also recognizes a maven or gradle project and will auto-suggest [`jib`]({{<relref "/docs/pipeline-stages/builders#jib-maven-and-gradle-locally">}}) 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]({{<relref "/docs/pipeline-stages/deployers#deploying-with-kubectl" >}})
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
```

0 comments on commit b0d98b1

Please sign in to comment.