Port to GitHub actions & publish to Terraform registry (#39)

* Port to GitHub actions

* Fix

* Make docs terraform registry compatible
This commit is contained in:
Gavin Bunney
2021-07-14 17:47:45 -07:00
committed by GitHub
parent 4adaea3109
commit 0b0d03cda2
55 changed files with 265 additions and 7652 deletions

92
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: "Build"
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up GO 1.16.x
uses: actions/setup-go@v1
with:
go-version: '1.16'
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Build
run: make build
test:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up GO 1.16.x
uses: actions/setup-go@v1
with:
go-version: '1.16'
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Run tests
run: make test
testacc:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up GO 1.16.x
uses: actions/setup-go@v1
with:
go-version: '1.16'
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Environment
run: make ci-build-setup
- name: Start bitbucket server
run: make bitbucket-start
- name: Run acceptance tests
run: BITBUCKET_SERVER=http://localhost:7990 BITBUCKET_USERNAME=admin BITBUCKET_PASSWORD=admin make testacc
- name: Stop bitbucket server
run: make bitbucket-stop
fmtcheck:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up GO 1.16.x
uses: actions/setup-go@v1
with:
go-version: '1.16'
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Format check
run: make fmtcheck
vet:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up GO 1.16.x
uses: actions/setup-go@v1
with:
go-version: '1.16'
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Run vet
run: make vet

40
.github/workflows/tag.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Upload assets
uses: actions/upload-artifact@v2
with:
path: dist/*

View File

@@ -1 +0,0 @@
1.12.7

46
.goreleaser.yml Normal file
View File

@@ -0,0 +1,46 @@
before:
hooks:
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- id: zip
format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args:
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
draft: false

View File

@@ -1,40 +0,0 @@
services:
- docker
language: go
sudo: required
go:
- "1.12.x"
dist: xenial
env:
- GOPROXY=https://gocenter.io
install:
- bash scripts/gogetcookie.sh
script:
- bash scripts/start-docker-compose.sh
- make build
- BITBUCKET_SERVER=http://localhost:7990 BITBUCKET_USERNAME=admin BITBUCKET_PASSWORD=admin make testacc
after_success:
- bash <(curl -s https://codecov.io/bash)
matrix:
fast_finish: true
allow_failures:
- go: tip
before_deploy:
- make build-binaries
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: oB4MFNo958H/bknOkG+yTQ68V0A95xRJPk8xUIrfbL+n1OJIaR3577YpVi64I/kYCxSdjSh3c99p1DP7+hKBDF8B7CQ+slVtAGh5zQ6cWsv5PDX3CWN26fixIUV2/uTdn1FWDrW9a+2JVfhBfoW/H68KtdPp6L7ZD4cgUHRlgO9buzw0Nxvuom7Aii4lg0LyxjbqEckubR/tExVu3P0k16W8LVv/ZnI7P6oqsczgGJvn4EOZw1KiKprhmdTuWELBDr9ShjMBFCyi04cSn/Ar7JG9DPUE1xxo1MNmHvckGBzFXbYOTKik3qQ0olwG3XeAhyoNIfce3siWjVIfPm9F2491sAbCXka5H7UmJkqw7k6eR4UtrS6Zeolti/4ioT/7rJcyO438Za6xYQmtkBPBCE2mAWSw/b42QGbsi5PPnRBYID5Solx+74Fx855/TMqJXpHm6Qq3/+zIatBRbVqyzzJsdI8rUA6gqudE4DN9w50qOYENP2WxodbORuzW7wZzK0Eyl2XkzJ1osfr824eM7FekUZqyIDhH9VnD044itqcE5xhYI1mz84AY0vGCPB0DbJZH+qrM9e39huL/CoauN/FgOBFoH9e/g5K+bTSZSUFKh3BIG6moBNS8apDoa5+c8c7/A3U2Ero2F4Y6v2sLK36w7sCUmhyPHPowAwZf7yw=
file_glob: true
file: bin/*
on:
repo: gavinbunney/terraform-provider-bitbucketserver
tags: true

View File

@@ -25,11 +25,17 @@ testacc: fmtcheck
ulimit -n 1024; TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -count=1 ulimit -n 1024; TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -count=1
testacc-bitbucket: fmtcheck testacc-bitbucket: fmtcheck
@sh scripts/start-docker-compose.sh @bash scripts/start-docker-compose.sh
#The ulimit command is required to allow the tests to open more than the default 256 files as set on MacOS. The tests will fail without this. It must be done as one #The ulimit command is required to allow the tests to open more than the default 256 files as set on MacOS. The tests will fail without this. It must be done as one
#command otherwise the setting is lost #command otherwise the setting is lost
ulimit -n 1024; TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -count=1 ulimit -n 1024; TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -count=1
@sh scripts/stop-docker-compose.sh @bash scripts/stop-docker-compose.sh
bitbucket-start:
@bash scripts/start-docker-compose.sh
bitbucket-stop:
@bash scripts/stop-docker-compose.sh
vet: vet:
@echo "go vet ." @echo "go vet ."
@@ -44,13 +50,13 @@ fmt:
gofmt -w $(GOFMT_FILES) gofmt -w $(GOFMT_FILES)
fmtcheck: fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" @bash -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
errcheck: errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'" @bash -c "'$(CURDIR)/scripts/errcheck.sh'"
build-binaries: build-binaries:
@sh -c "'$(CURDIR)/scripts/build.sh'" @bash -c "'$(CURDIR)/scripts/build.sh'"
test-compile: test-compile:
@if [ "$(TEST)" = "./..." ]; then \ @if [ "$(TEST)" = "./..." ]; then \
@@ -60,11 +66,11 @@ test-compile:
fi fi
go test -c $(TEST) $(TESTARGS) go test -c $(TEST) $(TESTARGS)
website-serve: ci-build-setup:
@cd docusaurus/website && npm start sudo rm /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
bash scripts/gogetcookie.sh
website-publish: .PHONY: build test testacc vet fmt fmtcheck errcheck test-compile build-binaries ci-build-setup bitbucket-start bitbucket-stop
@cd docusaurus/website && npm run build
@cd docusaurus/website && CURRENT_BRANCH=master USE_SSH=true npm run publish-gh-pages
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile build-binaries website-serve website-publish

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_application_properties
id: data_bitbucketserver_application_properties
title: bitbucketserver_application_properties
---
This data source allows you to retrieve version information and other application properties of Bitbucket Server. This data source allows you to retrieve version information and other application properties of Bitbucket Server.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_cluster
id: data_bitbucketserver_cluster
title: bitbucketserver_cluster
---
Gets information about the nodes that currently make up the Bitbucket cluster. Gets information about the nodes that currently make up the Bitbucket cluster.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_global_permissions_groups
id: data_bitbucketserver_global_permissions_groups
title: bitbucketserver_global_permissions_groups
---
Retrieve a list of groups that have been granted at least one global permission. Retrieve a list of groups that have been granted at least one global permission.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_group_users
id: data_bitbucketserver_group_users
title: bitbucketserver_group_users
---
Retrieve a list of users for a specific group. Retrieve a list of users for a specific group.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_groups
id: data_bitbucketserver_groups
title: bitbucketserver_groups
---
This data source allows you to retrieve a list of groups, optionally matching the supplied `filter`. This data source allows you to retrieve a list of groups, optionally matching the supplied `filter`.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_plugin
id: data_bitbucketserver_plugin
title: bitbucketserver_plugin
---
This data source allows you to retrieve installed plugin information and license details. This data source allows you to retrieve installed plugin information and license details.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_project_hooks
id: data_bitbucketserver_project_hooks
title: bitbucketserver_project_hooks
---
Retrieve a list of project hooks and their status' for the specified project. Retrieve a list of project hooks and their status' for the specified project.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_project_permissions_groups
id: data_bitbucketserver_project_permissions_groups
title: bitbucketserver_project_permissions_groups
---
Retrieve a list of groups that have been granted at least one project level permission to the specified project. Retrieve a list of groups that have been granted at least one project level permission to the specified project.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_project_permissions_users
id: data_bitbucketserver_project_permissions_users
title: bitbucketserver_project_permissions_users
---
Retrieve a list of users that have been granted at least one permission for the specified project. Retrieve a list of users that have been granted at least one permission for the specified project.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_repository_hooks
id: data_bitbucketserver_repository_hooks
title: bitbucketserver_repository_hooks
---
Retrieve a list of repository hooks and their status' for the specified repo. Retrieve a list of repository hooks and their status' for the specified repo.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_repository_permissions_groups
id: data_bitbucketserver_repository_permissions_groups
title: bitbucketserver_repository_permissions_groups
---
Retrieve a list of groups that have been granted at least one repository level permission to the specified repo. Retrieve a list of groups that have been granted at least one repository level permission to the specified repo.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_repository_permissions_users
id: data_bitbucketserver_repository_permissions_users
title: bitbucketserver_repository_permissions_users
---
Retrieve a list of users that have been granted at least one permission for the specified repository. Retrieve a list of users that have been granted at least one permission for the specified repository.

View File

@@ -1,7 +1,4 @@
--- # Data Source: bitbucketserver_user
id: data_bitbucketserver_user
title: bitbucketserver_user
---
This data source allows you to retrieve Bitbucket user details. This data source allows you to retrieve Bitbucket user details.

View File

@@ -1,33 +1,54 @@
--- # Bitbucket Server Provider
id: provider
title: Getting Started
---
[Bitbucket Server](https://www.atlassian.com/software/bitbucket) is the self-hosted version of Bitbucket. [Bitbucket Server](https://www.atlassian.com/software/bitbucket) is the self-hosted version of Bitbucket.
Whilst terraform provides a default bitbucket provider, this only works for _Bitbucket Cloud_ - this provider Whilst terraform provides a default bitbucket provider, this only works for _Bitbucket Cloud_ - this provider
unlocks the power of terraform to manage your self-hosted Bitbucket Server instance. unlocks the power of terraform to manage your self-hosted Bitbucket Server instance.
## Provider Installation ## Installation
### Terraform 0.13+
### Install latest version The provider can be installed and managed automatically by Terraform. Sample `versions.tf` file :
```hcl
terraform {
required_version = ">= 0.13"
required_providers {
bitbucketserver = {
source = "gavinbunney/bitbucketserver"
}
}
}
```
### Terraform 0.12
#### Install latest version
The following one-liner script will fetch the latest provider version and download it to your `~/.terraform.d/plugins` directory. The following one-liner script will fetch the latest provider version and download it to your `~/.terraform.d/plugins` directory.
```bash ```bash
$ mkdir -p ~/.terraform.d/plugins && \ $ mkdir -p ~/.terraform.d/plugins && \
curl -Ls https://api.github.com/repos/gavinbunney/terraform-provider-bitbucketserver/releases/latest \ curl -Ls https://api.github.com/repos/gavinbunney/terraform-provider-bitbucketserver/releases/latest \
| jq -r ".assets[] | select(.browser_download_url | contains(\"$(uname -s | tr A-Z a-z)\")) | select(.browser_download_url | contains(\"amd64\")) | .browser_download_url" \ | jq -r ".assets[] | select(.browser_download_url | contains(\"$(uname -s | tr A-Z a-z)\")) | select(.browser_download_url | contains(\"amd64\")) | .browser_download_url" \
| xargs -n 1 curl -Lo ~/.terraform.d/plugins/terraform-provider-bitbucketserver && \ | xargs -n 1 curl -Lo ~/.terraform.d/plugins/terraform-provider-bitbucketserver.zip && \
chmod +x ~/.terraform.d/plugins/terraform-provider-bitbucketserver pushd ~/.terraform.d/plugins/ && \
unzip ~/.terraform.d/plugins/terraform-provider-bitbucketserver.zip -d terraform-provider-bitbucketserver-tmp && \
mv terraform-provider-bitbucketserver-tmp/terraform-provider-bitbucketserver* . && \
chmod +x terraform-provider-bitbucketserver* && \
rm -rf terraform-provider-bitbucketserver-tmp && \
rm -rf terraform-provider-bitbucketserver.zip && \
popd
``` ```
### Install manually #### Install manually
If you don't want to use the one-liner above, you can download a binary for your system from the [release page](https://github.com/gavinbunney/terraform-provider-bitbucketserver/releases) and remove the `-os-arch` details so you're left with `terraform-provider-bitbucketserver`. If you don't want to use the one-liner above, you can download a binary for your system from the [release page](https://github.com/gavinbunney/terraform-provider-bitbucketserver/releases),
Use `chmod +x` to make it executable and then either place it at the root of your Terraform folder or in the Terraform plugin folder on your system. then either place it at the root of your Terraform folder or in the Terraform plugin folder on your system.
## Provider Configuration
## Configuration
The provider supports parameters to determine the bitbucket server and admin user/password to use. The provider supports parameters to determine the bitbucket server and admin user/password to use.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_banner
id: bitbucketserver_banner
title: bitbucketserver_banner
---
Manage the announcement banner, updating as required. Manage the announcement banner, updating as required.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_default_reviewers_condition
id: bitbucketserver_default_reviewers_condition
title: bitbucketserver_default_reviewers_condition
---
Create a default reviewers condition for project or repository. Create a default reviewers condition for project or repository.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_global_permissions_group
id: bitbucketserver_global_permissions_group
title: bitbucketserver_global_permissions_group
---
Set global permissions for a given group. Set global permissions for a given group.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_global_permissions_user
id: bitbucketserver_global_permissions_user
title: bitbucketserver_global_permissions_user
---
Set global permissions for a given user. Set global permissions for a given user.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_group
id: bitbucketserver_group
title: bitbucketserver_group
---
Create a Bitbucket group. Create a Bitbucket group.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_license
id: bitbucketserver_license
title: bitbucketserver_license
---
Set the license for the bitbucket server. Set the license for the bitbucket server.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_mail_server
id: bitbucketserver_mail_server
title: bitbucketserver_mail_server
---
Setup mail server configuration. Setup mail server configuration.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_plugin
id: bitbucketserver_plugin
title: bitbucketserver_plugin
---
Install plugins, manage enabled state and set license details. Install plugins, manage enabled state and set license details.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_plugin_config
id: bitbucketserver_plugin_config
title: bitbucketserver_plugin_config
---
Configure plugins. Configure plugins.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_project
id: bitbucketserver_project
title: bitbucketserver_project
---
Create a Bitbucket Project to hold repositories. Create a Bitbucket Project to hold repositories.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_project_hook
id: bitbucketserver_project_hook
title: bitbucketserver_project_hook
---
Manage a project level hook. Extends what Bitbucket does every time a repository changes, for example when code is pushed or a pull request is merged. Manage a project level hook. Extends what Bitbucket does every time a repository changes, for example when code is pushed or a pull request is merged.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_project_permissions_group
id: bitbucketserver_project_permissions_group
title: bitbucketserver_project_permissions_group
---
Set project level permissions for a given group. Set project level permissions for a given group.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_project_permissions_user
id: bitbucketserver_project_permissions_user
title: bitbucketserver_project_permissions_user
---
Set project permissions for a given user. Set project permissions for a given user.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_repository
id: bitbucketserver_repository
title: bitbucketserver_repository
---
Create a Bitbucket Repository. Create a Bitbucket Repository.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_repository_hook
id: bitbucketserver_repository_hook
title: bitbucketserver_repository_hook
---
Manage a repository level hook. Extends what Bitbucket does every time a repository changes, for example when code is pushed or a pull request is merged. Manage a repository level hook. Extends what Bitbucket does every time a repository changes, for example when code is pushed or a pull request is merged.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_repository_permissions_group
id: bitbucketserver_repository_permissions_group
title: bitbucketserver_repository_permissions_group
---
Set repository level permissions for a given group. Set repository level permissions for a given group.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_repository_permissions_user
id: bitbucketserver_repository_permissions_user
title: bitbucketserver_repository_permissions_user
---
Set repository permissions for a given user. Set repository permissions for a given user.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_user
id: bitbucketserver_user
title: bitbucketserver_user
---
Create a Bitbucket user. Create a Bitbucket user.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_user_access_token
id: bitbucketserver_user_access_token
title: bitbucketserver_user_access_token
---
Personal access tokens can be used to replace passwords over https, or to authenticate using the Bitbucket Server REST API over Basic Auth. Personal access tokens can be used to replace passwords over https, or to authenticate using the Bitbucket Server REST API over Basic Auth.

View File

@@ -1,7 +1,4 @@
--- # Resource: bitbucketserver_user_group
id: bitbucketserver_user_group
title: bitbucketserver_user_group
---
Assign a User to an existing Bitbucket Group. Assign a User to an existing Bitbucket Group.

View File

@@ -1,2 +0,0 @@
*/node_modules
*.log

View File

@@ -1,10 +0,0 @@
FROM node:8.11.4
WORKDIR /app/website
EXPOSE 3000 35729
COPY ./docs /app/docs
COPY ./website /app/website
RUN yarn install
CMD ["yarn", "start"]

View File

@@ -1,18 +0,0 @@
version: "3"
services:
docusaurus:
build: .
ports:
- 3000:3000
- 35729:35729
volumes:
- ./docs:/app/docs
- ./website/blog:/app/website/blog
- ./website/core:/app/website/core
- ./website/i18n:/app/website/i18n
- ./website/pages:/app/website/pages
- ./website/static:/app/website/static
- ./website/sidebars.json:/app/website/sidebars.json
- ./website/siteConfig.js:/app/website/siteConfig.js
working_dir: /app/website

View File

@@ -1,193 +0,0 @@
This website was created with [Docusaurus](https://docusaurus.io/).
# What's In This Document
* [Get Started in 5 Minutes](#get-started-in-5-minutes)
* [Directory Structure](#directory-structure)
* [Editing Content](#editing-content)
* [Adding Content](#adding-content)
* [Full Documentation](#full-documentation)
# Get Started in 5 Minutes
1. Make sure all the dependencies for the website are installed:
```sh
# Install dependencies
$ yarn
```
2. Run your dev server:
```sh
# Start the site
$ yarn start
```
## Directory Structure
Your project file structure should look something like this
```
my-docusaurus/
docs/
doc-1.md
doc-2.md
doc-3.md
website/
blog/
2016-3-11-oldest-post.md
2017-10-24-newest-post.md
core/
node_modules/
pages/
static/
css/
img/
package.json
sidebar.json
siteConfig.js
```
# Editing Content
## Editing an existing docs page
Edit docs by navigating to `docs/` and editing the corresponding document:
`docs/doc-to-be-edited.md`
```markdown
---
id: page-needs-edit
title: This Doc Needs To Be Edited
---
Edit me...
```
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
## Editing an existing blog post
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
`website/blog/post-to-be-edited.md`
```markdown
---
id: post-needs-edit
title: This Blog Post Needs To Be Edited
---
Edit me...
```
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
# Adding Content
## Adding a new docs page to an existing sidebar
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
```md
---
id: newly-created-doc
title: This Doc Needs To Be Edited
---
My new content here..
```
1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`:
```javascript
// Add newly-created-doc to the Getting Started category of docs
{
"docs": {
"Getting Started": [
"quick-start",
"newly-created-doc" // new doc here
],
...
},
...
}
```
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
## Adding a new blog post
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
`website/siteConfig.js`
```javascript
headerLinks: [
...
{ blog: true, label: 'Blog' },
...
]
```
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
`website/blog/2018-05-21-New-Blog-Post.md`
```markdown
---
author: Frank Li
authorURL: https://twitter.com/foobarbaz
authorFBID: 503283835
title: New Blog Post
---
Lorem Ipsum...
```
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
## Adding items to your site's top navigation bar
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
`website/siteConfig.js`
```javascript
{
headerLinks: [
...
/* you can add docs */
{ doc: 'my-examples', label: 'Examples' },
/* you can add custom pages */
{ page: 'help', label: 'Help' },
/* you can add external links */
{ href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
...
],
...
}
```
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
## Adding custom pages
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
`website/siteConfig.js`
```javascript
{
headerLinks: [
...
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
...
],
...
}
```
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
# Full Documentation
Full documentation can be found on the [website](https://docusaurus.io/).

View File

@@ -1,20 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
class Footer extends React.Component {
render() {
return (
<footer className="nav-footer" id="footer">
<section className="copyright">{this.props.config.copyright}</section>
</footer>
);
}
}
module.exports = Footer;

View File

@@ -1,128 +0,0 @@
{
"_comment": "This file is auto-generated by write-translations.js",
"localized-strings": {
"next": "Next",
"previous": "Previous",
"docs": {
"data_bitbucketserver_application_properties": {
"title": "bitbucketserver_application_properties"
},
"data_bitbucketserver_cluster": {
"title": "bitbucketserver_cluster"
},
"data_bitbucketserver_global_permissions_groups": {
"title": "bitbucketserver_global_permissions_groups"
},
"data_bitbucketserver_global_permissions_users": {
"title": "bitbucketserver_global_permissions_users"
},
"data_bitbucketserver_group_users": {
"title": "bitbucketserver_group_users"
},
"data_bitbucketserver_groups": {
"title": "bitbucketserver_groups"
},
"data_bitbucketserver_plugin": {
"title": "bitbucketserver_plugin"
},
"data_bitbucketserver_project_hooks": {
"title": "bitbucketserver_project_hooks"
},
"data_bitbucketserver_project_permissions_groups": {
"title": "bitbucketserver_project_permissions_groups"
},
"data_bitbucketserver_project_permissions_users": {
"title": "bitbucketserver_project_permissions_users"
},
"data_bitbucketserver_repository_hooks": {
"title": "bitbucketserver_repository_hooks"
},
"data_bitbucketserver_repository_permissions_groups": {
"title": "bitbucketserver_repository_permissions_groups"
},
"data_bitbucketserver_repository_permissions_users": {
"title": "bitbucketserver_repository_permissions_users"
},
"data_bitbucketserver_user": {
"title": "bitbucketserver_user"
},
"provider": {
"title": "Getting Started"
},
"bitbucketserver_banner": {
"title": "bitbucketserver_banner"
},
"bitbucketserver_default_reviewers_condition": {
"title": "bitbucketserver_default_reviewers_condition"
},
"bitbucketserver_global_permissions_group": {
"title": "bitbucketserver_global_permissions_group"
},
"bitbucketserver_global_permissions_user": {
"title": "bitbucketserver_global_permissions_user"
},
"bitbucketserver_group": {
"title": "bitbucketserver_group"
},
"bitbucketserver_license": {
"title": "bitbucketserver_license"
},
"bitbucketserver_mail_server": {
"title": "bitbucketserver_mail_server"
},
"bitbucketserver_plugin_config": {
"title": "bitbucketserver_plugin_config"
},
"bitbucketserver_plugin": {
"title": "bitbucketserver_plugin"
},
"bitbucketserver_project_hook": {
"title": "bitbucketserver_project_hook"
},
"bitbucketserver_project_permissions_group": {
"title": "bitbucketserver_project_permissions_group"
},
"bitbucketserver_project_permissions_user": {
"title": "bitbucketserver_project_permissions_user"
},
"bitbucketserver_project": {
"title": "bitbucketserver_project"
},
"bitbucketserver_repository_hook": {
"title": "bitbucketserver_repository_hook"
},
"bitbucketserver_repository_permissions_group": {
"title": "bitbucketserver_repository_permissions_group"
},
"bitbucketserver_repository_permissions_user": {
"title": "bitbucketserver_repository_permissions_user"
},
"bitbucketserver_repository": {
"title": "bitbucketserver_repository"
},
"bitbucketserver_user_access_token": {
"title": "bitbucketserver_user_access_token"
},
"bitbucketserver_user_group": {
"title": "bitbucketserver_user_group"
},
"bitbucketserver_user": {
"title": "bitbucketserver_user"
}
},
"links": {
"Releases": "Releases",
"GitHub": "GitHub"
},
"categories": {
"Bitbucket Server": "Bitbucket Server",
"Data Sources": "Data Sources",
"Resources": "Resources"
}
},
"pages-strings": {
"Help Translate|recruit community translators for your project": "Help Translate",
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
}
}

View File

@@ -1,17 +0,0 @@
{
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version"
},
"devDependencies": {
"docusaurus": "^1.14.4"
},
"dependencies": {
"kind-of": "^6.0.3"
}
}

View File

@@ -1,45 +0,0 @@
{
"docs": {
"Bitbucket Server": [
"provider"
],
"Data Sources": [
"data_bitbucketserver_application_properties",
"data_bitbucketserver_cluster",
"data_bitbucketserver_global_permissions_groups",
"data_bitbucketserver_global_permissions_users",
"data_bitbucketserver_group_users",
"data_bitbucketserver_groups",
"data_bitbucketserver_plugin",
"data_bitbucketserver_project_hooks",
"data_bitbucketserver_project_permissions_groups",
"data_bitbucketserver_project_permissions_users",
"data_bitbucketserver_repository_hooks",
"data_bitbucketserver_repository_permissions_groups",
"data_bitbucketserver_repository_permissions_users",
"data_bitbucketserver_user"
],
"Resources": [
"bitbucketserver_banner",
"bitbucketserver_default_reviewers_condition",
"bitbucketserver_global_permissions_group",
"bitbucketserver_global_permissions_user",
"bitbucketserver_group",
"bitbucketserver_license",
"bitbucketserver_mail_server",
"bitbucketserver_plugin",
"bitbucketserver_plugin_config",
"bitbucketserver_project",
"bitbucketserver_project_hook",
"bitbucketserver_project_permissions_group",
"bitbucketserver_project_permissions_user",
"bitbucketserver_repository",
"bitbucketserver_repository_hook",
"bitbucketserver_repository_permissions_group",
"bitbucketserver_repository_permissions_user",
"bitbucketserver_user",
"bitbucketserver_user_access_token",
"bitbucketserver_user_group"
]
}
}

View File

@@ -1,61 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.
const siteConfig = {
title: 'Bitbucket Server Terraform Provider',
url: 'https://gavinbunney.github.io',
baseUrl: '/terraform-provider-bitbucketserver/',
projectName: 'terraform-provider-bitbucketserver',
organizationName: 'gavinbunney',
editUrl: 'https://github.com/gavinbunney/terraform-provider-bitbucketserver/edit/master/docusaurus/docs/',
// For no header links in the top nav bar -> headerLinks: [],
headerLinks: [
{ href: "https://github.com/gavinbunney/terraform-provider-bitbucketserver/releases", label: "Releases" },
{ href: "https://github.com/gavinbunney/terraform-provider-bitbucketserver", label: "GitHub" },
],
/* path to images for header/footer */
favicon: 'img/favicon.png',
/* Colors for website */
colors: {
primaryColor: '#5C4EE5',
secondaryColor: '#66246c',
},
usePrism: ['yaml', 'js', 'bash', 'sh', 'hcl'],
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
copyright: `Copyright © ${new Date().getFullYear()} Gavin Bunney`,
highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks.
theme: 'default',
},
// Add custom scripts here that would be placed in <script> tags.
scripts: ['https://buttons.github.io/buttons.js'],
stylesheets: [
"https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i,900,900i&display=swap"
],
// On page navigation for the current documentation page.
onPageNav: 'separate',
// No .html extensions for paths.
cleanUrl: true,
docsSideNavCollapsible: true,
};
module.exports = siteConfig;

View File

@@ -1,39 +0,0 @@
/* your custom css */
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
}
@media only screen and (min-width: 1024px) {
}
@media only screen and (max-width: 1023px) {
}
@media only screen and (min-width: 1400px) {
.separateOnPageNav .wrapper, .separateOnPageNav .headerWrapper.wrapper {
max-width: 1600px;
}
}
@media only screen and (min-width: 1500px) {
}
@media only screen and (min-width: 1700px) {
.separateOnPageNav .wrapper, .separateOnPageNav .headerWrapper.wrapper {
max-width: 1800px;
}
}
@media only screen and (min-width: 1024px) {
.separateOnPageNav .docsNavContainer {
flex: 0 0 300px;
}
}
body {
font-family: "Lato", "sans-serif";
}
.toc .toggleNav ul li a {
font-size: 13px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=docs/provider.html">
<script type="text/javascript">
window.location.href = 'docs/provider.html';
</script>
<title>Bitbucket Server Terraform Provider</title>
</head>
<body>
If you are not redirected automatically, follow this <a href="docs/provider.html">link</a>.
</body>
</html>

File diff suppressed because it is too large Load Diff

2
go.mod
View File

@@ -2,4 +2,4 @@ module github.com/gavinbunney/terraform-provider-bitbucketserver
require github.com/hashicorp/terraform v0.12.2 require github.com/hashicorp/terraform v0.12.2
go 1.13 go 1.16