Skip to content

Commit

Permalink
Setup sysdiglabs oracle TF repo (#1)
Browse files Browse the repository at this point in the history
Change summary:
-----------------
Initial commit setting up the repo for OCI.
  • Loading branch information
ravinadhruve10 authored Nov 25, 2024
1 parent b9da261 commit 1933c29
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/git-chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ range .Versions }} {{ range .CommitGroups -}}

{{ .Title }}
{{ range .Commits -}}

{{ if .Scope }}{{ .Scope }}: {{ end }}{{ .Subject }} {{ if .Body }}> {{ .Body }} {{ end }} {{ end }} {{ end -}}
{{- if .RevertCommits -}}

Reverts
{{ range .RevertCommits -}}

{{ .Revert.Header }} {{ end }} {{ end -}}
{{- if .NoteGroups -}} {{ range .NoteGroups -}}

{{ .Title }}
{{ range .Notes }} {{ .Body }} {{ end }} {{ end -}} {{ end -}} {{ end -}}
26 changes: 26 additions & 0 deletions .github/git-chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/sysdiglabs/terraform-oracle-secure
options:
commits:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
ci: Continuous Integration
docs: Documentation
chore: Small Modifications
build: Compilation & Dependencies
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
54 changes: 54 additions & 0 deletions .github/workflows/ci-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI - Pull Request

on:
pull_request:
branches:
- master
env:
GO_VERSION: "^1.20"

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
- run: make fmt

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Lint
run: make lint

build-and-test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Cache modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go install github.com/onsi/ginkgo/ginkgo@latest
- name: Test
run: make test
45 changes: 45 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "^1.15"

- name: Setup go-chglog
working-directory: /tmp
env:
VERSION: "0.10.0"
run: |
wget https://github.com/git-chglog/git-chglog/releases/download/v${VERSION}/git-chglog_${VERSION}_linux_amd64.tar.gz
gunzip git-chglog_${VERSION}_linux_amd64.tar.gz
tar -xvf git-chglog_${VERSION}_linux_amd64.tar
sudo mv git-chglog /usr/local/bin/
- name: Generate changelog
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Lock files
.terraform.lock.hcl
.terraform.tfstate.lock.info

# Ignore override files as they are usually used for local settings
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Ignore backup files
terraform.tfstate.backup

# Ignore crash log files
crash.log

# Ignore all .tfvars files, which are likely to contain sentitive data
*.tfvars

.envrc
.direnv
.DS_Store
.idea/
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @sysdiglabs/team-secure-onboarding
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing

## Scopes

When you need to use a scope in a commit message, use the directories under `pkg` as a reference
to specify the scope. Some suggestions:

- aws
- gcp
- azure
- oracle
- ...

## When opening a new PR

- The following **requirements** are checked in a PR:
- make build
- make test-unit
- make test-integration # These requires a real environment (`draios-demo`) and are slower than the others.
- make test-e2e
- make test-rules
- make lint

<!--
* We also use `pre-commit` plugin to automate this step, and **validate/detect** the issues when commiting from your local.
* When opening a PR, **an image will be built** in the [project packages section](https://github.com/orgs/sysdiglabs/packages?repo_name=cloud-connector), with the tag `pr-xxx`
-->

## Testing

It's recommended to use an .envrc file to keep environment variables under control. Check `.envrc.template` for a reference.

## Release

- push a new tag and the Github Action will draft a release (with notes)
Loading

0 comments on commit 1933c29

Please sign in to comment.