You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 25, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+27-2Lines changed: 27 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,31 @@ please read the [code of conduct](CODE_OF_CONDUCT.md).
11
11
12
12
### Tests
13
13
14
-
We have a set of automated tests in [./tests](./tests). These are [bats](https://github.com/bats-core/bats-core) tests that we use to make assertions not only on the correct functioning of our bash/shell scripts, but also of the software provided by our Docker image. Any fix or feature should be accompanied by a set of tests to validate that those changes work as expected. For an overview on how [bats works see here](https://bats-core.readthedocs.io/en/stable/).
14
+
For testing the Docker Image we use Googles [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test). Those tests are used to test the metadata, filesystem or installed binaries of the image.
15
+
16
+
#### Installing Container Structure Tests
17
+
18
+
To install the container tests we recommend doing so by using a package manger like brew:
19
+
20
+
```
21
+
brew install container-structure-tests
22
+
```
23
+
24
+
#### Running Container Structure Tests
25
+
26
+
To run the container structure tests you need to run the following command.
27
+
28
+
```bash
29
+
container-structure-test test --image netlify/build:focal --config focal.yaml
30
+
```
31
+
32
+
For further install instructions please visit the [official installation guide](https://github.com/GoogleContainerTools/container-structure-test#installation).
33
+
34
+
### Testing dynamic Versions
35
+
36
+
To test Golang or Node versions which are dynamically downloaded via a script on startup we have a set of automated tests in [./tests](./tests). These are [bats](https://github.com/bats-core/bats-core) tests that we use to make assertions not only on the correct functioning of our bash/shell scripts, but also of the software provided by our Docker image. For an overview on how [bats works see here](https://bats-core.readthedocs.io/en/stable/).
37
+
38
+
<mark>In General any fix or feature should be accompanied by a set of tests to validate that those changes work as expected.</mark>
15
39
16
40
### Developing
17
41
@@ -33,11 +57,11 @@ For the CI validation to succeed, make sure that **your PRs and commits follow t
33
57
The bulk of our CI work takes place in [Circle CI](https://app.circleci.com/pipelines/github/netlify/build-image).
34
58
35
59
If **you're part of the Netlify org** and have write access to the repo, our pipeline will take care of:
60
+
36
61
- Linting the Dockerfile
37
62
- Build your Dockerfile, tag it, and push it to our [docker hub repo](https://hub.docker.com/r/netlify/build)
38
63
- Run the automated [bats tests](#tests)
39
64
40
-
41
65
If you **don't have write access to the repo** and are submitting a PR via a forked repo, the CI pipeline will still execute for you. The main difference is that it won't push your built image to our docker repo.
42
66
If required, someone with write accesss to the repo can trigger the push for you. If you require it (mainly useful for testing purposes) reach out to someone on the team :+1:
43
67
@@ -48,6 +72,7 @@ If required, someone with write accesss to the repo can trigger the push for you
48
72
3. Commits which are prefaced withb `fix:` or `feat:` will trigger package release PRs created by [release-please](https://github.com/googleapis/release-please). Merge these PRs. If you need to manually trigger a release-please PR you can bump the version by creating an [empty PR](https://github.com/netlify/build-image/pull/728).
49
73
4. Wait for the CI pipelines to finish. Renovate should automatically create a PR in `buildbot` with the latest `build-image` releases (this may not happen straight away, but you can speed it up by checking [the box in this PR](https://github.com/netlify/buildbot/issues/912) or manually create a PR to bump [the version](https://github.com/netlify/buildbot/blob/0ada244ab84a1759a70d6b2cfc27c9987b5c77ca/.circleci/config.yml#L141-L150)).
50
74
5. Review, test and deploy the PR in `buildbot`.
75
+
51
76
### Running Test `buildbot` Releases
52
77
53
78
If you want to test a particular `build-image` change before going through the regular release process, you can do so by creating a PR following the process above :point-up: and pointing to any `build-image` you want. Any branch
0 commit comments