Giter Site home page Giter Site logo

kitos9112 / terragrunt-gitlab-cicd-config Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 6.0 16.07 MB

Produces a suitable .gitlab-ci.yml file from a Golang TXT Template to work as input for a parent/child triggered GitLab CICD pipeline.

Dockerfile 0.71% Makefile 5.11% Go 51.70% Smarty 2.19% HCL 40.29%
golang gitlab-ci gitlab terragrunt terraform cicd

terragrunt-gitlab-cicd-config's Introduction

terragrunt-gitlab-cicd-config

Heavily inspired on Terragrunt Atlantis Configuration - This will read a Terragrunt-like directory layout, interpret all local Terragrunt config blocks while parsing an input TXT Golang template that should effectively mimic a .gitlab-ci.yml file.

The actual input file should be a valid .gitlab-ci.yml file with Golang. An example can be found here

> terragrunt-gitlab-cicd-config --help
By taking a Golang TXT template file, it generates GitlabCI Config for Terragrunt IaC live style projects maintained in a mono-repo fashion.

Usage:
  terragrunt-gitlab-cicd-config [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  generate    Creates GitLab CICD Dynamic configuration
  help        Help about any command
  version     Version of terragrunt-gitlab-cicd-config

Flags:
  -h, --help               help for terragrunt-gitlab-cicd-config
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic (default "info")

Use "terragrunt-gitlab-cicd-config [command] --help" for more information about a command.

Get it

Using go get:

go get -u github.com/kitos9112/terragrunt-gitlab-cicd-config

Or download the binary from the releases page.

# Linux x86_64
curl -L https://github.com/kitos9112/terragrunt-gitlab-cicd-config/releases/download/2.0.1/terragrunt-gitlab-cicd-config_2.0.1_linux_x86_64.tar.gz | tar xz
# Linux arm64
curl -L https://github.com/kitos9112/terragrunt-gitlab-cicd-config/releases/download/2.0.1/terragrunt-gitlab-cicd-config_2.0.1_linux_arm64.tar.gz | tar xz

# OS X x86_64
curl -L https://github.com/kitos9112/terragrunt-gitlab-cicd-config/releases/download/2.0.1/terragrunt-gitlab-cicd-config_2.0.1_osx_x86_64.tar.gz | tar xz
# OS X arm64
curl -L https://github.com/kitos9112/terragrunt-gitlab-cicd-config/releases/download/2.0.1/terragrunt-gitlab-cicd-config_2.0.1_osx_arm64.tar.gz | tar xz

# Windows x86_64
curl -LO https://github.com/kitos9112/terragrunt-gitlab-cicd-config/releases/download/2.0.1/terragrunt-gitlab-cicd-config_2.0.1_windows_x86_64.zip
unzip terragrunt-gitlab-cicd-config_2.0.1_windows_x86_64.zip

Use it


terragrunt-gitlab-cicd-config [OPTIONS] [COMMAND [ARGS...]]

/bin/sh: terragrunt-gitlab-cicd-config: command not found

Examples

WIP

terragrunt-gitlab-cicd-config's People

Contributors

dependabot[bot] avatar jose9781 avatar kitos9112 avatar renovate-bot avatar renovate[bot] avatar syphernl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terragrunt-gitlab-cicd-config's Issues

Issues with release 2.1.0

It seems that:

  • The Github release doesn't contain assets (previous versions did)
  • The ghcr.io/kitos9112/terragrunt-gitlab-cicd-config:2.1.0 container reports that it is version 2.0.1, but ISTM that this is due to the fact that the version in Main.go hasn't been bumped

SIGSEGV: segmentation violation

Running this tool (v2.0.1) on my Terragrunt codebase I get the following:

...
DEBU[0007] Dealing with dependencyPath /app/infra/_envcommon/frontend/ecs-task.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/production/eu-west-1/ecr-frontend/terragrunt.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/_envcommon/frontend/ecr.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/production/eu-west-1/cloudfront-oai/terragrunt.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/production/eu-west-1/cloudfront-policies/terragrunt.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/_envcommon/cloudfront_policies.hcl 
DEBU[0007] Dealing with dependencyPath /app/infra/terraform.tfvars 
INFO[0007] Collected dependencies for /app/infra/production/eu-west-1/cloudfront/terragrunt.hcl 
ERRO[0007] open : no such file or directory             
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x53f2cc]

goroutine 1 [running]:
text/template.errRecover(0xc0007f37f8)
	/opt/homebrew/Cellar/go/1.19.5/libexec/src/text/template/exec.go:164 +0x165
panic({0x12c9e60, 0x2168d70})
	/opt/homebrew/Cellar/go/1.19.5/libexec/src/runtime/panic.go:884 +0x212
text/template.(*Template).execute(0x0, {0x180b840?, 0xc000308028?}, {0x1368500?, 0xc0006d1b90?})
	/opt/homebrew/Cellar/go/1.19.5/libexec/src/text/template/exec.go:215 +0x22c
text/template.(*Template).Execute(...)
	/opt/homebrew/Cellar/go/1.19.5/libexec/src/text/template/exec.go:201
github.com/kitos9112/terragrunt-gitlab-cicd-config/cmd.main(0x217c060?, {0x146b451?, 0x2?, 0x2?})
	/Users/marcos.soutullo/projects/home/github.com/kitos9112/terragrunt-gitlab-cicd-config/cmd/generate.go:551 +0x91c
github.com/spf13/cobra.(*Command).execute(0x217c060, {0xc00009aa60, 0x2, 0x2})
	/Users/marcos.soutullo/Go/pkg/mod/github.com/spf13/[email protected]/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x217c340)
	/Users/marcos.soutullo/Go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/marcos.soutullo/Go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/kitos9112/terragrunt-gitlab-cicd-config/cmd.Execute({0x146bf8b?, 0xc0000061a0?})
	/Users/marcos.soutullo/projects/home/github.com/kitos9112/terragrunt-gitlab-cicd-config/cmd/root.go:26 +0x51
main.main()
	/Users/marcos.soutullo/projects/home/github.com/kitos9112/terragrunt-gitlab-cicd-config/main.go:11 +0x27

Command:

terragrunt-gitlab-cicd-config generate  --verbosity trace

I have tried to run this on two codebases where we use terragrunt-atlantis-config, but both are giving the same output.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update module github.com/gruntwork-io/go-commons to v0.17.2
  • fix(deps): update module github.com/spf13/cobra to v1.8.1
  • chore(deps): update docker/build-push-action action to v6
  • chore(deps): update goreleaser/goreleaser-action action to v6
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/build.yml
  • golang 1.21-alpine
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/release.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-go v5
  • sigstore/cosign-installer v3.3.0
  • anchore/sbom-action v0.15.1
  • goreleaser/goreleaser-action v5
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action v3
  • docker/build-push-action v5
  • ubuntu 22.04
gomod
go.mod
  • go 1.21
  • github.com/Masterminds/sprig/v3 v3.2.3
  • github.com/gruntwork-io/go-commons v0.17.1
  • github.com/gruntwork-io/terragrunt v0.48.1
  • github.com/hashicorp/go-getter v1.7.3
  • github.com/hashicorp/hcl/v2 v2.19.1
  • github.com/hashicorp/terraform-config-inspect v0.0.0-20231204233900-a34142ec2a72@a34142ec2a72
  • github.com/sirupsen/logrus v1.9.3
  • github.com/spf13/cobra v1.8.0
  • github.com/zclconf/go-cty v1.14.1
  • golang.org/x/sync v0.5.0
npm
package.json

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.