commit 94c046e7e754693893dae1ced09ecba3ffc44232 Author: Vojtech Mares Date: Sat Nov 27 13:02:19 2021 +0100 feat: initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..87a0020 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +max_line_length = null + +[Makefile] +indent_style = tab diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit new file mode 100755 index 0000000..ee6f633 --- /dev/null +++ b/.git-hooks/pre-commit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +make tf-fmt-check diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c035e72 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.terraform +.terraform.lock.hcl diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1101a8e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +include: + - project: mareshq/ci + file: terraform/modules.gitlab-ci.yml + ref: main + +variables: + TERRAFORM_MODULE_SYSTEM: gitlab diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..f00e742 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,19 @@ +verifyConditions: + - "@semantic-release/gitlab" +prepare: +generateNotes: + - "@semantic-release/release-notes-generator" +publish: + - "@semantic-release/gitlab" +success: false +fail: false +npmPublish: false +tagFormat: ${version} +plugins: + - - "@semantic-release/commit-analyzer" + - preset: angular + parserOpts: + - "BREAKING CHANGE" + - "BREAKING CHANGES" + - "BREAKING" + - - "@semantic-release/release-notes-generator" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7c9624e --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: setup-git-hooks +setup-git-hooks: + rm -rf .git/hooks + (cd .git && ln -s ../.git-hooks hooks) + +.PHONY: tf-fmt-check +tf-fmt-check: + terraform fmt -recursive -check + +.PHONY: tf-fmt +tf-fmt: + terraform fmt -recursive diff --git a/README.md b/README.md new file mode 100644 index 0000000..f99215c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Terraform modules / GitLab user + +[GitLab (gitlab.mareshq.com)](https://gitlab.mareshq.com) user diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..1ec7863 --- /dev/null +++ b/main.tf @@ -0,0 +1,6 @@ +resource "gitlab_user" "user" { + name = var.name + username = var.username + email = var.email + reset_password = true +} diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..fd29466 --- /dev/null +++ b/outputs.tf @@ -0,0 +1,3 @@ +output "id" { + value = gitlab_user.user.id +} diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..c7c9468 --- /dev/null +++ b/variables.tf @@ -0,0 +1,13 @@ +variable "name" { + type = string + description = "Example: John Doe" +} + +variable "username" { + type = string + description = "Example: johndoe_" +} + +variable "email" { + type = string +} diff --git a/versions.tf b/versions.tf new file mode 100644 index 0000000..cf880fc --- /dev/null +++ b/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + gitlab = { + source = "gitlabhq/gitlab" + version = ">=3.5.0" + } + } +}