initial work on adding container CI

This commit is contained in:
Kjeld Schouten
2024-10-07 19:41:13 +02:00
parent 0c75709b3b
commit 82262d1b1d
9 changed files with 34 additions and 163 deletions
+21
View File
@@ -0,0 +1,21 @@
#/bin/bash
app="${1}"
if test -f "/containers/apps/${app}/latest-version.sh"; then
version=$(bash "/containers/apps/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "/containers/apps/${app}/VERSION" >/dev/null
echo "App: ${app} using version: ${version}"
fi
fi
if test -f "/containers/apps/${app}/BASE"; then
if test -f "/containers/apps/${app}/latest-base.sh"; then
base=$(bash "/containers/apps/${app}/latest-base.sh")
if [[ ! -z "${base}" || "${base}" != "null" ]]; then
echo "${base}" | tee "/containers/apps/${app}/BASE" >/dev/null
echo "App: ${app} using Base: ${base}"
fi
fi
fi
@@ -24,7 +24,7 @@ jobs:
- name: Containers - Fetch new application versions
run: |
find ./apps -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
bash ./.github/update-version-file.sh "${app}"
bash ./.github/scripts/update-version-file.sh "${app}"
done
- name: Commit and Push Housekeeping
@@ -24,8 +24,8 @@ jobs:
CT="Content-Type:application/json"
for group in apps dev mirror base; do
for i in ${group}/*; do
PLAIN=$( echo $i | cut -d'/' -f2 )
for i in containers/${group}/*; do
PLAIN=$( echo $i | cut -d'/' -f3 )
data='{"name":"tccr/'${PLAIN}'","backendUrl":"https://quay.io/tccr/'${PLAIN}'","longDescription":"","shortDescription":"example description","website":"https://truecharts.org","libraryType":"docker","publicUrl":"https://tccr.io/tccr/'${PLAIN}'"}'
url="https://scarf.sh/api/v1/packages"
-34
View File
@@ -1,34 +0,0 @@
---
labels:
- name: incomplete-template
labeled:
issue:
body: |
:wave: @{{ issue.user.login }}, please follow the template provided.
action: close
locking: lock
lock_reason: resolved
- name: support
labeled:
issue:
body: |
:wave: @{{ issue.user.login }}, we use the issue tracker exclusively
for bug reports and feature requests. However, this issue appears
to be a support request. Please use our support channels
to get help.
- [Docs](https://https://truecharts.org/)
- [Discord](https://discord.gg/tVsPTHWTtr)
action: close
- name: incomplete-docs
labeled:
pr:
body: |
:wave: @{{ pull_request.user.login }}, thanks for taking the time to submit this PR. 🙏🏽
We have noticed that the chart documentation has not been completely updated for this PR.
Could you please make sure that the following items have been updated:
- `version` in `Chart.yaml` has been updated per [semver](http://semver.org/)
- The `artifacthub.io/changes` chart annotation contains a summary of the updates for this new version. See [Artifact Hub documentation](https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations) for more info.
- [Documentation strings](https://github.com/norwoodj/helm-docs#valuesyaml-metadata) have been added to the keys in `values.yaml`.
-32
View File
@@ -1,32 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 45
# Number of days of inactivity before a stale Issue or Pull Request is closed.
daysUntilClose: 5
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- on-hold
- pinned
# Label to use when marking as stale
staleLabel: stale
issues:
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This Issue has been automatically marked as "stale" because it has not had recent activity (for 45 days). It will be closed if no further activity occurs. Thanks for the feedback.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
pulls:
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 45 days). It will be closed if no further activity occurs. Thank you for your contribution.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
-21
View File
@@ -1,21 +0,0 @@
#/bin/bash
app="${1}"
if test -f "/apps/${app}/latest-version.sh"; then
version=$(bash "/apps/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "/apps/${app}/VERSION" >/dev/null
echo "App: ${app} using version: ${version}"
fi
fi
if test -f "/apps/${app}/BASE"; then
if test -f "/apps/${app}/latest-base.sh"; then
base=$(bash "/apps/${app}/latest-base.sh")
if [[ ! -z "${base}" || "${base}" != "null" ]]; then
echo "${base}" | tee "/apps/${app}/BASE" >/dev/null
echo "App: ${app} using Base: ${base}"
fi
fi
fi
+10 -10
View File
@@ -6,8 +6,8 @@ on:
branches:
- master
paths:
- 'apps/**'
- 'base/**'
- 'containers/apps/**'
- 'containers/base/**'
- ".github/workflows/containers.build.yaml"
pull_request:
paths:
@@ -37,9 +37,9 @@ jobs:
list-files: json
filters: |
changed:
- 'apps/**'
- 'dev/**'
- 'base/**'
- 'containers/apps/**'
- 'containers/dev/**'
- 'containers/base/**'
- run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
- id: reduce
run: |
@@ -88,11 +88,11 @@ jobs:
bash ./.github/update-version-file.sh "${{ matrix.container }}"
if test -f "./apps/${{ matrix.container }}/VERSION"; then
CATEGORY="apps"
VERSION=$(cat ./${CATEGORY}/${{ matrix.container }}/VERSION)
elif test -f "./apps/${{ matrix.container }}/Dockerfile"; then
VERSION=$(cat ./containers/${CATEGORY}/${{ matrix.container }}/VERSION)
elif test -f "./containers/apps/${{ matrix.container }}/Dockerfile"; then
CATEGORY="apps"
echo ::set-output name=category::${CATEGORY}
VERSION="$(head -1 ./${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION="$(head -1 ./containers/${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION=$(echo $VERSION | sed "s/latest-//g")
VERSION=$(echo $VERSION | sed "s/stable-//g")
VERSION=$(echo $VERSION | sed "s/edge-//g")
@@ -121,7 +121,7 @@ jobs:
fi;
else
CATEGORY="base"
VERSION=$(cat ./${CATEGORY}/${{ matrix.container }}/VERSION) || VERSION="$(head -1 ./${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION=$(cat ./containers/${CATEGORY}/${{ matrix.container }}/VERSION) || VERSION="$(head -1 ./containers/${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION=$(echo $VERSION | sed "s/latest-//g")
VERSION=$(echo $VERSION | sed "s/stable-//g")
VERSION="${VERSION#*V.}"
@@ -157,7 +157,7 @@ jobs:
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
# add only VERSION and BASE files
git add ./apps/${{ matrix.container }}/VERSION ./apps/${{ matrix.container }}/BASE || true
git add ./containers/apps/${{ matrix.container }}/VERSION ./containers/apps/${{ matrix.container }}/BASE || true
git commit -sm "Update ${{ matrix.container }} version file" || exit 0
git push
-25
View File
@@ -1,25 +0,0 @@
---
name: "Schedule: Sync labels"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
labels:
name: Sync Labels
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Sync Labels
uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
with:
config-file: |
https://raw.githubusercontent.com/truecharts/.github/main/.github/labels.yaml
token: "${{ secrets.BOT_TOKEN }}"
delete-other-labels: true
-38
View File
@@ -1,38 +0,0 @@
---
name: "Mark or close stale issues and PRs"
on:
workflow_dispatch:
schedule:
# Run the stalebot every day at 8pm UTC
- cron: "00 20 * * *"
jobs:
stale:
runs-on: ubuntu-24.04
steps:
- name: Check for stale issues and PRs
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
with:
repo-token: ${{ secrets.BOT_TOKEN }}
days-before-issue-stale: 180
days-before-pr-stale: 180
days-before-close: 14
days-before-pr-close: 14
stale-issue-message: >
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in two weeks if no further activity occurs.
Thank you for your contributions.
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed in two weeks if no further activity occurs.
Thank you for your contributions.
close-issue-message: >
This issue has been automatically closed due to inactivity.
Please re-open if this still requires investigation.
close-pr-message: >
This pull request has been automatically closed due to inactivity.
Please re-open if these changes are still required.
stale-pr-label: "stale"
stale-issue-label: "stale"
exempt-issue-labels: "keepalive"
exempt-pr-labels: "keepalive"