Skip to content

Commit

Permalink
Update CONTRIBUTIONS.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhung committed Mar 6, 2024
1 parent 0b83fe5 commit ae0f4ad
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions CONTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ JFrog requires contributors to sign a Contributor License Agreement, known as a

## Building

Simply run `make install` - this will compile the provider and install it to `~/.terraform.d`. When running this, it will take the current tag and bump it 1 patch version. It does not actually create a new tag (that will be `make release`). If you wish to use the locally installed provider, make sure your TF script refers to the new version number.
Simply run `make install` - this will compile the provider and install it to `~/.terraform.d`. When running this, it will take the current tag and bump it 1 patch version. It does not actually create a new tag. If you wish to use the locally installed provider, make sure your TF script refers to the new version number.

Requirements:
- [Terraform](https://www.terraform.io/downloads.html) 0.13+
- [Go](https://golang.org/doc/install) 1.18+ (to build the provider plugin)
- [Terraform](https://www.terraform.io/downloads.html) 1.7+
- [Go](https://golang.org/doc/install) 1.21+ (to build the provider plugin)

## Debugging

Expand All @@ -36,9 +36,9 @@ The script requires a valid license of a [supported type](https://github.com/jfr

With the script you can start one or two Artifactory instances using docker compose.

The license is not supplied, but a [30 day trial license can be freely obtained](https://jfrog.com/start-free/#hosted) and will allow local development. Make sure the license saved as a multi line text file.
The license is not supplied but is required for local development. Make sure the license saved as a multi line text file.

Currently, acceptance tests **require an access key** and don't support basic authentication or an API key. To generate an access key, please refer to the [official documentation](https://www.jfrog.com/confluence/display/JFROG/Access+Tokens#AccessTokens-GeneratingAdminTokens)
Currently, acceptance tests **require an access key**. To generate an access key, please refer to the [official documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/generate-admin-tokens)

Then, you have to set some environment variables as this is how the acceptance tests pick up their config.

Expand All @@ -48,6 +48,7 @@ ARTIFACTORY_USERNAME=admin
ARTIFACTORY_ACCESS_TOKEN=<your_access_token>
TF_ACC=true
```

`ARTIFACTORY_USERNAME` is not used in authentication, but used in several tests, related to replication functionality. It should be hardcoded to `admin`, because it's a default user created in the Artifactory instance from the start.

A crucial env var to set is `TF_ACC=true` - you can literally set `TF_ACC` to anything you want, so long as it's set. The acceptance tests use terraform testing libraries that, if this flag isn't set, will skip all tests.
Expand All @@ -66,12 +67,6 @@ $ make acceptance

**DO NOT** remove the `-v` - terraform testing needs this. This will recursively run all tests, including acceptance tests.

### Testing Federated repos

To execute acceptance tests for federated repo resource, we need:
- 2 Artifactory instances, configured with [Circle-of-Trust](https://www.jfrog.com/confluence/display/JFROG/Access+Tokens#AccessTokens-CircleofTrust(Cross-InstanceAuthentication))
- Set environment variables `ARTIFACTORY_URL_2` to enable the acceptance tests that utilize both Artifactory instances

#### Setup Artifactory instances

The [scripts/run-artifactory.sh](scripts/run-artifactory.sh) starts two Artifactory instances for testing using the file [scripts/docker-compose.yml](scripts/docker-compose.yml).
Expand All @@ -92,11 +87,6 @@ Run all the acceptance tests as usual
$ make acceptance
```

Or run only the acceptance tests for Federated repos:
```sh
$ make acceptance_federated
```

## Releasing

Please create a pull request against the master branch. Each pull request will be reviewed by a member of the JFrog team.
Expand Down

0 comments on commit ae0f4ad

Please sign in to comment.