Commit Graph

119 Commits

Author SHA1 Message Date
Richard Wall
755fec1170 Add some experimental ko based build and deploy tools
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2022-12-21 12:12:09 +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
Ashley Davis
ea9a46a16a
add trivy scan targets
These enable scanning of each of our container images on linux/amd64
to check for vulnerabilities. These targets can then be used in CI as
an indicator that we might need to take a look at upgrading dependencies
or base images.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-08-03 15:57:28 +01:00
Ashley Davis
e4dca7a930
add go.mod and go.sum as sources
this will trigger binaries to be rebuilt when go.mod and go.sum change

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-08-03 14:24:36 +01:00
Maël Valais
24e1ba51a6
make: cmctl and kubectl-cert_manager were using two -ldflags
I also took the opportunity to document the three most important "build"
variables in "make help".

Manually rebased to adopt $(BINDIR) changes

Signed-off-by: Maël Valais <mael@vls.dev>
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-11 10:18:30 +01:00
Ashley Davis
18e98ce3da
move legacy targets to legacy.mk
we don't _need_ to remove these and we can keep them around for
longer, but we don't need them to be in files we actually use and edit.

putting the targets in a separate file feels cleaner!

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-30 22:35:45 +01:00
Ashley Davis
e456c95fc2
move FORCE target to Makefile
it looked out of place in git.mk

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-21 16:34:30 +01: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
8a5b2b4c62
change default shell to use /usr/bin/env
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-21 16:26:47 +01:00
Ashley Davis
7ce1f9cffb
Improve "make help" output and add a couple of utility commands
- "make help" should be good enough for most people in most situations
  to build and test cert-manager
- "make clean-all" can be a one-stop-shop to start fresh.
- "make which-go" makes it clearer whether go vendoring is being used

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 13:35:28 +01:00
Ashley Davis
9988306f06
also clean bazel folders with make clean
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-04-08 16:56:21 +01:00
Maël Valais
3b4cd84a86 make: GOFLAGS missing when building cmctl and kubectl_cert-manager
The GOFLAGS make variable was set after "include make/cmctl.mk",
leading to the warning:

    Makefile:34: warning: undefined variable 'RELEASE_VERSION'
    Makefile:34: warning: undefined variable 'GITCOMMIT'

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-30 14:24:38 +02:00
Maël Valais
de5c0bf381 make: the AppVersion and AppGitCommit weren't set
When checking how User-Agent headers would differ from v1.7.1 to
v1.8.0, The User-Agent looked off:

    cert-manager-issuers/v1.8.0 (linux/amd64) cert-manager/

The ending "/" should be followed by the git commit hash. It seems like
we forgot to port what Bazel does to fill AppVersion, AppGitCommit, and
AppGitState. This commit adds this feature to the Makefile. The
User-Agent should now look like this:

    cert-manager-issuers/v1.8.0 (linux/amd64) cert-manager/9dd5f6c85fde2c3ed58cd6c9e465bb5a4c1ca2b2
                 <----->
                This part depends
                on the component.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-25 20:44:04 +01:00
Maël Valais
c4809d843e make: ignore bin/ and make/ which both contain go files
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-25 18:10:51 +01: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
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
Ashley Davis
ad998b35f8
Allow helm chart verification in both bazel + make
This slightly modifies our existing helm chart verification script to
accept the location of a tarball containing the chart we're verifying.

That in turn allows us to more generally use the script for both
validating the chart we build using make and the chart we build using
bazel.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-10 18:02:14 +00:00
Ashley Davis
845dd26ef7
add comments detailing kind network footgun
also adds a variable for the network name, potentially making it easier
to change in the future if kind improves its support for this kind of
thing

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-11-09 17:21:47 +00:00
Ashley Davis
6f8ef26c07
add a script + flow for getting latest kind images
the script will need to be manually updated if we want to add a new
k8s version, but it should be trivial to do that

the actual kind image SHAsums aren't updated, so that the addition of
the script can be separate from the act of updating the images

also adds a make target for creating a kind cluster with CI deps

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-11-08 16:58:16 +00:00
joshvanl
64feb85490 Adds bazel to build and release cmctl, along with kubectl-cert_manager
binary

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-10-14 15:49:46 +01:00
Krzysztof Ostrowski
220af13dc6
add comment in Makefile for build and release-tar
Signed-off-by: Krzysztof Ostrowski <krzysztof.ostrowski@posteo.de>
2021-09-16 17:20:29 +02:00
jetstack-bot
56b1374b41
Merge pull request #4161 from irbekrm/update_makefile
Update makefile
2021-08-03 14:10:40 +01:00
irbekrm
03e6002e1f Create a single variable for Bazel image flags.
Signed-off-by: irbekrm <irbekrm@gmail.com>

Co-authored-by: Ashley Davis <ashley.davis@jetstack.io>
2021-08-03 13:31:05 +01:00
Ashley Davis
c86f20f4b5
add crd make target & don't change GOPROXY in update-codegen.sh
there seems to be justification for setting GOSUMDB to a universal value
here, but setting GOPROXY doesn't seem to provide value here

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-07-19 17:19:13 +01:00
irbekrm
799228d9a2 Adds a 'make release_tars' target
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-12 18:42:12 +01:00
irbekrm
7405fb4e24 Make image targets allow for more customization
Customize platform, base image and whether CGO is enabled

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-12 18:42:08 +01:00
irbekrm
6734a8c943 Uses the HACK_DIR var everywhere
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-12 18:35:11 +01:00
irbekrm
83468561cb 'make clean' removes test artifacts
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-12 18:34:56 +01:00
irbekrm
f7c2f11882 Adds a make target to create a test cluster
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-12 09:50:51 +01:00
irbekrm
5a45444b4a Adds a make target
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-07-06 17:22:19 +01:00
Ashley Davis
10aba07dad
add .PHONY next to targets
having .PHONY next to the target which it's marking
helps with identifying which targets have been marked and makes it
easier to spot a missing .PHONY

also tweaks the find command to avoid piping, and cleans up a duplicated
ctl target

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-06-16 14:57:18 +01:00
Irbe Krumina
6183a2d2b6 Suggestions from code review
Co-authored-by: Ashley Davis <SgtCoDFish@users.noreply.github.com>
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-15 16:23:53 +01:00
irbekrm
d79a058b14 Allow controlling whether cgo is enabled via flags to Bazel
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-01 08:47:06 +01:00
Kevin Grigorenko
8974f6d8f4
Issue #4042: Add help for make clean target
Signed-off-by: Kevin Grigorenko <kevin@myplaceonline.com>
2021-05-21 08:31:03 -07:00
Kevin Grigorenko
52eec2543d
Issue #4042: Support make clean target
Signed-off-by: Kevin Grigorenko <kevin@myplaceonline.com>
2021-05-20 20:38:14 -07:00
Arsh Sharma
d51c7f7325 chore: changed target position
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-03-17 13:39:04 +05:30
Arsh Sharma
33bf920f60 feat: added images_push target in Makefile
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-03-15 18:09:49 +05:30
Arsh Sharma
e1e8392d50 fix(makefile): updated the docker_repo env var
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-03-13 12:42:15 +05:30
Richard Wall
9d5d9e3a46 Remove some lingering references to an old make e2e_test target
* Left over from https://github.com/jetstack/cert-manager/pull/2534

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-12-18 11:24:23 +00:00
Richard Wall
7fa8992231 Remove deprecated script
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-12-18 11:21:24 +00:00
Maartje Eyskens
ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
Maartje Eyskens
1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
James Munnelly
75219aefcf Fix 'make images'
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-05-06 14:21:33 +01:00
JoshVanL
991040238f
Adds ctl Makefile target
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-01 18:54:27 +01:00
James Munnelly
22f4f1e1f2 Add release-tars targets to construct cert-manager release artifacts
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-01-30 21:02:58 +00:00
James Munnelly
355369afa6 Create devel directory and use it for e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-01-22 22:08:27 +00:00
jetstack-bot
1793e7b573
Merge pull request #2236 from munnerz/covered-images
Add Bazel image targets with coverage enabled
2019-11-14 10:54:09 +00:00
James Munnelly
1c4f755818 Skip Venafi tests by default
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-11-14 10:15:24 +00:00
James Munnelly
4bb0287113 Allow setting flakeAttempts when running e2e suite
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-10-16 16:14:43 +01:00
James Munnelly
7f3fdb9949 Update Makefile and add update-all.sh script
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-10-02 12:50:32 +01:00