Initial commit, includes the README.md and the workflows for the repo.
This commit is contained in:
commit
4ebd3d8601
4 changed files with 122 additions and 0 deletions
9
.forgejo/package.json.tmpl
Normal file
9
.forgejo/package.json.tmpl
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "multi-semantic-release",
|
||||||
|
"version": "0.0.0-semantically-released",
|
||||||
|
"private": true,
|
||||||
|
"multi-release": {
|
||||||
|
"tagFormat": "${name}-v${version}"
|
||||||
|
},
|
||||||
|
"workspaces": {{ .applications | toJson }}
|
||||||
|
}
|
50
.forgejo/workflows/multi-semantic-release.yaml
Normal file
50
.forgejo/workflows/multi-semantic-release.yaml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
name: multi-semantic-release
|
||||||
|
|
||||||
|
# This monorepo only tags releases from the main branch
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
multi-semantic-release:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: forgejo.mixinet.net/oci/multi-semantic-release:latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Generate multi-semantic-release configuration
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
# Get the list of kustomize applications to work with (the folders that have a kustomization.yaml file)
|
||||||
|
applications="$(for app in */kustomization.yaml; do dirname "$app"; done)"
|
||||||
|
# Generate a values.yaml file for the main packages.json file
|
||||||
|
package_json_values_yaml=".package.json-values.yaml"
|
||||||
|
echo "applications:" >"$package_json_values_yaml"
|
||||||
|
for app in $applications; do
|
||||||
|
echo " - $app" >>"$package_json_values_yaml";
|
||||||
|
done
|
||||||
|
echo "::group::Generated values.yaml for the project"
|
||||||
|
cat "$package_json_values_yaml"
|
||||||
|
echo "::endgroup::"
|
||||||
|
# Generate the package.json file validating that is a good json file with jq
|
||||||
|
tmpl -f "$package_json_values_yaml" ".forgejo/package.json.tmpl" | jq . > "package.json"
|
||||||
|
echo "::group::Generated package.json for the project"
|
||||||
|
cat "package.json"
|
||||||
|
echo "::endgroup::"
|
||||||
|
# Remove the temporary values file
|
||||||
|
rm -f "$package_json_values_yaml"
|
||||||
|
# Generate the package.json file for each image
|
||||||
|
for app in $applications; do
|
||||||
|
tmpl -v "app_name=$app" -v "app_path=$app" ".forgejo/ws-package.json.tmpl" | jq . > "$app/package.json"
|
||||||
|
echo "::group::Generated package.json for the '$app' application"
|
||||||
|
cat "$app/package.json"
|
||||||
|
echo "::endgroup::"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Run multi-semantic-release
|
||||||
|
shell: sh
|
||||||
|
run: |
|
||||||
|
multi-semantic-release | tee .multi-semantic-release.log
|
57
.forgejo/ws-package.json.tmpl
Normal file
57
.forgejo/ws-package.json.tmpl
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
"name": "{{ .app_name }}",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"release": {
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
{
|
||||||
|
"preset": "conventionalcommits",
|
||||||
|
"releaseRules": [
|
||||||
|
{
|
||||||
|
"breaking": true,
|
||||||
|
"release": "major"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"revert": true,
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "feat",
|
||||||
|
"release": "minor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "fix",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "perf",
|
||||||
|
"release": "patch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"semantic-release-replace-plugin",
|
||||||
|
{
|
||||||
|
"replacements": [
|
||||||
|
{
|
||||||
|
"files": [ "{{ .app_path }}/msr.yaml" ],
|
||||||
|
"from": "^version:.*$",
|
||||||
|
"to": "version: ${nextRelease.version}",
|
||||||
|
"allowEmptyPaths": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/git",
|
||||||
|
{
|
||||||
|
"assets": [ "msr.yaml" ],
|
||||||
|
"message": "ci(release): {{ .app_name }}-v${nextRelease.version}\n\n${nextRelease.notes}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"branches": [ "main" ]
|
||||||
|
}
|
||||||
|
}
|
6
README.md
Normal file
6
README.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# ArgoCD Applications Repository
|
||||||
|
|
||||||
|
This repository contains [kustomize](https://kustomize.io/) application definitions to be used with `ArgoCD`.
|
||||||
|
|
||||||
|
The repository is a monorepo managed using [multi-semantic-release](https://github.com/qiwi/multi-semantic-release) to
|
||||||
|
allow us to reference specific versions of each application.
|
Loading…
Add table
Add a link
Reference in a new issue