This is a living document and is to be expanded. As of its initial writing, this document's main goal is to create a home for intructions pertaining to building and running the project.
All pull requests must be made from forks enabled on CircleCI, so that unit and acceptance tests can be executed prior to code being merged.
Changelog descriptions should be in the present tense, such as 'Fix a bug that made everything explode' or 'Add a magical new feature'.
You'll need to enable your fork in CircleCI (under Add Projects
).
You'll also need to enable build processing.
Finally, add an environment variable GITHUB_TOKEN
to the CircleCI project to allow integration_init
to complete successfully.
This token requires no permissions and is used to avoid GitHub request ratelimits.
You can generate one here.
The following tools must be installed before the project can be built. The specified version are recommended.
yarn
version 1.12node
version 8.11go
version 1.13dep
version 0.5 (https://github.com/golang/dep#installation)
Run the following commands before building ship for the first time:
./hack/get_build_deps.sh
make deps
To build ship executable, run
make bin/ship
To rebuild everything, including tests, run
make build
To run locally-built copy of ship, use
./bin/ship init <chart-path>
for example,
./bin/ship init github.com/helm/charts/stable/nginx-ingress
Tests make extensive use of mocks.
To add mocks for new types, the type needs to be added to the mockgen
target in the make file.
The following command will generate new mocks and update existing ones:
make mockgen
A webpack development server can be started for iterating on the ui with the following command:
make -C web serve_ship
The go binary serves the UI on localhost:8800
, the webpack dev server will serve on localhost:8880
.
On rare occasions, node modules may need to be refreshed.
If make build
results in an error of the following flavor:
...
make[1]: *** [.state/build_ship] Error 2
make: *** [build-ui] Error 2
and/or if make -C web serve_ship
gives results in a Failed to compile
error, the following commands should get everything back up and running.
From the root of the project:
cd web
rm -rf node_modules
yarn