Provided more guidance on how to configure the DNS API tests in specific scenarios.

Kevin Brown 2022-04-12 18:40:24 +10:00
parent 51fe2351cf
commit 6c500e61af

@ -1,14 +1,20 @@
There is a CI workflow `DNS.yml` to test your dns api when you send PR to add new dns api.
There is a CI workflow `DNS.yml` to test your DNS API when you send PR to add a new DNS API.
This test must be passing before your PR can get merged.
This test suite uses GitHub actions. The purpose is to try your changes on one particular API across a bunch of different operating systems so that we have confidence your changes will work wherever this script is used. This test must be passing before your PR can get merged.
However, as a limitation of github actions, the workflow `DNS.yml` can only run in your Forked repo when you push code.
However, as a limitation of github actions, the workflow `DNS.yml` can only run in your Forked repo when you push code.
## So, please enable Github Actions on your Forked repo first, and then push code to your repo, it will run there.
If you have not enabled Github Actions before you push to your fork, unfortunately you'll need to trigger some kind of push in order for GitHub actions to realise it needs to run the workflow, so either push a new commit after enabling GitHub actions, roll your fork back to be even with the main repo, then push again, or delete your fork and re-push your changes.
### 1. Let's assume the usage of your api is like below:
Once you've got GitHub Actions running the DNS API tests on your fork, we need to configure them so they can put your change through its paces.
### 1. An example DNS API
We'll use this API as an example. It's called `dns_myapi`, and it takes two environment variable arguments, `MyDnsKey1`, and `MyDnsKey2`. To run it on the command line, we'd do this:
```
export MyDnsKey1=myValue1
@ -18,15 +24,14 @@ acme.sh --issue -d mytest.myExample.com --dns dns_myapi
```
### 2. You need to set up the following "Github actions Secrets":
### 2. In order to test this particular API, we'd need to do this:
Open the menu: `"Settings"` -> `"Secrets"` -> `"New secret"`
**The secrets are only visible to yourself, nobody else can read the secrets.**
Set the following secrets:
And we'd need to set the following secrets:
```
TokenName1 = MyDnsKey1
@ -58,8 +63,32 @@ Different DNS providers may require different propagate time, please ask your D
Usually, it's larger than `120` seconds.
## Note
Note that in order to test a different API, you'd need different values, for example the Netlify API is run like this:
```
export NETLIFY_ACCESS_TOKEN="xxxx"
acme.sh --issue -d mytest.myExample.com --dns dns_netlify
```
So we'd need to set the following secrets in GitHub:
```
TEST_DNS = dns_netlify
```
```
TokenName1 = NETLIFY_ACCESS_TOKEN
```
```
TokenValue1 = xxxx
```
```
TestingDomain = mytest.myExample.com
```
Now the tests should be able to try out your change to the Netlify DNS API!
# How to get a Solaris server
If you need a solaris shell to debug your script, please see this project: https://github.com/vmactions/shell-solaris
@ -68,6 +97,3 @@ If you need a solaris shell to debug your script, please see this project: http
# How to get a FreeBSD server
If you need a freebsd shell to debug your script, please see this project: https://github.com/vmactions/shell-freebsd