Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler.sullivan committed Sep 2, 2020
0 parents commit 654e973
Show file tree
Hide file tree
Showing 49 changed files with 3,372 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @tyler-technologies/tcp-infrastructure
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

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.14

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Build
uses: goreleaser/[email protected]
with:
version: latest
args: release --snapshot --skip-validate --skip-publish
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: release

on:
push:
tags:
- 'v*.*.*'

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.14

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Release
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
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.14

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.12.28
terraform_wrapper: false

- name: Build
uses: goreleaser/[email protected]
with:
version: latest
args: release --snapshot --skip-validate --skip-publish --skip-sign

- name: Run test
run: make test
env:
GIT_AUTHOR_NAME: "Gitfile Provider"
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_NAME: "Gitfile Provider"
GIT_COMMITTER_EMAIL: "[email protected]"
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.terraform/**
terraform-provider-gitfile
# test/test_*/example.git
# test/test_*/checkout
test/test_*/terraform.tfstate.backup
test/test_*/terraform.d
test/test_*/terraform.tfstate
test/test_*/.terraform/**
dist/
*.log
60 changes: 60 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
project_name: terraform-provider-gitfile
before:
hooks:
- go mod download
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
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.lintTool": "golangci-lint"
}
50 changes: 50 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
GOPATH := $(shell go env | grep GOPATH | sed 's/GOPATH="\(.*\)"/\1/')
PATH := $(GOPATH)/bin:$(PATH)
export $(PATH)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
TEST_DESTS := $(dir $(wildcard ./test/*/*_test.go))

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

fetch: ## download makefile dependencies
@hash goreleaser 2>/dev/null || go get -u -v github.com/goreleaser/goreleaser

clean: ## cleans previously built binaries
rm -rf ./dist
@cd test && $(MAKE) clean

publish: clean fetch ## publishes assets
@if [ "${GITHUB_TOKEN}" == "" ]; then\
echo "GITHUB_TOKEN is not set";\
exit 1;\
fi
@if [ "$(GIT_BRANCH)" != "master" ]; then\
echo "Current branch is: '$(GIT_BRANCH)'. Please publish from 'master'";\
exit 1;\
fi
git tag -a $(VERSION) -m "$(MESSAGE)"
git push --follow-tags
$(GOPATH)/bin/goreleaser

build: clean fetch ## publishes in dry run mode
$(GOPATH)/bin/goreleaser release --snapshot --skip-validate --skip-publish --skip-sign


.PHONY: test copyplugins

copyplugins: ## copy plugins to test folders
$(eval OS_DIRS := $(dir $(wildcard ./dist/terraform-provider-gitfile*/*)))
$(eval OS_ARCH := $(patsubst ./dist/terraform-provider-gitfile_%/, %, $(OS_DIRS)))
@sleep 1
@for f in $(TEST_DESTS); do \
for o in $(OS_ARCH); do \
mkdir -p $$f/terraform.d/plugins/$$o; \
cp ./dist/terraform-provider-gitfile_$$o/* $$f/terraform.d/plugins/$$o; \
done; \
done

test: copyplugins ## test
@cd test && $(MAKE) test

fulltest: build test ## build and test
Loading

0 comments on commit 654e973

Please sign in to comment.