Pull requests are welcome - we thank you in advance. All we ask is that your PR has a clear description of its purpose or intent and that the purpose of a PR is a singluar intent - we'd rather accept multiple smaller PRs than fewer big ones.
This provider uses the Custom Provider Framework from HashiCorp. A great reference is available from HashiCorp here.
Development is conducted using Go version defined in go.mod.
Documentation and examples should be regenerated and included in Pull Requests - run cd tools; go generate ./... before finalising your PR.
DO NOT MANUALLY EDIT FILES IN THE docs FOLDER - THEY ARE GENERATED BY THE ABOVE COMMAND!
Run golangci-lint run.
These can be run locally by running go test -v -cover ./internal/provider/.
These require an active and licensed Sonatype Nexus Repository Manager. PRs originating from outside this project will fail to pass the automated Integration Tests in CI due to our Repository Secrets not being available for these CI Executions (a GitHub restriction).
To run Integration Tests locally, set the following 3 environment variables and then run TF_ACC=1 go test -v -cover ./internal/provider/:
NXRM_SERVER_URL: Full URL to your Sonatype Nexus Repository ManagerNXRM_SERVER_USERNAME: Username to authenticate withNXRM_SERVER_PASSWORD: Password to authentivate with
It is helpful when submitting Pull Requests to confirm whether you have been able to execute the Integraton Tests locally, but not mandatory.
Some Acceptance Tests rely on AWS, GCP or Sonatype IQ Server credentials/infrastructure to be run and be successful. These are disabled by default and can be enabled by setting the following environment variables per provider/service.
Set TF_ACC_ACS_BLOB_STORE=1 to enable ACS blob store tests.
The following additional environment variables are required to authenticate with Azure:
TF_ACC_AZURE_ACCOUNT_KEY- Account key found under Access keys for the storage accountTF_ACC_AZURE_STORAGE_ACCOUNT_NAME- Storage Account Name
Set TF_ACC_S3_BLOB_STORE=1 to enable S3 blob store tests.
The following additional environment variables are required to authenticate with AWS:
TF_ACC_AWS_ACCESS_KEY_IDTF_ACC_AWS_ACCESS_SECRET_KEY
Set TF_ACC_GCP_BLOB_STORE=1 to enable GCP blob store tests
Set TF_ACC_IQ_SERVER=1 to enable tests that exercise repository_firewall and
sonatyperepo_system_iq_connection against a real Sonatype IQ Server - see
#285.
Without this flag, these tests are skipped, so a plain TF_ACC=1 run against NXRM alone still
passes.
A real, licensed, running Sonatype IQ Server connected to the same NXRM instance under test is required. The following additional environment variables configure that connection (all optional
-
they default to the same local setup this provider's own CI uses):
-
IQ_SERVER_URL- defaults tohttp://localhost:8070 -
IQ_SERVER_USERNAME- defaults toadmin -
IQ_SERVER_PASSWORD- defaults toadmin123
See terraform-provider-shared and it's examples.
Please sign off your commits, to show that you agree to publish your changes under the current terms and licenses of the project, and to indicate agreement with Developer Certificate of Origin (DCO).
git commit --signed-off ...