Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raghu0891 committed Nov 18, 2024
0 parents commit 53e5f9b
Show file tree
Hide file tree
Showing 149 changed files with 10,553 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: gomod
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
open-pull-requests-limit: 10
62 changes: 62 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Linting
on:
push:

jobs:
golangci:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
- uses: goplugin/[email protected]
id: go-version
- run: echo ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.golang_version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3

vulnerabilities-check:
name: Check for Vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
- uses: goplugin/[email protected]
id: go-version
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.golang_version }}
- name: Write Go List
run: go list -json -deps ./... > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@main

helm-template-check:
name: Verify Helm Template Formats
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
- uses: goplugin/[email protected]
id: tool-versions
- uses: azure/[email protected]
with:
version: ${{ steps.tool-versions.outputs.helm_version }}
- name: Check templates
run: make lint_helm_templates

actionlint:
name: Validate Github Action Workflows
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
- name: Install asdf dependencies
uses: asdf-vm/actions/[email protected]
- name: Run actionlint
run: actionlint
23 changes: 23 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Static Analysis
on:
push:
branches: ["master"]
schedule:
- cron: "23 19 * * 4"
jobs:
codeQL:
name: CodeQL Checks
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
29 changes: 29 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Release a tag"
on:
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: goplugin/[email protected]
id: go-version
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.golang_version }}
- name: Unshallow
run: git fetch --prune --unshallow

- name: Create release
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.DS_Store
environment/charts/mockserver-config/static/initializerJson.json

# Hardhat config that might sneak through
node_modules/
package-lock.json
package.json
artifacts/
envcli

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# JUnit Test Reports
junit.xml

logs/
bin/

# ide
.vscode/
*.idea

# Test yaml files
/*.yaml

# Testing log dumps
environment/test-artifacts/
charts-test-file.json

# goreleaser build
dist
57 changes: 57 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
project_name: helmenv

release:
github:
owner: goplugin
name: helmenv

builds:
- binary: envcli
goos:
- darwin
- windows
- linux
goarch:
- amd64
- arm64
goarm:
- 6
- 7
gomips:
- hardfloat
env:
- CGO_ENABLED=0
main: cmd/cli/envcli.go
flags:
- -trimpath
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}

archives:
- format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- LICENSE
- README.md

snapshot:
name_template: SNAPSHOT-{{ .Commit }}

checksum:
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'

changelog:
sort: asc
filters:
exclude:
- '(?i)^docs?:'
- '(?i)^docs\([^:]+\):'
- '(?i)^docs\[[^:]+\]:'
- '^tests?:'
- '(?i)^dev:'
- '^build\(deps\): bump .* in /docs \(#\d+\)'
- Merge pull request
- Merge branch
1 change: 1 addition & 0 deletions .nancy-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CVE-2018-1714 # Helm bug regarding privilege management that we don't care about for out purposes
7 changes: 7 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
golang 1.18.2
golangci-lint 1.46.1
k3d 5.4.1
act 0.2.26
helm 3.8.2
actionlint 1.6.12
shellcheck 0.8.0
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2022 SmartContract Plugin, Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
BIN_DIR = bin
export GOPATH ?= $(shell go env GOPATH)
export GO111MODULE ?= on

LINUX=LINUX
OSX=OSX
WINDOWS=WIN32
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG = $(WINDOWS)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OSFLAG = $(LINUX)
endif
ifeq ($(UNAME_S),Darwin)
OSFLAG = $(OSX)
endif
endif

.PHONY: lint
lint: ## run linter
golangci-lint --color=always run ./... -v

lint_helm_templates:
./scripts/debug_helm.sh

.PHONY: test
test: # run all programmatic interaction tests
go test -v -p 5 ./...

.PHONY: install_cli
install_cli: # installs CLI
go install cmd/cli/envcli.go

install_tools:
ifeq ($(OSFLAG),$(WINDOWS))
echo "If you are running windows and know how to install what is needed, please contribute by adding it here!"
exit 1
endif
ifeq ($(OSFLAG),$(LINUX))
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${BIN_DIR} v$(shell cat ./.tool-versions | grep golangci-lint | sed -En "s/golangci-lint.(.*)/\1/p")
# TODO: golang, k3d, act
endif
ifeq ($(OSFLAG),$(OSX))
brew install asdf
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git || true
asdf plugin add k3d https://github.com/spencergilbert/asdf-k3d.git || true
asdf plugin add act https://github.com/grimoh/asdf-act.git || true
asdf plugin add golangci-lint https://github.com/hypnoglow/asdf-golangci-lint.git || true
asdf plugin-add helm https://github.com/Antiarchitect/asdf-helm.git || true
asdf plugin add actionlint || true
asdf plugin add shellcheck || true
asdf install
endif
Loading

0 comments on commit 53e5f9b

Please sign in to comment.