Each fenced dockerfile block moves byte for byte into its own file under examples/, and one sentence links the file where the block stood, as sneak ruled at #159 (comment). Phrases that pointed at a block by position now name the file, here and in both checklists. README.md names the folder. No rule changes. Model: opus-5-5
This commit is contained in:
1 parent
964d973e3c
commit
48c7faf557
7 files changed
+141
-143
No files matched your search
@@ -159,7 +159,8 @@ share, and evolve prompts across projects.
|
|||||||
The repository is a collection of Markdown files organized in the `prompts/`
|
The repository is a collection of Markdown files organized in the `prompts/`
|
||||||
subdirectory. Each file contains one or more related prompts or policy
|
subdirectory. Each file contains one or more related prompts or policy
|
||||||
documents. There is no build step or runtime component; the prompts are consumed
|
documents. There is no build step or runtime component; the prompts are consumed
|
||||||
by copying them into other projects or referencing them directly.
|
by copying them into other projects or referencing them directly. `examples/`
|
||||||
|
holds the example `Dockerfile` files that `prompts/REPO_POLICIES.md` links to.
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
FROM golangci/golangci-lint@sha256:... AS lint
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends libvips-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
# The steps that install system packages and download Go's modules
|
||||||
|
# come before COPY . ., so a change to the code keeps their layers.
|
||||||
|
# The steps that compile mount Go's build cache, and golangci-lint run
|
||||||
|
# also mounts golangci-lint's; both survive from build to build.
|
||||||
|
|
||||||
|
# Lint phase
|
||||||
|
# golangci/golangci-lint:v2.x.x, YYYY-MM-DD
|
||||||
|
FROM golangci/golangci-lint@sha256:... AS lint
|
||||||
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
--mount=type=cache,target=/root/.cache/golangci-lint \
|
||||||
|
golangci-lint run --config .golangci.yml ./...
|
||||||
|
|
||||||
|
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
|
||||||
|
# image ships and the alpine one does not. -count=1 because the mounted
|
||||||
|
# cache also holds test results, which go test would otherwise replay.
|
||||||
|
# A first run that timed out gets no rerun, because a rerun would only
|
||||||
|
# wait for the same hang.
|
||||||
|
# golang:1.x, YYYY-MM-DD
|
||||||
|
FROM golang@sha256:... AS test
|
||||||
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
status=0; \
|
||||||
|
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$?; \
|
||||||
|
printf '%s\n' "$output"; \
|
||||||
|
test "$status" -eq 0 && exit 0; \
|
||||||
|
case "$output" in \
|
||||||
|
*"panic: test timed out"*|*"*** Test killed"*) exit 1 ;; \
|
||||||
|
esac; \
|
||||||
|
echo "--- Rerunning with -v for details ---"; \
|
||||||
|
go test -count=1 -timeout 90s -race -v ./...; \
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
# Build stage. Nothing is wanted from either phase above; the copies
|
||||||
|
# are what make BuildKit build them first, so nothing after them can
|
||||||
|
# run unless lint and test passed.
|
||||||
|
# golang:1.x-alpine, YYYY-MM-DD
|
||||||
|
FROM golang@sha256:... AS builder
|
||||||
|
# git comes from the base image's own distribution package index, which
|
||||||
|
# is trusted, so it needs no version and no hash.
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY --from=lint /src/go.sum /dev/null
|
||||||
|
COPY --from=test /src/go.sum /dev/null
|
||||||
|
# A tar-stream context keeps the sender's file owners, which git refuses.
|
||||||
|
RUN git config --system --add safe.directory /src
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# The VERSION build arg when one is given, otherwise
|
||||||
|
# `git describe --tags --always` on the .git in the build context. With
|
||||||
|
# .git present, a version that is still empty, dev or unknown fails the
|
||||||
|
# build: git is missing or could not read the checkout.
|
||||||
|
ARG VERSION
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
VERSION="${VERSION:-$(git describe --tags --always)}"; \
|
||||||
|
if [ -e .git ]; then \
|
||||||
|
case "$VERSION" in ""|dev|unknown) \
|
||||||
|
echo "version is '$VERSION' although .git is present" >&2; \
|
||||||
|
exit 1 ;; \
|
||||||
|
esac; \
|
||||||
|
fi; \
|
||||||
|
CGO_ENABLED=0 go build -trimpath \
|
||||||
|
-ldflags="-s -w -X main.Version=${VERSION}" \
|
||||||
|
-o /app ./cmd/app/
|
||||||
|
|
||||||
|
# Runtime stage, and the last one
|
||||||
|
FROM alpine@sha256:...
|
||||||
|
COPY --from=builder /app /usr/local/bin/app
|
||||||
|
ENTRYPOINT ["app"]
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Test phase. Both pytest runs share one 90-second timeout, so a hang
|
||||||
|
# uses it once and gets no rerun.
|
||||||
|
# debian:trixie-slim, YYYY-MM-DD
|
||||||
|
FROM debian@sha256:... AS test
|
||||||
|
# Python, pip and venv come from the distribution, which is trusted, so
|
||||||
|
# they need no version and no hash. make and git are base tools that
|
||||||
|
# script/bootstrap installs when they are missing. Installed here, they
|
||||||
|
# stay in their own layer when script/ changes.
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ca-certificates make git \
|
||||||
|
python3 python3-venv \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
# script/bootstrap installs pipenv in a virtual environment at
|
||||||
|
# $HOME/.pipenv, and the tests below run that pipenv.
|
||||||
|
ENV PATH=/root/.pipenv/bin:$PATH
|
||||||
|
WORKDIR /app
|
||||||
|
COPY script/ script/
|
||||||
|
COPY Pipfile Pipfile.lock ./
|
||||||
|
RUN script/bootstrap
|
||||||
|
COPY . .
|
||||||
|
RUN timeout 90 sh -c 'pipenv run pytest || { \
|
||||||
|
echo "--- Rerunning with -v for details ---"; \
|
||||||
|
pipenv run pytest -v; exit 1; }'
|
||||||
@@ -59,8 +59,8 @@ with your task.
|
|||||||
also mounts golangci-lint's
|
also mounts golangci-lint's
|
||||||
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
||||||
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
||||||
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
|
that timed out gets no rerun, as in `examples/go.Dockerfile` in the
|
||||||
`REPO_POLICIES.md`
|
`prompts` repo
|
||||||
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
||||||
it before `COPY . .`, with `COPY script/ script/`,
|
it before `COPY . .`, with `COPY script/ script/`,
|
||||||
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
||||||
@@ -79,8 +79,8 @@ with your task.
|
|||||||
a package with no wheel for the image stops the install. In that step it
|
a package with no wheel for the image stops the install. In that step it
|
||||||
installs no Python, because a step above it already did. `Pipfile` names no
|
installs no Python, because a step above it already did. `Pipfile` names no
|
||||||
`python_version`, because `--deploy` stops when the distribution's Python
|
`python_version`, because `--deploy` stops when the distribution's Python
|
||||||
differs from it. The tests run after `COPY . .`, as in the Python `test`
|
differs from it. The tests run after `COPY . .`, as in
|
||||||
phase example in `REPO_POLICIES.md`
|
`examples/python-test-phase.Dockerfile` in the `prompts` repo
|
||||||
|
|
||||||
- [ ] The gate phases invoke their tools directly, never through `make lint` or
|
- [ ] The gate phases invoke their tools directly, never through `make lint` or
|
||||||
`script/test` — those are themselves a `docker build` and would recurse
|
`script/test` — those are themselves a `docker build` and would recurse
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ Template files can be fetched from:
|
|||||||
also mounts golangci-lint's
|
also mounts golangci-lint's
|
||||||
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
||||||
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
||||||
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
|
that timed out gets no rerun, as in `examples/go.Dockerfile` in the
|
||||||
`REPO_POLICIES.md`
|
`prompts` repo
|
||||||
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
||||||
it before `COPY . .`, with `COPY script/ script/`,
|
it before `COPY . .`, with `COPY script/ script/`,
|
||||||
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
||||||
@@ -146,8 +146,8 @@ Template files can be fetched from:
|
|||||||
for the image stops the install. In that step it installs no Python,
|
for the image stops the install. In that step it installs no Python,
|
||||||
because a step above it already did. `Pipfile` names no
|
because a step above it already did. `Pipfile` names no
|
||||||
`python_version`, because `--deploy` stops when the distribution's
|
`python_version`, because `--deploy` stops when the distribution's
|
||||||
Python differs from it. The tests run after `COPY . .`, as in the Python
|
Python differs from it. The tests run after `COPY . .`, as in
|
||||||
`test` phase example in `REPO_POLICIES.md`
|
`examples/python-test-phase.Dockerfile` in the `prompts` repo
|
||||||
|
|
||||||
- Server: the final stage builds and runs the application
|
- Server: the final stage builds and runs the application
|
||||||
- Non-server: the final stage brings up the dev environment
|
- Non-server: the final stage brings up the dev environment
|
||||||
|
|||||||
+24
-134
@@ -174,7 +174,8 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
With only `package.json` and `yarn.lock`, the install fails. Alpine's yarn 1
|
With only `package.json` and `yarn.lock`, the install fails. Alpine's yarn 1
|
||||||
then says to enable corepack; never do that, and copy the missing files
|
then says to enable corepack; never do that, and copy the missing files
|
||||||
instead. The Python and Go stages below need no yarn and copy no
|
instead. The stages in the `prompts` repo's `examples/go.Dockerfile` and
|
||||||
|
`examples/python-test-phase.Dockerfile` need no yarn and copy no
|
||||||
`yarn.lock`, so `script/bootstrap` installs no node and no yarn there.
|
`yarn.lock`, so `script/bootstrap` installs no node and no yarn there.
|
||||||
|
|
||||||
`script/cibuild` runs the CI build, and the Gitea workflow calls it. The
|
`script/cibuild` runs the CI build, and the Gitea workflow calls it. The
|
||||||
@@ -237,7 +238,7 @@ style conventions are in separate documents:
|
|||||||
up a development environment; for server repos it is the runtime image. The
|
up a development environment; for server repos it is the runtime image. The
|
||||||
gate phases and the build stage start from their pinned base images and
|
gate phases and the build stage start from their pinned base images and
|
||||||
install what those images lack in either of these ways:
|
install what those images lack in either of these ways:
|
||||||
- inline, as the canonical Go `Dockerfile` below does for `git`
|
- inline, as the `prompts` repo's `examples/go.Dockerfile` does for `git`
|
||||||
- by running `script/bootstrap`, as the `prompts` repo's own `Dockerfile`
|
- by running `script/bootstrap`, as the `prompts` repo's own `Dockerfile`
|
||||||
does for its yarn packages
|
does for its yarn packages
|
||||||
|
|
||||||
@@ -318,87 +319,8 @@ style conventions are in separate documents:
|
|||||||
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
|
||||||
hash), so lint failures surface in seconds rather than after a full compile.
|
hash), so lint failures surface in seconds rather than after a full compile.
|
||||||
The test phase is based on the Debian Go image. The canonical Go repo
|
The test phase is based on the Debian Go image. The canonical Go repo
|
||||||
`Dockerfile`:
|
`Dockerfile` is at
|
||||||
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/examples/go.Dockerfile`.
|
||||||
```dockerfile
|
|
||||||
# The steps that install system packages and download Go's modules
|
|
||||||
# come before COPY . ., so a change to the code keeps their layers.
|
|
||||||
# The steps that compile mount Go's build cache, and golangci-lint run
|
|
||||||
# also mounts golangci-lint's; both survive from build to build.
|
|
||||||
|
|
||||||
# Lint phase
|
|
||||||
# golangci/golangci-lint:v2.x.x, YYYY-MM-DD
|
|
||||||
FROM golangci/golangci-lint@sha256:... AS lint
|
|
||||||
WORKDIR /src
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
COPY . .
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
||||||
--mount=type=cache,target=/root/.cache/golangci-lint \
|
|
||||||
golangci-lint run --config .golangci.yml ./...
|
|
||||||
|
|
||||||
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
|
|
||||||
# image ships and the alpine one does not. -count=1 because the mounted
|
|
||||||
# cache also holds test results, which go test would otherwise replay.
|
|
||||||
# A first run that timed out gets no rerun, because a rerun would only
|
|
||||||
# wait for the same hang.
|
|
||||||
# golang:1.x, YYYY-MM-DD
|
|
||||||
FROM golang@sha256:... AS test
|
|
||||||
WORKDIR /src
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
COPY . .
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
||||||
status=0; \
|
|
||||||
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$?; \
|
|
||||||
printf '%s\n' "$output"; \
|
|
||||||
test "$status" -eq 0 && exit 0; \
|
|
||||||
case "$output" in \
|
|
||||||
*"panic: test timed out"*|*"*** Test killed"*) exit 1 ;; \
|
|
||||||
esac; \
|
|
||||||
echo "--- Rerunning with -v for details ---"; \
|
|
||||||
go test -count=1 -timeout 90s -race -v ./...; \
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
# Build stage. Nothing is wanted from either phase above; the copies
|
|
||||||
# are what make BuildKit build them first, so nothing after them can
|
|
||||||
# run unless lint and test passed.
|
|
||||||
# golang:1.x-alpine, YYYY-MM-DD
|
|
||||||
FROM golang@sha256:... AS builder
|
|
||||||
# git comes from the base image's own distribution package index, which
|
|
||||||
# is trusted, so it needs no version and no hash.
|
|
||||||
RUN apk add --no-cache git
|
|
||||||
WORKDIR /src
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
COPY --from=lint /src/go.sum /dev/null
|
|
||||||
COPY --from=test /src/go.sum /dev/null
|
|
||||||
# A tar-stream context keeps the sender's file owners, which git refuses.
|
|
||||||
RUN git config --system --add safe.directory /src
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# The VERSION build arg when one is given, otherwise
|
|
||||||
# `git describe --tags --always` on the .git in the build context. With
|
|
||||||
# .git present, a version that is still empty, dev or unknown fails the
|
|
||||||
# build: git is missing or could not read the checkout.
|
|
||||||
ARG VERSION
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
||||||
VERSION="${VERSION:-$(git describe --tags --always)}"; \
|
|
||||||
if [ -e .git ]; then \
|
|
||||||
case "$VERSION" in ""|dev|unknown) \
|
|
||||||
echo "version is '$VERSION' although .git is present" >&2; \
|
|
||||||
exit 1 ;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
CGO_ENABLED=0 go build -trimpath \
|
|
||||||
-ldflags="-s -w -X main.Version=${VERSION}" \
|
|
||||||
-o /app ./cmd/app/
|
|
||||||
|
|
||||||
# Runtime stage, and the last one
|
|
||||||
FROM alpine@sha256:...
|
|
||||||
COPY --from=builder /app /usr/local/bin/app
|
|
||||||
ENTRYPOINT ["app"]
|
|
||||||
```
|
|
||||||
|
|
||||||
Key points:
|
Key points:
|
||||||
- The lint phase uses the `golangci/golangci-lint` image directly, so
|
- The lint phase uses the `golangci/golangci-lint` image directly, so
|
||||||
@@ -447,18 +369,9 @@ style conventions are in separate documents:
|
|||||||
lists in the same `RUN`, so the layer does not keep them. The test phase,
|
lists in the same `RUN`, so the layer does not keep them. The test phase,
|
||||||
on the Debian Go image, installs the libraries its tests need the same
|
on the Debian Go image, installs the libraries its tests need the same
|
||||||
way. Either install goes right after `FROM`, so Docker keeps it until the
|
way. Either install goes right after `FROM`, so Docker keeps it until the
|
||||||
base image or the install line changes:
|
base image or the install line changes. The first lines of a lint phase
|
||||||
|
that installs system libraries are at
|
||||||
```dockerfile
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/examples/go-lint-system-libraries.Dockerfile`.
|
||||||
FROM golangci/golangci-lint@sha256:... AS lint
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends libvips-dev \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
WORKDIR /src
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
```
|
|
||||||
|
|
||||||
- `.dockerignore` lets `.git` into the build context. It keeps out every git
|
- `.dockerignore` lets `.git` into the build context. It keeps out every git
|
||||||
`config` at any depth (`**/.git/config`, `**/.git/modules/**/config`):
|
`config` at any depth (`**/.git/config`, `**/.git/modules/**/config`):
|
||||||
- the repository's own
|
- the repository's own
|
||||||
@@ -575,35 +488,11 @@ style conventions are in separate documents:
|
|||||||
`$HOME/.pipenv/bin/pipenv lock`, after the `pip install` line has installed
|
`$HOME/.pipenv/bin/pipenv lock`, after the `pip install` line has installed
|
||||||
pipenv.
|
pipenv.
|
||||||
|
|
||||||
In the example below, `script/bootstrap` finds `make`, `git`, python and
|
In `examples/python-test-phase.Dockerfile`, `script/bootstrap` finds `make`,
|
||||||
venv already installed. The example copies no `yarn.lock`, so
|
`git`, python and venv already installed. The example copies no `yarn.lock`,
|
||||||
`script/bootstrap` installs no node and no yarn.
|
so `script/bootstrap` installs no node and no yarn. The Python `test` phase
|
||||||
|
example is at
|
||||||
```dockerfile
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/examples/python-test-phase.Dockerfile`.
|
||||||
# Test phase. Both pytest runs share one 90-second timeout, so a hang
|
|
||||||
# uses it once and gets no rerun.
|
|
||||||
# debian:trixie-slim, YYYY-MM-DD
|
|
||||||
FROM debian@sha256:... AS test
|
|
||||||
# Python, pip and venv come from the distribution, which is trusted, so
|
|
||||||
# they need no version and no hash. make and git are base tools that
|
|
||||||
# script/bootstrap installs when they are missing. Installed here, they
|
|
||||||
# stay in their own layer when script/ changes.
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends ca-certificates make git \
|
|
||||||
python3 python3-venv \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
# script/bootstrap installs pipenv in a virtual environment at
|
|
||||||
# $HOME/.pipenv, and the tests below run that pipenv.
|
|
||||||
ENV PATH=/root/.pipenv/bin:$PATH
|
|
||||||
WORKDIR /app
|
|
||||||
COPY script/ script/
|
|
||||||
COPY Pipfile Pipfile.lock ./
|
|
||||||
RUN script/bootstrap
|
|
||||||
COPY . .
|
|
||||||
RUN timeout 90 sh -c 'pipenv run pytest || { \
|
|
||||||
echo "--- Rerunning with -v for details ---"; \
|
|
||||||
pipenv run pytest -v; exit 1; }'
|
|
||||||
```
|
|
||||||
|
|
||||||
- Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that
|
- Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that
|
||||||
runs `script/cibuild` on push. The workflow's only other step checks out the
|
runs `script/cibuild` on push. The workflow's only other step checks out the
|
||||||
@@ -749,11 +638,12 @@ style conventions are in separate documents:
|
|||||||
pipenv run pytest -v; exit 1; }'
|
pipenv run pytest -v; exit 1; }'
|
||||||
```
|
```
|
||||||
|
|
||||||
Both pytest runs share that one 90-second timeout, as in the `Dockerfile`
|
Both pytest runs share that one 90-second timeout, as in the `prompts`
|
||||||
example above, so a hang uses it once and gets no rerun. Ctrl-C does not
|
repo's `examples/python-test-phase.Dockerfile`, so a hang uses it once and
|
||||||
stop a running `make test`, which goes on until the tests end or the 90
|
gets no rerun. Ctrl-C does not stop a running `make test`, which goes on
|
||||||
seconds run out. On a Mac without `timeout`, the target fails until it is
|
until the tests end or the 90 seconds run out. On a Mac without `timeout`,
|
||||||
installed. On a host, the target needs `$HOME/.pipenv/bin` on `PATH`.
|
the target fails until it is installed. On a host, the target needs
|
||||||
|
`$HOME/.pipenv/bin` on `PATH`.
|
||||||
|
|
||||||
The `exit 1` ensures the target always fails after a rerun. The first run
|
The `exit 1` ensures the target always fails after a rerun. The first run
|
||||||
already proved the tests are broken, so the build must not pass even if a
|
already proved the tests are broken, so the build must not pass even if a
|
||||||
@@ -828,11 +718,11 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
- **A plain `docker build .` of a clone stamps the version that
|
- **A plain `docker build .` of a clone stamps the version that
|
||||||
`git describe --tags --always` gives.** The version is derived from the `.git`
|
`git describe --tags --always` gives.** The version is derived from the `.git`
|
||||||
in the build context, as the canonical `Dockerfile` above shows. Without its
|
in the build context, as the `prompts` repo's `examples/go.Dockerfile` shows.
|
||||||
failure check, a missing `git` or an unreadable checkout would leave
|
Without its failure check, a missing `git` or an unreadable checkout would
|
||||||
`-X main.Version=` empty, and the build would still exit 0. `script/docker`
|
leave `-X main.Version=` empty, and the build would still exit 0.
|
||||||
and `script/cibuild` pass the version they compute on the host; it takes
|
`script/docker` and `script/cibuild` pass the version they compute on the
|
||||||
precedence. They do this byte-identically across repos:
|
host; it takes precedence. They do this byte-identically across repos:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# The version and the tag each get their own line: a failing command
|
# The version and the tag each get their own line: a failing command
|
||||||
|
|||||||
Reference in new issue
Block a user