-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial development * setup commands * add goreleaser config and release pipeline --------- Co-authored-by: Alessandro Cannarella <[email protected]> Co-authored-by: Omar El Malak <[email protected]>
- Loading branch information
1 parent
cc3f816
commit 547ff51
Showing
14 changed files
with
872 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Esegue build snapshot per ogni push su main | ||
tags: | ||
- 'v*' # Esegue una release ufficiale quando il tag inizia con 'v' | ||
|
||
env: | ||
GORELEASER_VERSION: v2.3.2 | ||
|
||
jobs: | ||
build: | ||
name: Build and Release for Supported Architectures | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout del codice | ||
- name: Checkout Repository | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
with: | ||
show-progress: false | ||
|
||
# Setup di Go | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23.2' | ||
|
||
# Installazione di GoReleaser | ||
- name: Install GoReleaser | ||
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 | ||
with: | ||
version: ${{ env.GORELEASER_VERSION }} | ||
install-only: true | ||
|
||
# Esecuzione di GoReleaser per snapshot build (su main) | ||
- name: Run GoReleaser (Snapshot) | ||
if: github.ref == 'refs/heads/main' | ||
run: goreleaser release --snapshot --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Esecuzione di GoReleaser per rilasci ufficiali (su tag) | ||
- name: Run GoReleaser (Release) | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: goreleaser release --clean --skip-validate --skip-publish=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Salva i binari come artefatti in snapshot build | ||
- name: Upload artifact (Snapshot) | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 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: 2 | ||
|
||
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 ./... | ||
|
||
builds: | ||
- main: ./cmd/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
- "386" | ||
goarm: | ||
- "6" | ||
- "7" | ||
|
||
archives: | ||
- format: binary | ||
name_template: >- | ||
{{ .Binary }}- | ||
{{- .Os }}- | ||
{{- .Arch }}{{ with .Arm }}v{{ . }}{{ end }} | ||
{{- with .Mips }}-{{ . }}{{ end }} | ||
{{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }} | ||
checksum: | ||
name_template: checksums.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,58 @@ | ||
# mipy | ||
Cli helper to help in IaC provisioning through the Console pipelines | ||
|
||
## Setup | ||
|
||
The mipy cli makes use of a configmap file as this one: | ||
```json | ||
{ | ||
"basePath": "string", | ||
"templates": [ | ||
{ | ||
"type": "enum", | ||
"id": "string", | ||
"cicdProvider": "string", // for now only "azure" is supported | ||
"cicdProviderBaseUrl": "string", | ||
"azureOrganization": "string", | ||
"azureProject": "string", | ||
"terraformPipelineId": "string" | ||
} | ||
], | ||
"logLevel": "string" | ||
} | ||
``` | ||
|
||
## Commands | ||
|
||
### version | ||
|
||
``` | ||
mipy version | ||
``` | ||
|
||
### help | ||
|
||
``` | ||
mipy help | ||
``` | ||
|
||
### config | ||
|
||
flags are: | ||
- get | ||
- set [PATH] | ||
- --help | ||
|
||
``` | ||
mipy config set mipy.json | ||
``` | ||
|
||
### launch | ||
|
||
flags are: | ||
- --environment (-e): required | ||
- --cr-list | ||
- --parallel | ||
- --error-code | ||
- --debug | ||
- --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2024-2024 Mipy Project | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/mia-platform/mipy/internal/cmd" | ||
) | ||
|
||
func main() { | ||
rootCmd := cmd.NewRootCommand() | ||
if err := rootCmd.Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
os.Exit(0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module github.com/mia-platform/mipy | ||
|
||
go 1.23.2 | ||
|
||
require github.com/mia-platform/miactl v0.15.0 | ||
|
||
require ( | ||
github.com/go-logr/logr v1.4.2 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/joho/godotenv v1.5.1 // indirect | ||
github.com/spf13/cobra v1.8.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= | ||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= | ||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= | ||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= | ||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= | ||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= | ||
github.com/mia-platform/miactl v0.15.0 h1:tCvFnkqMjit+Y7giZaF3ZVPXKvz1eG3Cen/CsXA4QfI= | ||
github.com/mia-platform/miactl v0.15.0/go.mod h1:QOflNDd0wdfmB6TvTe7XWG8KTDo7R5RVIlQvMqQY9DU= | ||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= | ||
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= | ||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= | ||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
Oops, something went wrong.