Skip to content

Commit

Permalink
pipeline update (#72)
Browse files Browse the repository at this point in the history
* generate docs

* Commit from GitHub Actions

* checkin the generated docs to the current build branch

Co-authored-by: nolte <[email protected]>
  • Loading branch information
nolte and nolte authored Sep 27, 2020
1 parent 37a331d commit 50aaf45
Show file tree
Hide file tree
Showing 17 changed files with 793 additions and 35 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/cicd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
with:
go-version: ^1.14
id: go

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
Expand All @@ -28,6 +31,29 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install MarkdownPP mkdocs
- name: Install dependencies
run: |
cd ./documentation && go run mage.go -v GenerateDocumation
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
with:
add: 'docs'
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
with:
add: 'documentation/provider_doc'
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: install golangci-lint
run: |
curl -sSfL \
Expand Down
32 changes: 1 addition & 31 deletions .github/workflows/cicd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,13 @@ jobs:
steps:
- name: Checkout master
uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install MarkdownPP mkdocs
- name: Install dependencies
run: |
cd ./documentation && go run mage.go -v GenerateDocumation
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
with:
add: 'docs'
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
with:
add: 'documentation/provider_doc'
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gorelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: test provider
run: |
Expand Down
30 changes: 30 additions & 0 deletions docs/data-sources/harbor_label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Data Source: harbor_label

## Example Usage

```hcl
data "harbor_label" "label_1" {
name = "testlabel-acc-classic"
scope = "g"
}
data "harbor_label" "label_2" {
id = 4
}
```

## Argument Reference

- `id` - (Optional, int) ID of the label.
- `name` - (Optional, string) Name of the label.
- `scope` - (Optional, string) Scope of the label.

## Attributes Reference

- `id` - (int) Unique ID of the label.
- `name` - (string) Name of the label.
- `description` - (Optional) The description of the label account will be displayed in harbor.
- `color` - (Optional) The colour the label.
- `scope` - (Optional) The scope the label, `p` for project and `g` for global.
- `project_id` - (Optional) The ID of project that the label belongs to.
24 changes: 24 additions & 0 deletions docs/data-sources/harbor_project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Data Source: harbor_project

## Example Usage

```hcl
data "harbor_project" "project_1" {
name = "main"
}
data "harbor_project" "project_2" {
id = 4
}
```

## Argument Reference

- `id` - (Optional, int) ID of the project.
- `name` - (Optional, string) Name of the project.

## Attributes Reference

- `id` - (int) Unique ID of the project.
- `name` - (string) Name of the project.
24 changes: 24 additions & 0 deletions docs/data-sources/harbor_registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Data Source: harbor_registry

## Example Usage

```hcl
data "harbor_registry" "registry_1" {
name = "dockerhub-acc-classic"
}
data "harbor_registry" "registry_2" {
id = 4
}
```

## Argument Reference

- `id` - (Optional, string) ID of the registry.
- `name` - (Optional, string) Name of the registry.

## Attributes Reference

- `id` - (int) Unique ID of the registry.
- `name` - (string) Name of the registry.
26 changes: 26 additions & 0 deletions docs/resources/harbor_config_system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: "harbor"
#subcategory: "config"
page_title: "Harbor: harbor_config_system"
description: |-
Manages an Base Harbor System Configuration
---

# Resource: harbor_config_system

## Example Usage
```
resource "harbor_config_system" "main" {
project_creation_restriction = "adminonly"
robot_token_expiration = 5259492
}
```

## Argument Reference
The following arguments are supported:

* **project_creation_restriction** - (Optional) Who can create projects within Harbor. Can be **"adminonly"** or **"everyone"**

* **robot_token_expiration** - (Optional) The amount of time in minutes a robot account will expiry.

`NOTE: If the time is set to high you will get a 500 internal server error message when creating robot accounts`
43 changes: 43 additions & 0 deletions docs/resources/harbor_configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
subcategory: "config"
page_title: "Harbor: harbor_config_auth"
description: |-
Manages an Base Harbor Auth Configuration
---


# Resource: harbor_config_auth

## Example Usage
```
resource "harbor_config_auth" "oidc" {
auth_mode = "oidc_auth"
oidc_name = "azure"
oidc_endpoint = "https://login.microsoftonline.com/{GUID goes here}/v2.0"
oidc_client_id = "OIDC Client ID goes here"
oidc_client_secret = "ODDC Client Secret goes here"
oidc_scope = "openid,email"
oidc_verify_cert = true
}
```

## Argument Reference
The following arguments are supported:

* **auth_mode** - (Required) Harbor authentication mode. Can be **"oidc_auth"** or **"db_auth"**. (Default: **"db_auth"**)

* **oidc_name** - (Optional) The name of the oidc provider name. (Required - if auth_mode set to **oidc_auth**)

* **oidc_endpoint** - (Optional) The URL of an OIDC-complaint server. (Required - if auth_mode set to **oidc_auth**)

* **oidc_client_id** - (Optional) The client id for the oidc server. (Required - if auth_mode set to **oidc_auth**)

* **oidc_client_serect** - (Optional) The client secret for the oidc server. (Required - if auth_mode set to **oidc_auth**)

* **oidc_groups_claim** - (Optional) The name of the claim in the token whose values is the list of group names.

`NOTE: "oidc_groups_claim" can only be used with harbor version v1.10.1 and above`

* **oidc_scope** - (Optional) The scope sent to OIDC server during authentication. It has to contain “openid”. (Required - if auth_mode set to **oidc_auth**)

* **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**)
57 changes: 57 additions & 0 deletions docs/resources/harbor_label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Resource: harbor_label

Harbor Doc: [Managing Labels](https://goharbor.io/docs/1.10/working-with-projects/working-with-images/create-labels/)
Harbor Api: [/labels](https://demo.goharbor.io/#/Products/post_labels)

## Example Usage

```hcl
resource "harbor_label" "main" {
name = "testlabel-acc-classic"
description = "Test Label"
color = "#61717D"
scope = "g"
}
data "harbor_project" "project_1" {
name = "main"
}
resource "harbor_label" "project_label" {
name = "projectlabel-acc-classic"
description = "Test Label for Project"
color = "#333333"
scope = "p"
project_id = data.harbor_project.project_1.id
}
```

## Argument Reference

The following arguments are required:

* `name` - (Required) Name of the Project.

The following arguments are optional:

* `description` - (Optional) The description of the label account will be displayed in harbor.

* `color` - (Optional) The colour the label.

* `scope` - (Optional) The scope the label, `p` for project and `g` for global.

* `project_id` - (Optional) The ID of project that the label belongs to, must be set if scope project.

## Attributes Reference

In addition to all argument, the following attributes are exported:

* `id` - The id of the registry with harbor.

## Import

Harbor Projects can be imported using the `harbor_label`, e.g.

```sh
terraform import harbor_label.helmhub 1
```
60 changes: 60 additions & 0 deletions docs/resources/harbor_project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
subcategory: "project"
page_title: "Harbor: harbor_project"
description: |-
Manages an Harbor Project
---

# Resource: harbor_project

Handle a [Harbor Project Resource](https://goharbor.io/docs/1.10/working-with-projects/create-projects/).

## Example Usage

```hcl
resource "harbor_project" "main" {
name = "main"
public = false # (Optional) Default value is false
vulnerability_scanning = true # (Optional) Default value is true. Automatically scan images on push
reuse_sys_cve_whitelist = false # (Optional) Default value is true.
cve_whitelist = ["CVE-2020-12345", "CVE-2020-54321"]
}
```

## Argument Reference

The following arguments are required:

* `name` - (Required) Name of the Project.

The following arguments are optional:

* `public` - (Optional) Handle the access to the hosted images. Default: `true`

If `true` Any user can pull images from this project. This is a convenient way for you to share repositories with others.

If `false` Only users who are members of the project can pull images

* `vulnerability_scanning` - (Optional) Activate [Vulnerability Scanning](https://goharbor.io/docs/1.10/administration/vulnerability-scanning/). Default: `true`

* `reuse_sys_cve_whitelist` - (Optional) Whether this project should reuse the system level CVE whitelist as the whitelist of its own. Default: `true`

If `true` The whitelist associated with this project will be ignored.

If `false` The project will use the whitelist defined by `cve_whitelist`.

* `cve_whitelist` - (Optional) List of whitelisted CVE ids for the project.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `id` - Harbor Project ID.

## Import

Harbor Projects can be imported using the `harbor_project`, e.g.

```
$ terraform import harbor_project.main 1
```
Loading

0 comments on commit 50aaf45

Please sign in to comment.