Skip to content

Commit 50aaf45

Browse files
noltenolte
andauthored
pipeline update (#72)
* generate docs * Commit from GitHub Actions * checkin the generated docs to the current build branch Co-authored-by: nolte <[email protected]>
1 parent 37a331d commit 50aaf45

17 files changed

+793
-35
lines changed

.github/workflows/cicd-build.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
with:
1818
go-version: ^1.14
1919
id: go
20-
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: "3.8"
2124
- uses: actions/cache@v2
2225
with:
2326
path: ~/go/pkg/mod
@@ -28,6 +31,29 @@ jobs:
2831
- name: Check out code into the Go module directory
2932
uses: actions/checkout@v2
3033

34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install MarkdownPP mkdocs
38+
39+
- name: Install dependencies
40+
run: |
41+
cd ./documentation && go run mage.go -v GenerateDocumation
42+
43+
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
44+
with:
45+
add: 'docs'
46+
force: true
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
51+
with:
52+
add: 'documentation/provider_doc'
53+
force: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
3157
- name: install golangci-lint
3258
run: |
3359
curl -sSfL \

.github/workflows/cicd-release.yml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,13 @@ jobs:
1010
steps:
1111
- name: Checkout master
1212
uses: actions/[email protected]
13-
- name: Set up Python
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: "3.8"
13+
1714
- name: Set up Go 1.x
1815
uses: actions/setup-go@v2
1916
with:
2017
go-version: ^1.14
2118
id: go
2219

23-
- uses: actions/cache@v2
24-
with:
25-
path: ~/go/pkg/mod
26-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27-
restore-keys: |
28-
${{ runner.os }}-go-
29-
30-
- name: Install dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install MarkdownPP mkdocs
34-
- name: Install dependencies
35-
run: |
36-
cd ./documentation && go run mage.go -v GenerateDocumation
37-
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
38-
with:
39-
add: 'docs'
40-
force: true
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
44-
with:
45-
add: 'documentation/provider_doc'
46-
force: true
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
5020
- name: Deploy docs
5121
uses: mhausenblas/mkdocs-deploy-gh-pages@master
5222
env:

.github/workflows/gorelease.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- name: Import GPG key
2424
id: import_gpg
2525
uses: crazy-max/ghaction-import-gpg@v3
26-
env:
27-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
28-
PASSPHRASE: ${{ secrets.PASSPHRASE }}
26+
with:
27+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
28+
passphrase: ${{ secrets.PASSPHRASE }}
2929

3030
- name: test provider
3131
run: |

docs/data-sources/harbor_label.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Data Source: harbor_label
2+
3+
## Example Usage
4+
5+
```hcl
6+
data "harbor_label" "label_1" {
7+
name = "testlabel-acc-classic"
8+
scope = "g"
9+
}
10+
11+
data "harbor_label" "label_2" {
12+
id = 4
13+
}
14+
15+
```
16+
17+
## Argument Reference
18+
19+
- `id` - (Optional, int) ID of the label.
20+
- `name` - (Optional, string) Name of the label.
21+
- `scope` - (Optional, string) Scope of the label.
22+
23+
## Attributes Reference
24+
25+
- `id` - (int) Unique ID of the label.
26+
- `name` - (string) Name of the label.
27+
- `description` - (Optional) The description of the label account will be displayed in harbor.
28+
- `color` - (Optional) The colour the label.
29+
- `scope` - (Optional) The scope the label, `p` for project and `g` for global.
30+
- `project_id` - (Optional) The ID of project that the label belongs to.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Data Source: harbor_project
2+
3+
## Example Usage
4+
5+
```hcl
6+
data "harbor_project" "project_1" {
7+
name = "main"
8+
}
9+
10+
data "harbor_project" "project_2" {
11+
id = 4
12+
}
13+
14+
```
15+
16+
## Argument Reference
17+
18+
- `id` - (Optional, int) ID of the project.
19+
- `name` - (Optional, string) Name of the project.
20+
21+
## Attributes Reference
22+
23+
- `id` - (int) Unique ID of the project.
24+
- `name` - (string) Name of the project.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Data Source: harbor_registry
2+
3+
## Example Usage
4+
5+
```hcl
6+
data "harbor_registry" "registry_1" {
7+
name = "dockerhub-acc-classic"
8+
}
9+
10+
data "harbor_registry" "registry_2" {
11+
id = 4
12+
}
13+
14+
```
15+
16+
## Argument Reference
17+
18+
- `id` - (Optional, string) ID of the registry.
19+
- `name` - (Optional, string) Name of the registry.
20+
21+
## Attributes Reference
22+
23+
- `id` - (int) Unique ID of the registry.
24+
- `name` - (string) Name of the registry.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: "harbor"
3+
#subcategory: "config"
4+
page_title: "Harbor: harbor_config_system"
5+
description: |-
6+
Manages an Base Harbor System Configuration
7+
---
8+
9+
# Resource: harbor_config_system
10+
11+
## Example Usage
12+
```
13+
resource "harbor_config_system" "main" {
14+
project_creation_restriction = "adminonly"
15+
robot_token_expiration = 5259492
16+
}
17+
```
18+
19+
## Argument Reference
20+
The following arguments are supported:
21+
22+
* **project_creation_restriction** - (Optional) Who can create projects within Harbor. Can be **"adminonly"** or **"everyone"**
23+
24+
* **robot_token_expiration** - (Optional) The amount of time in minutes a robot account will expiry.
25+
26+
`NOTE: If the time is set to high you will get a 500 internal server error message when creating robot accounts`
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
subcategory: "config"
3+
page_title: "Harbor: harbor_config_auth"
4+
description: |-
5+
Manages an Base Harbor Auth Configuration
6+
---
7+
8+
9+
# Resource: harbor_config_auth
10+
11+
## Example Usage
12+
```
13+
resource "harbor_config_auth" "oidc" {
14+
auth_mode = "oidc_auth"
15+
oidc_name = "azure"
16+
oidc_endpoint = "https://login.microsoftonline.com/{GUID goes here}/v2.0"
17+
oidc_client_id = "OIDC Client ID goes here"
18+
oidc_client_secret = "ODDC Client Secret goes here"
19+
oidc_scope = "openid,email"
20+
oidc_verify_cert = true
21+
}
22+
```
23+
24+
## Argument Reference
25+
The following arguments are supported:
26+
27+
* **auth_mode** - (Required) Harbor authentication mode. Can be **"oidc_auth"** or **"db_auth"**. (Default: **"db_auth"**)
28+
29+
* **oidc_name** - (Optional) The name of the oidc provider name. (Required - if auth_mode set to **oidc_auth**)
30+
31+
* **oidc_endpoint** - (Optional) The URL of an OIDC-complaint server. (Required - if auth_mode set to **oidc_auth**)
32+
33+
* **oidc_client_id** - (Optional) The client id for the oidc server. (Required - if auth_mode set to **oidc_auth**)
34+
35+
* **oidc_client_serect** - (Optional) The client secret for the oidc server. (Required - if auth_mode set to **oidc_auth**)
36+
37+
* **oidc_groups_claim** - (Optional) The name of the claim in the token whose values is the list of group names.
38+
39+
`NOTE: "oidc_groups_claim" can only be used with harbor version v1.10.1 and above`
40+
41+
* **oidc_scope** - (Optional) The scope sent to OIDC server during authentication. It has to contain “openid”. (Required - if auth_mode set to **oidc_auth**)
42+
43+
* **oidc_verify_cert** - (Optional) Set to **"false"** if your OIDC server is using a self-signed certificate. (Required - if auth_mode set to **oidc_auth**)

docs/resources/harbor_label.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Resource: harbor_label
2+
3+
Harbor Doc: [Managing Labels](https://goharbor.io/docs/1.10/working-with-projects/working-with-images/create-labels/)
4+
Harbor Api: [/labels](https://demo.goharbor.io/#/Products/post_labels)
5+
6+
## Example Usage
7+
8+
```hcl
9+
resource "harbor_label" "main" {
10+
name = "testlabel-acc-classic"
11+
description = "Test Label"
12+
color = "#61717D"
13+
scope = "g"
14+
}
15+
16+
data "harbor_project" "project_1" {
17+
name = "main"
18+
}
19+
20+
resource "harbor_label" "project_label" {
21+
name = "projectlabel-acc-classic"
22+
description = "Test Label for Project"
23+
color = "#333333"
24+
scope = "p"
25+
project_id = data.harbor_project.project_1.id
26+
}
27+
```
28+
29+
## Argument Reference
30+
31+
The following arguments are required:
32+
33+
* `name` - (Required) Name of the Project.
34+
35+
The following arguments are optional:
36+
37+
* `description` - (Optional) The description of the label account will be displayed in harbor.
38+
39+
* `color` - (Optional) The colour the label.
40+
41+
* `scope` - (Optional) The scope the label, `p` for project and `g` for global.
42+
43+
* `project_id` - (Optional) The ID of project that the label belongs to, must be set if scope project.
44+
45+
## Attributes Reference
46+
47+
In addition to all argument, the following attributes are exported:
48+
49+
* `id` - The id of the registry with harbor.
50+
51+
## Import
52+
53+
Harbor Projects can be imported using the `harbor_label`, e.g.
54+
55+
```sh
56+
terraform import harbor_label.helmhub 1
57+
```

docs/resources/harbor_project.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
subcategory: "project"
3+
page_title: "Harbor: harbor_project"
4+
description: |-
5+
Manages an Harbor Project
6+
---
7+
8+
# Resource: harbor_project
9+
10+
Handle a [Harbor Project Resource](https://goharbor.io/docs/1.10/working-with-projects/create-projects/).
11+
12+
## Example Usage
13+
14+
```hcl
15+
resource "harbor_project" "main" {
16+
name = "main"
17+
public = false # (Optional) Default value is false
18+
vulnerability_scanning = true # (Optional) Default value is true. Automatically scan images on push
19+
reuse_sys_cve_whitelist = false # (Optional) Default value is true.
20+
cve_whitelist = ["CVE-2020-12345", "CVE-2020-54321"]
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
The following arguments are required:
27+
28+
* `name` - (Required) Name of the Project.
29+
30+
The following arguments are optional:
31+
32+
* `public` - (Optional) Handle the access to the hosted images. Default: `true`
33+
34+
If `true` Any user can pull images from this project. This is a convenient way for you to share repositories with others.
35+
36+
If `false` Only users who are members of the project can pull images
37+
38+
* `vulnerability_scanning` - (Optional) Activate [Vulnerability Scanning](https://goharbor.io/docs/1.10/administration/vulnerability-scanning/). Default: `true`
39+
40+
* `reuse_sys_cve_whitelist` - (Optional) Whether this project should reuse the system level CVE whitelist as the whitelist of its own. Default: `true`
41+
42+
If `true` The whitelist associated with this project will be ignored.
43+
44+
If `false` The project will use the whitelist defined by `cve_whitelist`.
45+
46+
* `cve_whitelist` - (Optional) List of whitelisted CVE ids for the project.
47+
48+
## Attributes Reference
49+
50+
In addition to all arguments above, the following attributes are exported:
51+
52+
* `id` - Harbor Project ID.
53+
54+
## Import
55+
56+
Harbor Projects can be imported using the `harbor_project`, e.g.
57+
58+
```
59+
$ terraform import harbor_project.main 1
60+
```

0 commit comments

Comments
 (0)