This change introduces a job that publishes the latest airshipctl image
to quay.io/airshipit/airshipctl each time a new change is merged.
Closes #33
Change-Id: I8468b10a8064333d1749015960151e98adb2be97
Signed-off-by: Drew Walters <andrew.walters@att.com>
OpenDev publishes Ansible roles that enable documentation previews.
These roles expect an html or pdf directory in the Sphinx build dir.
This change updates the documentation output directory to the
doc/build/html so documentation previews are available on each PS.
Related #59
Change-Id: I0853f603b6bc147e7fc33834b5d195c16f71d5ab
Signed-off-by: Drew Walters <andrew.walters@att.com>
Most systems have /usr/bin/python, the interpreter the airshipctl
Makefile uses to build documentation, linked to an end-of-life
interpreter. This change updates the Makefile to use the Python 3
interpreter.
Related #59
Change-Id: I19b4d623a5a76dc455184bac2f54d8bfe0947530
Signed-off-by: Drew Walters <andrew.walters@att.com>
Ideally, installing and using an external tool should not modify the
go.mod or go.sum files in anyway. Unfortunately, this may not be
completely possible until Go1.14
(https://github.com/golang/go/issues/30515). This change prevents the
godoc target from modifying the go.mod file, though there may still be
anomalies with modifying the go.sum file (e.g. this change).
Further, since the godoc tool defaults to -goroot=$(go env GOROOT), it
doesn't make sense to provide a default value for -goroot, as it may not
be what the user has set as $(go env GOROOT)
Change-Id: I92de6bf8af4c00464b857db363bd07fdb55ee143
The goimports tool does not check for trailing whitespaces in multiline
strings. This commit adds a simple linter to address this deficiency.
This change will also have the benefit of providing light linting of any
non-go files.
Change-Id: I253dd7c4895f476fa3a6f0c4fccf7c9cada16366
Implements `make docs` command to create rtd-themed docs using Sphinx
from the existing Markdown documents in the docs directory.
Changes the `get-modules` command to `depend` to more closely match
OpenStack guidelines in [0].
Adds `fmt` command as specified in [0], currently referencing the `lint`
command.
Adds `godoc` command that will host a local godoc server instance with a
link directly to airshipctl technical documentation.
Adds `releasenotes` commands specified in [0], currently
noted as "TODO".
Adds `images` command as found in other Airship projects, referencing
`docker-image`.
[0] https://governance.openstack.org/tc/reference/pti/golang.html
Change-Id: I134fc2c2714bce6d23dc9cf8b86c3016d68def7e
Adds options relating to proxy settings in the Makefile to be used
during the execution of docker build. The settings are optional to be
used and are set up similarly to other Airship projects such as [0] and
[1].
To set proxy settings during docker build, execute the command as
follows:
```
make docker-image \
-e PROXY=<The proxy URL> \
-e NO_PROXY=<comma-separated list of URLs/IPs not using the proxy> \
-e USE_PROXY=true
```
[0] https://opendev.org/airship/pegleg/src/branch/master/Makefile
[1] https://opendev.org/airship/promenade/src/branch/master/Makefile
Change-Id: I92258465d9638b40797d38ba5d8b835fc38df23f
This commit adds the `tidy` target. This target will fail if the go.mod
or go.sum files are not up to date with the code. It will also be a
prerequisite to the `lint` command, implying that it will also be caught
by the Zuul gates.
Change-Id: Ie33de2d793beca100435670346eb0e2ea7b3b0dd
This change has multiple benefits:
* Allows testing/coverage Makefile flags to be set from the command
line. This allows a dev to easily test both correctness and coverage of
a subset of packages by simply providing a value for the `PKG` make
variable.
* Fixes an issue where an error message was being printed to stderr on
each Zuul run, since the `COVER_PKG` variable required that Go is
installed, and yet we don't install Go to the Zuul VM.
* Fixes an issue where Zuul VMs were crashing due to an Out Of Memory
error. This was happening because of the way that the `coverpkg` flag
works, which caused tests to occasionally require more than 8G of
memory, exceeding the amount of memory on each Zuul VM.
* Cleans up the output when running `make cover`. Previously, the list
of all packages was printed for coverage for each package, creating a
lot of noise on the console.
However, it has the following negative:
* With the removal of the `coverpkg` flag, the `go test` command will no
longer check coverage of packages which do not include any `_test.go`
files. This puts the responsibility of assuring that coverage is
correctly reflected onto the shoulders of developers and reviewers.
Change-Id: I7fef1dd26ef19b5f2ab4cf2d1be223bf82210492
golangci-lint is GPL-licensed, and its presence in go.mod might lead
people to believe that airshipctl links against a GPL-licensed
dependency. In reality airshipctl does not link against golangci-lint
(thanks to the // +build tools comment), but this change helps to avoid
that misconception from being made.
Change-Id: I95c223a7f6597e1aa07a025ed2cebbbd6bd7cbd8
Updated go version to 1.13.1 and updated dependency versions in mod
file. Updated Dockerfile to use golang 1.13.1 image. Removed GO111MODULE
env in Makefile which is no longer necessary.
Change-Id: Ib120e8bdfbd3724b72169c4b5ce2cbc7fd9f3ce6
This fixes a bug where `make cover` was missing packages. The target now
covers all code except for code placed in the top level package (such as
main.go) and anything placed in the testutils directory.
This also fixes minor issues with the Dockerfile and the coverage_check
script
Note that this commit also strives to increase code coverage beyond the
80% margin
Change-Id: I9e1cbcf841cc869345a00f05e39774cb3da10065
This commit adds a makefile target for generating a report for unit test
coverage. It also adds the coverage_check tool to assert that the actual
test coverage meets the specified requirement.
This also improves various aspects of the testing utilities:
* The "test" package has been renamed to "testutil"
* The "Objs" member has been removed from the CmdTest object
* The "Cmd" member has been added to the CmdTest object. This allows
testing of multiple variants of a root airshipctl command
Finally, this commit includes additional tests for root.go. These are
required in order to meet the required coverage threshold.
Change-Id: Id48343166c0488c543a405ec3143e4a75355ba43
* Remove the unused SCRIPTS_DIR variable
* Make bracket/parenthesis usage consistent
* Add the delete-golden target and add it as a pre-req for
update-golden. This will help to keep the testdata directories from
accruing bloat
Change-Id: Ie4b7377872d48371e5e134fe18ed9347e89b7c70
This adds the .golangci.example.yaml, allowing for more precise control
over how linting is done.
This configuration is highly opinionated and is subject to change.
Change-Id: Ida13bf0dca12e152b75427f5060ad4931e426c72
This adds Ansible playbooks to install kubernetes using minikube and
then assert that airshipctl is able to communicate with the cluster.
Change-Id: Ice5cf3de8d9192d508c79c68caf8f5a61896da9c
Signed-off-by: Pete Birley <pete@port.direct>
This PS adds the skeleton for a set of zuul checks and gates for
airshipctl and removes the travis config.
This PS also removes some dead code from the util package. This change
is required to get unit tests passing.
Change-Id: Ifb1be49cb1bb82c62a0085b6da9b8ff1b261a95b
This uses the current master commit of golangci-lint. We will want to
update to use a tagged version as soon as the golangci-lint team pushes
a new tag
Move away from the builtin 'plugin' package in favor of compile-in
plugins. This will require a plugin author to inject code into the
proper packages before building airshipctl