Skip to content

Commit c4602b5

Browse files
authored
(docs): Fix formatting and links in README.md for clarity and consistency (#228)
* Fix formatting and links in README.md for clarity and consistency * re-add License block for RAT
1 parent 86dc428 commit c4602b5

File tree

1 file changed

+34
-31
lines changed

1 file changed

+34
-31
lines changed

README.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- [Terraform](https://www.terraform.io/downloads.html) 1.0.x
66
- [Go](https://golang.org/doc/install) 1.20+ (to build the provider plugin)
77

8-
See wiki: https://github.com/apache/cloudstack-terraform-provider/wiki
8+
See wiki: <https://github.com/apache/cloudstack-terraform-provider/wiki>
99

1010
## Installing from Github Release
1111

@@ -28,7 +28,7 @@ The valid `ARCH` options are:
2828

2929
Steps for installation:
3030

31-
```
31+
```bash
3232
RELEASE=0.5.0
3333
ARCH=darwin_arm64
3434
mkdir -p ~/.terraform.d/plugins/local/cloudstack/cloudstack/${RELEASE}/${ARCH}
@@ -39,7 +39,7 @@ mv cloudstack-terraform-provider_${RELEASE}/cloudstack-terraform-provider_v${REL
3939

4040
To use the locally installed provider, please use the following in your main.tf etc, and then run `terraform init`:
4141

42-
```
42+
```sh
4343
terraform {
4444
required_providers {
4545
cloudstack = {
@@ -79,7 +79,7 @@ User hitting installation issue using registry can install using the local insta
7979

8080
## Documentation
8181

82-
For more details on how to use the provider, click [here](website/) or visit https://registry.terraform.io/providers/cloudstack/cloudstack/latest/docs
82+
For more details on how to use the provider, visit [website](website/) or visit <https://registry.terraform.io/providers/cloudstack/cloudstack/latest/docs>
8383

8484
## Developing the Provider
8585

@@ -88,18 +88,18 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or
8888
Clone repository to: `$GOPATH/src/github.com/apache/cloudstack-terraform-provider`
8989

9090
```sh
91-
$ mkdir -p $GOPATH/src/github.com/apache; cd $GOPATH/src/github.com/apache
92-
$ git clone [email protected]:apache/cloudstack-terraform-provider
91+
mkdir -p $GOPATH/src/github.com/apache; cd $GOPATH/src/github.com/apache
92+
git clone [email protected]:apache/cloudstack-terraform-provider
9393
```
9494

9595
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
9696

9797
Enter the provider directory and build the provider
9898

9999
```sh
100-
$ cd $GOPATH/src/github.com/apache/cloudstack-terraform-provider
101-
$ make build
102-
$ ls $GOPATH/bin/terraform-provider-cloudstack
100+
cd $GOPATH/src/github.com/apache/cloudstack-terraform-provider
101+
make build
102+
ls $GOPATH/bin/terraform-provider-cloudstack
103103
```
104104

105105
Once the build is ready, you have to copy the binary into Terraform locally (version appended).
@@ -108,17 +108,17 @@ On Linux and Mac this path is at ~/.terraform.d/plugins,
108108
On Windows at %APPDATA%\terraform.d\plugins,
109109

110110
```sh
111-
$ cd ~
112-
$ mkdir -p ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_amd64
113-
$ cp $GOPATH/bin/terraform-provider-cloudstack ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_amd64
111+
cd ~
112+
mkdir -p ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.5.0/linux_amd64
113+
cp $GOPATH/bin/terraform-provider-cloudstack ~/.terraform.d/plugins/localdomain/provider/cloudstack/0.5.0/linux_amd64
114114
```
115115

116116
## Testing the Provider
117117

118118
In order to test the provider, you can simply run `make test`.
119119

120120
```sh
121-
$ make test
121+
make test
122122
```
123123

124124
In order to run the full suite of Acceptance tests you will need to run the CloudStack Simulator. Please follow these steps to prepare an environment for running the Acceptance tests:
@@ -137,7 +137,7 @@ or
137137
docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator:4.20.1.0
138138
```
139139

140-
When Docker started the container you can go to http://localhost:8080/client and login to the CloudStack UI as user `admin` with password `password`. It can take a few minutes for the container is fully ready, so you probably need to wait and refresh the page for a few minutes before the login page is shown.
140+
When Docker started the container you can go to <http://localhost:8080/client> and login to the CloudStack UI as user `admin` with password `password`. It can take a few minutes for the container is fully ready, so you probably need to wait and refresh the page for a few minutes before the login page is shown.
141141

142142
Once the login page is shown and you can login, you need to provision a simulated data-center:
143143

@@ -148,29 +148,28 @@ docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -
148148
If you refresh the client or login again, you will now get passed the initial welcome screen and be able to go to your account details and retrieve the API key and secret. Export those together with the URL:
149149

150150
```sh
151-
$ export CLOUDSTACK_API_URL=http://localhost:8080/client/api
152-
$ export CLOUDSTACK_API_KEY=r_gszj7e0ttr_C6CP5QU_1IV82EIOtK4o_K9i_AltVztfO68wpXihKs2Tms6tCMDY4HDmbqHc-DtTamG5x112w
153-
$ export CLOUDSTACK_SECRET_KEY=tsfMDShFe94f4JkJfEh6_tZZ--w5jqEW7vGL2tkZGQgcdbnxNoq9fRmwAtU5MEGGXOrDlNA6tfvGK14fk_MB6w
151+
export CLOUDSTACK_API_URL=http://localhost:8080/client/api
152+
export CLOUDSTACK_API_KEY=r_gszj7e0ttr_C6CP5QU_1IV82EIOtK4o_K9i_AltVztfO68wpXihKs2Tms6tCMDY4HDmbqHc-DtTamG5x112w
153+
export CLOUDSTACK_SECRET_KEY=tsfMDShFe94f4JkJfEh6_tZZ--w5jqEW7vGL2tkZGQgcdbnxNoq9fRmwAtU5MEGGXOrDlNA6tfvGK14fk_MB6w
154154
```
155155

156156
In order for all the tests to pass, you will need to create a new (empty) project in the UI called `terraform`. When the project is created you can run the Acceptance tests against the CloudStack Simulator by simply running:
157157

158158
```sh
159-
$ make testacc
159+
make testacc
160160
```
161161

162162
To execute specific test:
163163

164164
```sh
165-
$ make testacc TESTARGS='-run ^TestAccCloudStackNetworkACLRule_update$'
165+
make testacc TESTARGS='-run ^TestAccCloudStackNetworkACLRule_update$'
166166
```
167167

168168
## Sample Terraform configuration when testing locally
169169

170-
Below is an example configuration to initialize provider and create a Virtual Machine instance
170+
Below is an example configuration to initialize provider and create a Virtual Machine instance `provider.tf`
171171

172172
```sh
173-
$ cat provider.tf
174173
terraform {
175174
required_providers {
176175
cloudstack = {
@@ -199,48 +198,52 @@ resource "cloudstack_instance" "web" {
199198
## Releasing Terraform Provider
200199

201200
The CloudStack Terraform Provider release process requires `goreleaser` to be performed
202-
by a committer or a PMC member of the project: https://goreleaser.com/install
201+
by a committer or a PMC member of the project: <https://goreleaser.com/install>
203202

204203
Check and ensure TF provider passes builds, GA and run this for local checks:
205-
```
204+
205+
```sh
206206
goreleaser release --snapshot --clean
207207
```
208208

209-
Next, create a personalised Github token: https://github.com/settings/tokens/new?scopes=repo,write:packages
209+
Next, create a personalised Github token: <https://github.com/settings/tokens/new?scopes=repo,write:packages>
210210

211-
```
211+
```sh
212212
export GITHUB_TOKEN="YOUR_GH_TOKEN"
213213
```
214214

215215
Note: Due to how the Terraform registry works, it require the repo to be named in a certain way.
216-
For this reason, the builds are published via https://github.com/cloudstack/terraform-provider-cloudstack/releases
216+
For this reason, the builds are published via <https://github.com/cloudstack/terraform-provider-cloudstack/releases>
217217

218218
To do this, add the following remote for publishing builds:
219219

220-
```
220+
```sh
221221
git remote add cloudstack [email protected]:cloudstack/terraform-provider-cloudstack.git
222222
```
223223

224224
Finally tag the release, for example and push to Github:
225225

226-
```
226+
```sh
227227
git tag -a v0.5.0-pre -m "v0.5.0-pre Alpha Release for testing purposes"
228228
git push cloudstack v0.5.0-pre
229229
```
230230

231231
Run goreleaser to release them:
232-
```
232+
233+
```sh
233234
goreleaser release --clean
234235
```
235236

236237
Or, just release using:
237-
```
238+
239+
```sh
238240
goreleaser release
239241
```
240242

241243
For testing or to push on other repos, you need to fix repo path in the
242244
`.goreleaser.yml` and run:
243-
```
245+
246+
```sh
244247
goreleaser release --clean --skip-validate
245248
```
246249

0 commit comments

Comments
 (0)