Skip to content

Commit a400b87

Browse files
committed
initial commit from private repository
1 parent 790ac8f commit a400b87

File tree

2,259 files changed

+717552
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,259 files changed

+717552
-15
lines changed

.env.template

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TOKEN=<dbapitoken for int test>
2+
HOST=<host for integration test>
3+
ARM_CLIENT_ID=<enterprise app client id>
4+
ARM_CLIENT_SECRET=<enterprise app secret>
5+
ARM_TENANT_ID=<active directory tenant id>
6+
ARM_SUBSCRIPTION_ID=<subscription id in which the workspace is being built>
7+
TEST_MANAGED_RESOURCE_GROUP=<managed resource group id for integration testing>
8+
TEST_WORKSPACE_NAME=<workspace name for integration testing>
9+
TEST_RESOURCE_GROUP=<workspace resource group for integration testing>

.gitignore

+323
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
2+
# Created by https://www.gitignore.io/api/go,python,terraform,virtualenv,pycharm+iml,intellij+all,visualstudiocode
3+
# Edit at https://www.gitignore.io/?templates=go,python,terraform,virtualenv,pycharm+iml,intellij+all,visualstudiocode
4+
5+
### Go ###
6+
# Binaries for programs and plugins
7+
*.exe
8+
*.exe~
9+
*.dll
10+
*.so
11+
*.dylib
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
22+
### Go Patch ###
23+
#/vendor/
24+
/Godeps/
25+
26+
### Intellij+all ###
27+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
28+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
29+
30+
# User-specific stuff
31+
.idea/**/workspace.xml
32+
.idea/**/tasks.xml
33+
.idea/**/usage.statistics.xml
34+
.idea/**/dictionaries
35+
.idea/**/shelf
36+
37+
# Generated files
38+
.idea/**/contentModel.xml
39+
40+
# Sensitive or high-churn files
41+
.idea/**/dataSources/
42+
.idea/**/dataSources.ids
43+
.idea/**/dataSources.local.xml
44+
.idea/**/sqlDataSources.xml
45+
.idea/**/dynamic.xml
46+
.idea/**/uiDesigner.xml
47+
.idea/**/dbnavigator.xml
48+
49+
# Gradle
50+
.idea/**/gradle.xml
51+
.idea/**/libraries
52+
53+
# Gradle and Maven with auto-import
54+
# When using Gradle or Maven with auto-import, you should exclude module files,
55+
# since they will be recreated, and may cause churn. Uncomment if using
56+
# auto-import.
57+
# .idea/modules.xml
58+
# .idea/*.iml
59+
# .idea/modules
60+
# *.iml
61+
# *.ipr
62+
63+
# CMake
64+
cmake-build-*/
65+
66+
# Mongo Explorer plugin
67+
.idea/**/mongoSettings.xml
68+
69+
# File-based project format
70+
*.iws
71+
72+
# IntelliJ
73+
out/
74+
75+
# mpeltonen/sbt-idea plugin
76+
.idea_modules/
77+
78+
# JIRA plugin
79+
atlassian-ide-plugin.xml
80+
81+
# Cursive Clojure plugin
82+
.idea/replstate.xml
83+
84+
# Crashlytics plugin (for Android Studio and IntelliJ)
85+
com_crashlytics_export_strings.xml
86+
crashlytics.properties
87+
crashlytics-build.properties
88+
fabric.properties
89+
90+
# Editor-based Rest Client
91+
.idea/httpRequests
92+
93+
# Android studio 3.1+ serialized cache file
94+
.idea/caches/build_file_checksums.ser
95+
96+
### Intellij+all Patch ###
97+
# Ignores the whole .idea folder and all .iml files
98+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
99+
100+
.idea/
101+
102+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
103+
104+
*.iml
105+
modules.xml
106+
.idea/misc.xml
107+
*.ipr
108+
109+
# Sonarlint plugin
110+
.idea/sonarlint
111+
112+
### PyCharm+iml ###
113+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
114+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
115+
116+
# User-specific stuff
117+
118+
# Generated files
119+
120+
# Sensitive or high-churn files
121+
122+
# Gradle
123+
124+
# Gradle and Maven with auto-import
125+
# When using Gradle or Maven with auto-import, you should exclude module files,
126+
# since they will be recreated, and may cause churn. Uncomment if using
127+
# auto-import.
128+
# .idea/modules.xml
129+
# .idea/*.iml
130+
# .idea/modules
131+
# *.iml
132+
# *.ipr
133+
134+
# CMake
135+
136+
# Mongo Explorer plugin
137+
138+
# File-based project format
139+
140+
# IntelliJ
141+
142+
# mpeltonen/sbt-idea plugin
143+
144+
# JIRA plugin
145+
146+
# Cursive Clojure plugin
147+
148+
# Crashlytics plugin (for Android Studio and IntelliJ)
149+
150+
# Editor-based Rest Client
151+
152+
# Android studio 3.1+ serialized cache file
153+
154+
### PyCharm+iml Patch ###
155+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
156+
157+
158+
### Python ###
159+
# Byte-compiled / optimized / DLL files
160+
__pycache__/
161+
*.py[cod]
162+
*$py.class
163+
164+
# C extensions
165+
166+
# Distribution / packaging
167+
.Python
168+
build/
169+
develop-eggs/
170+
dist/
171+
downloads/
172+
eggs/
173+
.eggs/
174+
lib/
175+
lib64/
176+
parts/
177+
sdist/
178+
var/
179+
wheels/
180+
pip-wheel-metadata/
181+
share/python-wheels/
182+
*.egg-info/
183+
.installed.cfg
184+
*.egg
185+
MANIFEST
186+
187+
# PyInstaller
188+
# Usually these files are written by a python script from a template
189+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
190+
*.manifest
191+
*.spec
192+
193+
# Installer logs
194+
pip-log.txt
195+
pip-delete-this-directory.txt
196+
197+
# Unit test / coverage reports
198+
htmlcov/
199+
.tox/
200+
.nox/
201+
.coverage
202+
.coverage.*
203+
.cache
204+
nosetests.xml
205+
coverage.xml
206+
*.cover
207+
.hypothesis/
208+
.pytest_cache/
209+
210+
# Translations
211+
*.mo
212+
*.pot
213+
214+
# Scrapy stuff:
215+
.scrapy
216+
217+
# Sphinx documentation
218+
docs/_build/
219+
220+
# PyBuilder
221+
target/
222+
223+
# pyenv
224+
.python-version
225+
226+
# pipenv
227+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
228+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
229+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
230+
# install all needed dependencies.
231+
#Pipfile.lock
232+
233+
# celery beat schedule file
234+
celerybeat-schedule
235+
236+
# SageMath parsed files
237+
*.sage.py
238+
239+
# Spyder project settings
240+
.spyderproject
241+
.spyproject
242+
243+
# Rope project settings
244+
.ropeproject
245+
246+
# Mr Developer
247+
.mr.developer.cfg
248+
.project
249+
.pydevproject
250+
251+
# mkdocs documentation
252+
/site
253+
254+
# mypy
255+
.mypy_cache/
256+
.dmypy.json
257+
dmypy.json
258+
259+
# Pyre type checker
260+
.pyre/
261+
262+
### Terraform ###
263+
# Local .terraform directories
264+
**/.terraform/*
265+
266+
# .tfstate files
267+
*.tfstate
268+
*.tfstate.*
269+
270+
# Crash log files
271+
crash.log
272+
273+
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
274+
# .tfvars files are managed as part of configuration and so should be included in
275+
# version control.
276+
#
277+
# example.tfvars
278+
279+
# Ignore override files as they are usually used to override resources locally and so
280+
# are not checked in
281+
override.tf
282+
override.tf.json
283+
*_override.tf
284+
*_override.tf.json
285+
286+
# Include override files you do wish to add to version control using negated pattern
287+
# !example_override.tf
288+
289+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
290+
# example: *tfplan*
291+
292+
### VirtualEnv ###
293+
# Virtualenv
294+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
295+
pyvenv.cfg
296+
.env
297+
.venv
298+
env/
299+
venv/
300+
ENV/
301+
env.bak/
302+
venv.bak/
303+
pip-selfcheck.json
304+
305+
### VisualStudioCode ###
306+
.vscode/*
307+
!.vscode/settings.json
308+
!.vscode/tasks.json
309+
!.vscode/launch.json
310+
!.vscode/extensions.json
311+
312+
### VisualStudioCode Patch ###
313+
# Ignore all local history of files
314+
.history
315+
316+
# End of https://www.gitignore.io/api/go,python,terraform,virtualenv,pycharm+iml,intellij+all,visualstudiocode
317+
/terraform-provider-db
318+
/.vscode/
319+
320+
# Remove tfvars to prevent secrets from leaking and ignore any terraform files in root folder
321+
**/*.tfvars
322+
/*.tf
323+
.DS_Store

Makefile

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
default: build
2+
3+
test:
4+
@echo "==> Running tests..."
5+
@gotestsum --raw-command go test -v -json -short -coverprofile=coverage.out ./...
6+
7+
int:
8+
@echo "==> Running tests..."
9+
@gotestsum --raw-command go test -v -json -coverprofile=coverage.out ./...
10+
11+
coverage: test
12+
@echo "==> Opening coverage for unit tests..."
13+
@go tool cover -html=coverage.out
14+
15+
int-build: int build
16+
17+
build:
18+
@echo "==> Building source code with go build..."
19+
@go build -mod vendor -v -o terraform-provider-db
20+
21+
fmt:
22+
@echo "==> Formatting source code with gofmt..."
23+
@go fmt ./...
24+
25+
26+
python-setup:
27+
@echo "==> Setting up virtual env and installing python libraries..."
28+
@python -m pip install virtualenv
29+
@cd docs && python -m virtualenv venv
30+
@cd docs && source venv/bin/activate && python -m pip install -r requirements.txt
31+
32+
docs:
33+
@echo "==> Building Docs ..."
34+
@cd docs && source venv/bin/activate && make html
35+
36+
opendocs: docs
37+
@echo "==> Opening Docs ..."
38+
@cd docs && open build/html/index.html
39+
40+
vendor:
41+
@echo "==> Filling vendor folder with library code..."
42+
@go mod vendor
43+
44+
# INTEGRATION TESTING WITH TERRAFORM EXAMPLES
45+
terraform-setup: fmt build
46+
@echo "==> Initializing Terraform..."
47+
@terraform init
48+
49+
terraform-apply: terraform-setup
50+
@echo "==> Initializing Terraform plan..."
51+
@TF_LOG_PATH=log.out TF_LOG=debug terraform apply
52+
53+
.PHONY: build fmt python-setup docs vendor terraform-local build fmt coverage test

0 commit comments

Comments
 (0)