To see all make
targets, run make help
When updating files in the bindata
directory, you will need to regenerate the corresponding go code by running:
make update-bindata
As of this writing, four linters are used by the make check
command, as well as by the configured github workflow
actions:
- golangci-lint
- shellcheck
- bashate
- markdownlint
These tests will be run automatically as a github action when you push an update. Failures can mean your pull request
will not be approved. It is suggested that you run make check
regularly as part of development.
Install golangci-lint in your GO environment by running:
go install github.com/golangci/golangci-lint/cmd/[email protected]
For more information, see:
https://golangci-lint.run/usage/install/
ShellCheck provides warnings and suggestions for bash scripts. For information on installing, see:
https://github.com/koalaman/shellcheck#installing
Example:dnf install ShellCheck
Bashate is a style checker for bash scripts. For more information, see:
https://github.com/openstack/bashate
To install:pip install bashate
Markdownlint is a style checker and linter for Markdown files. For more information, see:
https://github.com/igorshubovych/markdownlint-cli
To install:npm install -g markdownlint-cli
GO has automated formatting. To update code and ensure it is formatted properly, run:make update-gofmt
You can build the golang binary itself by running:hack/build-go.sh
To build the image, without pushing, just run make
with no target.
To build the image and push to your own registry, specify the IMAGE variable and use the push-image target:
make IMAGE=quay.io/MYUSERID/openshift-ai-image-backup:latest push-image
To build and push to the default registry, tagging the iamge as quay.io/redhat_ztp/openshift-ai-image-backup:latest
, run:
make push-image