gofumpt provides a supserset of gofmt / go fmt, but not every developer may have
it installed, so for situations where it's not available, fall back to gofmt.
As our code has been formatted with gofumpt already, in most cases contributions
will follow those formatting rules, but in some cases there may be a difference,
which would already be flagged by manual code review, but let's also enable the
gofumpt linter.
With this change, `make fmt` will use gofumpt is available; gofumpt has been
added to the dev-container, so `make -f docker.Makefile fmt` will always use it.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This change allows some make targets to be ran outside the dev-container for
easier discovery and use:
- `make clean` can be used on the host (as artifacts created from within the
development container are usually stored on the host).
- `make help` was already allowed
- `make dev` and `make shell` are added to the regular Makefile, to make it
easier to create and start the development container.
- When attempting to run `make dev` from within the development container, a
message is printed, and the target is cancelled:
root@docker-cli-dev$ make dev
you are already in the dev container
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The COMPANY_NAME currently sets the "CompanyName" field in the metadata
of Windows binaries. Our intent of this field is this field to contain
information about the company/party that produced the binary.
Also from [FileVersionInfo.CompanyName][FileVersionInfo.CompanyName]:
> Gets the name of the company that produced the file
Based on the above, "PACKAGER_NAME" is a bit more generic, and clearer
on intent, and we may at some point re-use this same information to
propagate equivalent fields on other platforms (rpms, debs)
[FileVersionInfo.CompanyName]: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo.companyname
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This allows us to drop the `//go:generate` and use of the github.com/mjibson/esc
utility.
worth noting that Go's native "embed" does not compress files. We could compress
these files as part of a build / validate step (which would add some complexity
when updating these files) if this is a concern, but not sure if the additional
complexity is warranted.
Comparing before/after sizes (see below);
macOS: 54125840 - 54005264 = 120576 (+120.58 kB)
Linux: 52393231 - 52277701 = 115530 (+115.53 kB)
Before:
ls -l build/
total 208736
lrwxr-xr-x 1 sebastiaan staff 19 Aug 15 09:36 docker@ -> docker-linux-amd64
-rwxr-xr-x 1 sebastiaan staff 54005264 Aug 15 09:35 docker-darwin-amd64*
-rwxr-xr-x 1 sebastiaan staff 52277701 Aug 15 09:36 docker-linux-amd64*
After:
ls -l build/
total 208960
lrwxr-xr-x 1 sebastiaan staff 18 Aug 15 09:32 docker@ -> docker-linux-amd64
-rwxr-xr-x 1 sebastiaan staff 54125840 Aug 15 09:31 docker-darwin-amd64*
-rwxr-xr-x 1 sebastiaan staff 52393231 Aug 15 09:32 docker-linux-amd64*
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is currently just a copy of the v3.8 schema, in preparation
of new features to be added in the new schema.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This allows e.g.
$ make -f docker.Makefile fmt test-e2e-non-experimental TESTFLAGS="-test.run TestRunGoodArgument|TestRunGood"
As well as adding the var to `$(ENVVARS)` we also need to use that when
invocking the e2e image, the existing `$(DOCKER_RUN)` is not used here because
the bind mounts differ. The other variables included in `$(ENVVARS)` are
harmless when running the e2e tests.
The `${TESTFLAGS}` envvar is already understood by `scripts/test/e2e/run`.
Note that since this modifies `$(ENVVARS)` this is now also available to the unit
test target too, so add the use to the invocation so it takes effect.
Signed-off-by: Ian Campbell <ijc@docker.com>
That is, the helper to be used from the plugin's `main`.
Also add a `helloworld` plugin example and build integration.
Signed-off-by: Ian Campbell <ijc@docker.com>
This patch adds support for multiple newlines and removes the 1-space
indentation of wrapped lines.
Given these targets:
```Makefile
.PHONY: foobar
foobar: ## runs the foobar lorum ipsum.\nand so pn\nand so on
echo foobar
```
Before this change, the output of `make help` was
```
foobar runs the foobar lorum ipsum.
and so pn\nand so on
```
After this change, the output is:
```
foobar runs the foobar lorum ipsum.
and so pn
and so on
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The `make help` output was missing some targets (`fmt`, `test-unit`,
`test-e2e`).
Note that some targets are still hidden (`test-e2e-experimental`,
`test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not
usually run separate from `test-e2e`.
Before this patch:
make -f docker.Makefile help
binary build the CLI
build alias for binary
clean clean build artifacts
cross build the CLI for macOS and Windows
binary-windows build the CLI for Windows
binary-osx build the CLI for macOS
dev start a build container in interactive mode for in-container development
shell alias for dev
lint run linters
vendor download dependencies (vendor/) listed in vendor.conf
dynbinary build the CLI dynamically linked
authors generate AUTHORS file from git history
manpages generate man pages from go source and markdown
yamldocs generate documentation YAML files consumed by docs repo
shellcheck run shellcheck validation
help print this help
With this patch applied:
make -f docker.Makefile help
binary build the CLI
build alias for binary
clean clean build artifacts
test-unit run unit tests (using go test)
cross build the CLI for macOS and Windows
binary-windows build the CLI for Windows
binary-osx build the CLI for macOS
dev start a build container in interactive mode for in-container development
shell alias for dev
lint run linters
fmt run gofmt
vendor download dependencies (vendor/) listed in vendor.conf
dynbinary build the CLI dynamically linked
authors generate AUTHORS file from git history
manpages generate man pages from go source and markdown
yamldocs generate documentation YAML files consumed by docs repo
shellcheck run shellcheck validation
test-e2e run all e2e tests
help print this help
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Address code review comemnts and purge additional dead code.
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
(cherry picked from commit f250152bf4)
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
This new collection of commands supports initializing a local
engine using containerd, updating that engine, and activating
the EE product
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
* Add the `help` target to document make targets when building using a
container
* Remove the `watch` target (filewatcher was removed with c0588a9c) from
docker.Makefile and Makefile
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
vendor/ must be removed first, otherwise files added to vendor/ but not vendor.conf
will not cause the validation to fail
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
The test target existed before, this is to provide a legacy interface to
allow easy testing for downstream Docker CE.
Without this we would need separate Makefiles/Jenkinsfiles for releases
past 17.07. Later on this target could also be used to test both unit
tests and integration tests at the same time.
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Remove referenced to developing on the host, we shouldn't support it.
Move script/validate to scripts/validate to be consistent.
Set the default target to be binary instead of clean.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
- The cli version defaults to "unknown-version" unless set via the VERSION env var
- The commit version can be overridden via GITCOMMIT env var
- The build time can be overridden via BUILDTIME env var
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>