Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rolfe Dlugy-Hegwer <rolfedh@users.noreply.github.com>
  • Loading branch information
otaviof and rolfedh authored Jan 27, 2022
1 parent c454ef3 commit b705c33
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/local_source_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ Local Source Upload

The purpose of project Shipwright is to transform source code into container images, using known strategies to accomplish this task.

Now, with local source upload, we move Shipwright closer to the developer's inner loop, by allowing streaming local content to the Build Controller, running in a Kubernetes cluster, and creating a container image out of if. Users can try out Shipwright before submitting a pull-request, and rely on the cluster's computing power.
Now, with local source upload, we move Shipwright closer to the developer's inner loop. As a developer, you can use the local source upload feature to stream local content to a Build Controller running in a Kubernetes cluster and create a container image from it. This way, you can try out Shipwright before submitting a pull-request and use the cluster's computing power to build the image.

# Usage

The following steps represents the traditional workflow using local source upload:
To build an image by using the local source upload feature:

1. Create a Build or use a pre-existing one. On the Build resource we register the common settings, like the Build Strategy. For instance:
1. Create a Build or use a pre-existing one. Register the standard settings, such as the Build Strategy, on the Build resource. For example:

```bash
shp build create sample-nodejs \
--source-url="https://github.com/shipwright-io/sample-nodejs.git" \
--output-image="docker.io/<namespace>/sample-nodejs:latest"
```

2. Clone the repository, or use a pre-existing one. For instance:
2. Clone the repository or use a pre-existing one. For example:

```bash
git clone https://github.com/shipwright-io/sample-nodejs.git && \
cd sample-nodejs
```

3. Keep working on the project, when you're ready to build a new container image with the local changes, run:
3. Keep working on the project. When you're ready to build or rebuild a container image with the local changes, run:

```bash
shp build upload sample-nodejs --follow \
Expand All @@ -33,12 +33,14 @@ shp build upload sample-nodejs --follow \

4. Rinse and repeat the previous step

Notice we have a few placeholders delimited by `<>`, you should use a regular Container Registry where the Shipwright can push the images.
Notes:
* In the preceding examples, replace placeholders like `<namespace>` and `<tag>` with values from your cluster environment.
* For `--output-image`, you can specify any Container Registry that Shipwright supports.

# Streaming

The subcommand `build upload` creates a new `BuildRun` for the informed `Build`. The newly created BuildRun contains settings to instruct the Build Controller to wait for local user upload, instead of cloning the external repository as usual.
The subcommand `build upload` creates a new `BuildRun` for the informed `Build`. The newly created `BuildRun` contains settings to instruct the Build Controller to wait for the local user upload instead of cloning the external repository as usual.

The command-line interface will orchestrate the process of waiting the build POD for the BuildRun, and stream the informed directory, as soon as the POD is ready for it.
The command-line interface orchestrates the process of making the build Pod wait for the BuildRun, and streaming the specified directory when the Pod is ready for it.

Additionally, the data streamed to the cluster skips `.git` directory, when present, and likewise, skips the entries of`.gitignore` file.
The data streamed to the cluster skips the `.git` directory, if present, and any entries specified by the `.gitignore` file.

0 comments on commit b705c33

Please sign in to comment.