-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,990 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: golangci | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
go_lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.30 | ||
|
||
go_test: | ||
name: golang test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Go modules | ||
run: go mod download | ||
- name: Run Test | ||
run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: paultyng/[email protected] | ||
env: | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
PASSPHRASE: ${{ secrets.PASSPHRASE }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
run: | ||
deadline: 10m | ||
|
||
issues: | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gocritic | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- nakedret | ||
- misspell | ||
- typecheck | ||
- unused | ||
- unconvert | ||
- unparam | ||
- varcheck | ||
- vet | ||
- vetshadow | ||
|
||
linters-settings: | ||
errcheck: | ||
ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close | ||
misspell: | ||
ignore-words: | ||
- hdinsight | ||
- exportfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Visit https://goreleaser.com for documentation on how to customize this | ||
# behavior. | ||
before: | ||
hooks: | ||
# this is just an example and not a requirement for provider building/publishing | ||
- 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: | ||
- freebsd | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: '{{ .ProjectName }}_{{ .Version }}' | ||
archives: | ||
- format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
signs: | ||
- artifacts: checksum | ||
args: | ||
# if you are using this is a GitHub action or some other automated pipeline, you | ||
# need to pass the batch flag to indicate its not interactive . | ||
- "--batch" | ||
- "--local-user" | ||
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
release: | ||
# If you want to manually examine the release before its live, uncomment this line: | ||
# draft: true | ||
changelog: | ||
skip: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ifndef VERBOSE | ||
MAKEFLAGS += --no-print-directory | ||
endif | ||
|
||
default: install | ||
|
||
.PHONY: install lint unit | ||
|
||
OS_ARCH=linux_amd64 | ||
HOSTNAME=registry.terraform.io | ||
NAMESPACE=Kaginari | ||
NAME=mongodb | ||
VERSION=0.0.1 | ||
## on linux base os | ||
TERRAFORM_PLUGINS_DIRECTORY=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
|
||
|
||
install: | ||
mkdir -p ${TERRAFORM_PLUGINS_DIRECTORY} | ||
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME} | ||
cd examples && rm -rf .terraform | ||
cd examples && make init | ||
re-install: | ||
rm -f ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME} | ||
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME} | ||
cd examples && rm -rf .terraform | ||
cd examples && make init | ||
lint: | ||
golangci-lint run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Terraform Provider Mongodb | ||
|
||
This repository is a Algolia Mongodb for [Terraform](https://www.terraform.io). | ||
|
||
### Requirements | ||
|
||
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13 | ||
- [Go](https://golang.org/doc/install) >= 1.15 | ||
|
||
### Installation | ||
|
||
1. Clone the repository | ||
1. Enter the repository directory | ||
1. Build the provider using the `make install` command: | ||
|
||
````bash | ||
git clone https://github.com/Kaginari/terraform-provider-mongodb | ||
cd terraform-provider-mongodb | ||
make install | ||
```` | ||
|
||
### To test locally | ||
|
||
**1: lunch mongo instance** | ||
````bash | ||
cd docker | ||
docker-compose up -d | ||
```` | ||
**2: Build the provider** | ||
|
||
follow the [Installation](#Installation) | ||
|
||
**3: Use the provider** | ||
|
||
````bash | ||
cd mongodb | ||
make apply | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: '3.1' | ||
|
||
networks: | ||
network: | ||
driver: bridge | ||
|
||
services: | ||
mongo: | ||
container_name: mongo | ||
image: mongo:3.6 | ||
restart: always | ||
environment: | ||
- MONGODB_USER:admin | ||
- MONGODB_PASS:all0.1EN2.3ce | ||
- MONGODB_DATABASE=admin | ||
volumes: | ||
- mongo_data:/data/db | ||
ports: | ||
- 27017:27017 | ||
networks: | ||
- network | ||
mongo-express: | ||
image: mongo-express | ||
container_name: mongo-express | ||
ports: | ||
- 8081:8081 | ||
environment: | ||
ME_CONFIG_BASICAUTH_USERNAME: admin | ||
ME_CONFIG_BASICAUTH_PASSWORD: all0.1EN2.3ce | ||
ME_CONFIG_MONGODB_SERVER: mongo | ||
ME_CONFIG_MONGODB_PORT: 27017 | ||
ME_CONFIG_MONGODB_ADMINUSERNAME: admin | ||
ME_CONFIG_MONGODB_ADMINPASSWORD: all0.1EN2.3ce | ||
links: | ||
- mongo:mongo | ||
networks: | ||
- network | ||
depends_on: | ||
- mongo | ||
volumes: | ||
mongo_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WiredTiger | ||
WiredTiger 3.1.1: (July 12, 2018) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
WiredTiger lock file |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.