Commit Graph

15 Commits

Author SHA1 Message Date
Ashley Davis
f3a051d94f
add license preludes for a variety of files
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2023-03-14 15:46:10 +00:00
Ashley Davis
4d12251fa7
Use distinct manifest dirs for signed / unsigned manifests
This avoids a race condition with the `release-manifests` and
`release-manifests-signed` targets.

When running in parallel, one could execute `rm -rf
$(BINDIR)/scratch/manifests` while the other was running.

This could also conceivably have led to incorrectly packaged
manifests when both were run in parallel.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-11-29 16:14:59 +00:00
Tim Ramlot
5802b3a963 use variables for binaries
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-08-26 07:43:17 +00:00
Tim Ramlot
aabe2fc5d1 simplify static manifest generation
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-08-04 06:54:11 +00:00
Ashley Davis
35f2206404
change name of bin dir to _bin by default and make it a variable
This is needed because go and other tools will ignore directories
starting with "_" or "." but would treat a dir called "bin" as a regular
directory.

This in turn meant that when we vendored Go in bin, these tools would by
default scan the whole stdlib included with the bundled vendored go.

See https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns for details

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-21 16:34:26 +01:00
Ashley Davis
3d0fd00137
add unsigned manifests target
this preserves the split between make release-artifacts and
make release-artifacts-signed

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-06 18:58:15 +01:00
Joakim Ahrlin
ea5913e1c3 update tar command to trim paths for release manifests
Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
2022-04-14 11:11:18 +02:00
Ashley Davis
d43a5e8eb8
use absolute path of cmrel
fixes the breakage created by https://github.com/cert-manager/cert-manager/pull/4988

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-29 11:26:52 +01:00
Maël Valais
c6f1f9bc24 make: in CI, copy binaries from "bin/downlaoded" to "bin/tools"
This is to work around the fact that binaries in hostPath-mounted
directories cannot be executed even if the permissions are correct.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-25 18:01:54 +01:00
Ashley Davis
e3c3939113
some small QoL tweaks in makefiles
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-18 16:14:46 +00:00
Maël Valais
3405edf821 make: add the targets 'e2e-setup-kind', 'e2e-setup-kind', and 'e2e'
The commands can be run concurrently, with the exception of e2e that
has to be run after e2e-setup is done. The e2e target does not check
whether cert-manager and the addons are installed.

The two only scripts that were kept are:

- make/e2e.sh      (previously called ./devel/run-e2e.sh)
- make/cluster.sh  (previsouly called ./devel/cluster/create.sh)

The reason for the removal of the other scripts is that they didn't
have that much logic and could easily ported to Make, improving greatly
the execution speed thanks to make's concurrency.

make/e2e.sh now behaves "as expected" when using -ginkgo.focus or
GINKGO_FOCUS; previously, the logs would not be shown before the end
of the test.

make/cluster.sh has lost the ability to create an OpenShift 3.11 cluster.
for running the end-to-end tests. The two reasons are that OpenShift 4
wasn't supported by the script devel/cluster/create.sh, and OpenShift
3.11 is not supported by cert-manager anymore.

The Makefile targets that were used in the Prow jobs (verify, verify_deps,
verify_chart, verify_upgrade, and cluster) have been kept around. They
now show a warning to encourage people to use the new Make-based targets.
When running one of the deprecated targets the Makefile won't check the
presence of the system tools such as Go and jq, since Bazel takes care of
these dependencies.

On version change, downloaded tools and images are re-downloaded. The
command 'make clean' now keeps the downloaded images and tools.

Note that a lot of attention has been put into having a Make system that works
flawlessly both on Linux and on BSDs (such as macOS).

You will note that some recursive calls to make are made, and $(MAKE)
instead of plain "make" is used in that case. If we didn't use $(MAKE),
we would have concurrency issues, and warnings such as:

  make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:32:08 +01:00
Maël Valais
7aaff9fbb7 make: fix manifests.mk data race due to bin/helm/cert-manager/templates/%.yaml
It looked like this:

cp: cannot create regular file 'bin/helm/cert-manager/templates/startupapicheck-psp-clusterrole.yaml': File exists
cp: cannot create regular file 'bin/helm/cert-manager/templates/service.yaml': File exists
cp: cannot create regular file 'bin/helm/cert-manager/templates/webhook-psp.yaml': File exists
cp: cannot create regular file 'bin/helm/cert-manager/templates/rbac.yaml': File exists

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:17:24 +01:00
Ashley Davis
a57110c6bb
Add targets for unit and integration tests in make
These lean heavily on `go test` for everything possible.

Also adds setup for versionchecker test in make, and a script for
extracting CRDs from templated rendered YAML files

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-17 14:48:57 +00:00
Maël Valais
9df26703dd make -f make/Makefile helm chart now includes templates/crds.yaml
Signed-off-by: Maël Valais <mael@vls.dev>
2022-02-15 17:52:16 +01:00
Ashley Davis
32d716654a
Add a makefile flow for building artifacts
Includes targets for:

- all "server" binaries, for all arches
- all containers for all server binaries for all arches
- all client binaries (kubectl plugin / cmctl) for all arches
- the cert-manager helm chart + signature
- the cert-manager static manifests + CRDs
- tools which bazel would download, with checksum verification
- (commented out) a signed SHA256SUM file for client binaries

Upgrades from the bazel flow include that:

- we use OS-specific base images rather than just using amd64 everywhere
- we easily add support for signing artifacts at build time
- we add ".exe" to the end of windows executables
- we add a zip file for windows executables, for easier consumption
- we concatenate YAML files more robustly
- staging a full release should be much faster
- hopefully, it's easier to change things!
- licenses are trimmed down to reduce bloat in images (the license
  bundle was 1.4MB in size alone)

Changes from the bazel flow include:

- containers no longer have a symlink to the binary at an unusual
  path, but instead just have the binary at a more predictable path
  (e.g. /app/cmd/webhook/webhook instead of
  /app/cmd/webhook/webhook.runfiles/com_github_jetstack_cert_manager/cmd/webhook/webhook_/webhook)

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-15 09:54:15 +00:00