Changing the default content

main
Tom Peltonen 2025-06-17 07:36:38 +10:00
parent e0613700c5
commit 8a0528977c
4 changed files with 446 additions and 10 deletions

View File

@ -4,11 +4,25 @@
"description": "devops default template",
"templates": [
{
"engine": "",
"folder": "{{.SelfFolder}}/definitions/{{.TemplateName}}",
"engine": "",
"folder": "{{.SelfFolder}}/definitions/{{.TemplateName}}/.well-known",
"file_name": "devops.json",
"output_folder": "^/.well-known",
"output_name": "devops.json"
}
},
{
"engine": "",
"folder": "{{.SelfFolder}}/definitions/{{.TemplateName}}/.well-known",
"file_name": "qaskx-config.yaml",
"output_folder": "^/.well-known",
"output_name": "qaskx-config.yaml"
},
{
"engine": "",
"folder": "{{.SelfFolder}}/definitions/{{.TemplateName}}/build",
"file_name": "*",
"output_folder": "^/build",
"output_name": ""
}
]
}

View File

@ -89,10 +89,8 @@
},
"deploy": [
{
"commands": {
"platform": "",
"script": ""
},
"platform": "",
"script": "",
"deploy": {
"category": "DEPLOY",
"name": "rpm",
@ -114,17 +112,17 @@
"owner": {
"contacts": [
{
"address": "qaskx.slack.com",
"address": "CHANGE.ME.slack.com",
"name": "SLACK"
},
{
"address": "@qaskx:qaskx.one",
"address": "@CHANGE.MME:qaskx.one",
"name": "MATRIX"
}
],
"email": "{{.OwnerEmail}}",
"name": "{{.OwnerName}}",
"web": "https://"
"web": "https://CHANGE.ME"
},
"repository": {
"source": {

View File

@ -0,0 +1,377 @@
app:
name: Example CHANGE.ME Application
version: 0.0.1
rediops:
depend: ""
generator_handlers:
generators: {}
run:
container:
engine: docker
templates:
cache_off: false
fall_back: null
root_folder: ""
groups: {}
logger:
provider: ""
log_level_base: ""
log_level: 1
log_writer: ""
log_path: ""
log_cmd_count: 0
vault_file: ""
file_format:
left_quote: ""
right_quote: ""
separator: ""
escape_match: ""
escape_value: ""
lock_modify: false
validation:
default_level: DETAIL
scan:
options:
skip_file: ""
regex_file: ""
skip_files: []
regex: []
activities:
engines:
- osEnvironment: windows
category: BUILD
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: BUILD
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: BUILD
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: BUILD
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: BUILD
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: BUILD
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: BUILD
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: BUILD
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: TEST
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: TEST
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: TEST
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: TEST
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: TEST
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: TEST
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: TEST
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: TEST
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: DEPLOY
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: DEPLOY
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: DEPLOY
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: DEPLOY
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: DEPLOY
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: DEPLOY
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: DEPLOY
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: DEPLOY
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: SOURCE
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: SOURCE
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: SOURCE
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: SOURCE
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: SOURCE
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: SOURCE
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: SOURCE
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: SOURCE
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: RELEASE
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: RELEASE
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: RELEASE
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: RELEASE
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: RELEASE
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: RELEASE
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: RELEASE
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: RELEASE
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: TOOL
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: TOOL
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: TOOL
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: TOOL
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: TOOL
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: TOOL
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: TOOL
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: TOOL
id: '*default'
name: ""
command: /bin/sh
option: -c
- osEnvironment: windows
category: REFRESH
id: '*default'
name: Default Windows engine
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: REFRESH
id: pwsh-command
name: ""
command: pwsh.exe
option: -Command
- osEnvironment: windows
category: REFRESH
id: pwsh-script
name: ""
command: pwsh.exe
option: -File
- osEnvironment: windows
category: REFRESH
id: cmd-command
name: ""
command: cmd.exe
option: ""
- osEnvironment: linux
category: REFRESH
id: '*default'
name: Default Linux engine
command: /bin/sh
option: -c
- osEnvironment: linux
category: REFRESH
id: pwsh-command
name: ""
command: pwsh
option: -Command
- osEnvironment: linux
category: REFRESH
id: pwsh-script
name: ""
command: pwsh
option: -File
- osEnvironment: darwin
category: REFRESH
id: '*default'
name: ""
command: /bin/sh
option: -c
git_embedded: false

View File

@ -0,0 +1,47 @@
param (
[Parameter(Mandatory=$true)][string] $OpenAPI
)
$startCd = Get-Location
$prjDir = qaskx-cli tools dir
if ($prjDir -eq "") {
Throw "No home project directory found"
}
Write-Host "Project home dir: $prjDir"
Set-Location $prjDir
# Fetch oapigen if it does not exist
$binFolder = Join-Path -Path $prjDir -Child "build"
$oapigenItem = Join-Path -Path $binFolder -Child "oapigen.exe"
if ( (Test-Path $oapigenItem -PathType Leaf) -eq $false) {
$binTmpFolder = "tmp"
$oapigenItem = Join-Path -Path $binTmpFolder -Child "oapigen.exe"
if ( (Test-Path $oapigenItem -PathType Leaf) -eq $false) {
# TODO: Download artefact
}
if ( (Test-Path $oapigenItem -PathType Leaf) -eq $false) {
throw "oapigen.exe not found nor downloaded"
}
}
$genFolder = Join-Path -Path $prjDir -ChildPath "internal/controller/http/api/gen"
if ( (Test-Path $genFolder -PathType Container) -eq $false) {
$genFolder = Join-Path -Path $genFolder -ChildPath "internal/controller/http/api"
New-Item -Path $genFolder -Name "gen" -ItemType Directory -Force
}
$configFile = Join-Path -Path $prjDir -ChildPath ".\build\types.cfg.yaml"
& $oapigenItem --config $configFile $OpenAPI
Write-Host "API type code generated"
$configFile = Join-Path -Path $prjDir -ChildPath ".\build\server.cfg.yaml"
& $oapigenItem --config $configFile $OpenAPI
Write-Host "API server code generated"
Set-Location $startCd
Write-Host "Generation complete. Please check logs." -ForegroundColor Yellow