Skip to content

Commit

Permalink
init/updateFortiTokenCloudTerraform: 1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: FTNT-HQCM <[email protected]>
  • Loading branch information
FTNT-HQCM committed Aug 2, 2024
1 parent 4ccc8eb commit 0dd16d5
Show file tree
Hide file tree
Showing 29 changed files with 3,530 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

dist/
examples/
.idea/
62 changes: 62 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
default:
image: dops-jfrog.fortinet-us.com/hqcm_dockers/hqcm-buildall:latest
tags: ["k8s-airgap-runner062123"]


variables:
PROXY: "https://dops-jfrog.fortinet-us.com/artifactory/api/go-proxy"
TAG_NAME: "latest"
DOCKER_REGISTRY_URL: "dops-registry.fortinet-us.com"
PROJECT_NAME: "terraform-provider-fortitokencloud"
NFS_FILE_PATH: "/nfs/Build_PKG/terraform-provider-fortitokencloud/build_artifacts"
BUILD_MAJOR: 1
BUILD_MINOR: 0
PATCH: 0
BN: 1


stages:
- lint
- build
- test
#- deploy
#- uploadartifacts #Need to upload artifacts to info.fortinet.com
#- update_eco_mantis # need to update eco and bugnote on info.fortinet.com and mantis.fortinet.com


lint-job:
stage: lint
script:
- cd ~ && source ./hqcm-init.sh
- cd $CI_PROJECT_DIR
- echo "I am in $(pwd)"
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)


go-build-job:
stage: build
before_script:
- cd ~ && source ./hqcm-init.sh
- cd $CI_PROJECT_DIR

script:
- mkdir -p binaries
- go build -o binaries ./...
- cp -r binaries /nfs/Build_PKG/$NFS_FILEPATH
artifacts:
paths:
- binaries


unit-tests:
stage: test
script:
- echo "Running unit tests..."
- sleep 60
- echo "100% of tests passed!"
only:
changes:
- "*.go"

9 changes: 9 additions & 0 deletions .gitlab/merge_request_templates/merge_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Purpose:

## Mantis:

## Description:

## Technical Description:

## Testing Done:
26 changes: 26 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Visit https://golangci-lint.run/ for usage documentation
# and information on other useful linters
issues:
max-per-linter: 0
max-same-issues: 0

linters:
disable-all: true
enable:
- durationcheck
- errcheck
- exportloopref
- forcetypeassert
- gofmt
- gosimple
- govet
- ineffassign
- makezero
- misspell
- nilerr
- predeclared
- staticcheck
- tenv
- unconvert
- unparam
- unused
61 changes: 61 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
project_name: terraform-provider-fortitokencloud
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 }}_v{{ .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 in 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}"

6 changes: 6 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
default: testacc

# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
Loading

0 comments on commit 0dd16d5

Please sign in to comment.