From 2f55b6c89d597da6dcc5819f525d10678cc31340 Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Thu, 19 Dec 2024 20:12:56 +0100 Subject: [PATCH] DOCS: How to test a branch (feedback) (#3268) --- documentation/test-a-branch.md | 37 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/documentation/test-a-branch.md b/documentation/test-a-branch.md index b14c8d8489..cd3f342d7e 100644 --- a/documentation/test-a-branch.md +++ b/documentation/test-a-branch.md @@ -2,55 +2,52 @@ Instructions for testing DNSControl at a particular PR or branch. -## Using Docker - -Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! - Assumptions: * `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. * `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). -``` +## Using Docker + +Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker! + +```shell docker run -it -v /THE/PATH:/dns golang -git clone https://github.com/StackExchange/dnscontrol.git +git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git cd dnscontrol -git checkout INSERT_BRANCH_HERE go install +``` +```shell cd /dns dnscontrol preview ``` If you want to run the integration tests, follow the -[Integration Tests](https://docs.dnscontrol.org/developer-info/integration-tests) document +[Integration Tests](integration-tests.md) document as usual. The directory to be in is `/go/dnscontrol/integrationTest`. -``` +```shell cd /go/dnscontrol/integrationTest go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3 ``` -Change `INSERT_PROVIDER_NAME` to the name of your provider (BIND, ROUTE53, GCLOUD, etc.) - +Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53`, `GCLOUD`, etc.) ## Not using Docker -Assumptions: -* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located. -* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches](https://github.com/StackExchange/dnscontrol/branches). - Step 1: Install Go [https://go.dev/dl/](https://go.dev/dl/) Step 2: Check out the software -``` -git clone https://github.com/StackExchange/dnscontrol.git +```shell +git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git cd dnscontrol -git checkout INSERT_BRANCH_HERE go install +``` +```shell cd /THE/PATH dnscontrol preview ``` @@ -59,7 +56,7 @@ Step 3: Clean up `go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it. -``` -$ rm -i $HOME/bin/dnscontrol +```shell +rm -i $HOME/bin/dnscontrol ```