Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15aab336ad |
No files matched your search
@@ -49,9 +49,9 @@ with your task.
|
|||||||
`--target` names it, so a lost `COPY --from=` edge leaves `docker build .`
|
`--target` names it, so a lost `COPY --from=` edge leaves `docker build .`
|
||||||
passing while the gate never runs. Confirm by planting a violation, not by
|
passing while the gate never runs. Confirm by planting a violation, not by
|
||||||
reading the file.
|
reading the file.
|
||||||
- [ ] Check builds use Docker's normal cache: no `docker build` in `script/`
|
- [ ] No `docker build` in `script/` passes `--no-cache` or a cache-busting
|
||||||
passes a build argument whose only job is to make steps run again, and no
|
build argument such as `CACHEBUST`, and no `Dockerfile` stage declares
|
||||||
`Dockerfile` stage declares one.
|
`ARG CACHEBUST`.
|
||||||
- [ ] Go: each Go stage downloads the modules (`COPY go.mod go.sum ./`,
|
- [ ] Go: each Go stage downloads the modules (`COPY go.mod go.sum ./`,
|
||||||
`RUN go mod download`) before `COPY . .`; the steps that compile
|
`RUN go mod download`) before `COPY . .`; the steps that compile
|
||||||
(`golangci-lint run`, `go test`, `go build`) mount Go's build cache
|
(`golangci-lint run`, `go test`, `go build`) mount Go's build cache
|
||||||
|
|||||||
@@ -243,10 +243,9 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
The development environment stage installs development prerequisites by
|
The development environment stage installs development prerequisites by
|
||||||
running `script/bootstrap`. Only system packages may be installed inline
|
running `script/bootstrap`. Only system packages may be installed inline
|
||||||
above it, so that a change to `script/` does not install them again; the
|
above it, so that check builds keep them; the `prompts` repo's own
|
||||||
`prompts` repo's own `Dockerfile` does this. A stage that runs
|
`Dockerfile` does this. A stage that runs `script/bootstrap` COPYs `script/`
|
||||||
`script/bootstrap` COPYs `script/` and the dependency manifests it needs
|
and the dependency manifests it needs before running it. These are examples:
|
||||||
before running it. These are examples:
|
|
||||||
- `package.json`, `yarn.lock`, `.yarnrc.yml` and `.yarn/releases/`
|
- `package.json`, `yarn.lock`, `.yarnrc.yml` and `.yarn/releases/`
|
||||||
- `go.mod` and `go.sum`
|
- `go.mod` and `go.sum`
|
||||||
|
|
||||||
@@ -305,8 +304,15 @@ style conventions are in separate documents:
|
|||||||
- its own line or a line above it
|
- its own line or a line above it
|
||||||
- the files copied before it
|
- the files copied before it
|
||||||
|
|
||||||
Never prune the build cache (`docker builder prune` and the like): it is
|
Nothing needs to run again on an unchanged tree. Never prune the build cache
|
||||||
shared with every other build on the host.
|
(`docker builder prune` and the like): it is shared with every other build
|
||||||
|
on the host. When a check is added or changed, prove it works:
|
||||||
|
- plant a defect it must catch
|
||||||
|
- watch the run fail on it
|
||||||
|
- revert the defect
|
||||||
|
|
||||||
|
A green run alone shows neither that the check ran nor that it covers what
|
||||||
|
it should.
|
||||||
|
|
||||||
- **The gate phases are separate stages, and the build stage depends on both.**
|
- **The gate phases are separate stages, and the build stage depends on both.**
|
||||||
The lint phase is based on the `golangci/golangci-lint` image (pinned by
|
The lint phase is based on the `golangci/golangci-lint` image (pinned by
|
||||||
@@ -491,7 +497,7 @@ style conventions are in separate documents:
|
|||||||
already do.
|
already do.
|
||||||
|
|
||||||
- **A Python `test` phase that installs its packages from `Pipfile.lock` does it
|
- **A Python `test` phase that installs its packages from `Pipfile.lock` does it
|
||||||
before `COPY . .`, so a change to the code keeps them.** The steps are:
|
before `COPY . .`, so check builds keep them.** The steps are:
|
||||||
- `COPY script/ script/`
|
- `COPY script/ script/`
|
||||||
- `COPY Pipfile Pipfile.lock ./`
|
- `COPY Pipfile Pipfile.lock ./`
|
||||||
- `RUN script/bootstrap`
|
- `RUN script/bootstrap`
|
||||||
|
|||||||
Reference in new issue
Block a user