Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Latest commit

 

History

History
66 lines (39 loc) · 2.08 KB

HACKING.md

File metadata and controls

66 lines (39 loc) · 2.08 KB

Developing in openshift-ai-image-backup

Makefile targets

To see all make targets, run make help

Updates to bindata

When updating files in the bindata directory, you will need to regenerate the corresponding go code by running:
make update-bindata

Linter tests

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.

golangci-lint

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

ShellCheck provides warnings and suggestions for bash scripts. For information on installing, see:
https://github.com/koalaman/shellcheck#installing

Example:
dnf install ShellCheck

bashate

Bashate is a style checker for bash scripts. For more information, see:
https://github.com/openstack/bashate

To install:
pip install bashate

markdownlint

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 formatting

GO has automated formatting. To update code and ensure it is formatted properly, run:
make update-gofmt

Building image

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