Skip to content

Commit a27c1e5

Browse files
authored
Merge pull request #322 from linuxserver/monthly
2 parents 5484436 + 4ca0737 commit a27c1e5

7 files changed

Lines changed: 54 additions & 15 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
# project information
33
project_name: jenkins-builder
4+
project_categories: "Internal"
45
full_custom_readme: |
56
{% raw -%}
67
# linuxserver/jenkins-builder

roles/generate-jenkins/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ build_armhf: false
6161
image_provenance: true
6262
image_sbom: true
6363
image_builder: 'container'
64+
project_categories: ""

roles/generate-jenkins/templates/DOCUMENTATION.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
{%- set has_latest= true if (development_versions == true and 'latest' in (development_versions_items | map(attribute="tag"))) or (development_versions == false) else false -%}
55
---
66
title: {{ project_name }}
7+
{% if project_categories %}
8+
tags:
9+
{% for tag in project_categories.split(",") %}
10+
- {{ tag | title }}
11+
{% endfor %}
12+
{% endif %}
13+
description: "{{ noter(project_blurb) | trim }}"
714
---
815
{% include "README_SNIPPETS/DO_NOT_EDIT.j2" | trim %}
916
{% if project_deprecation_status %}

roles/generate-jenkins/templates/DOCUMENTATION.j2-CUSTOM

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
{% from 'common_macros.j2' import noter with context %}
33
---
44
title: {{ project_name }}
5+
{% if project_categories is defined and project_blurb is defined %}
6+
{% if project_categories and project_blurb %}
7+
tags:
8+
{% for tag in project_categories.split(",") %}
9+
- {{ tag | title }}
10+
{% endfor %}
11+
description: "{{ noter(project_blurb) | trim }}"
12+
{% endif %}
13+
{% endif %}
514
---
615
{% include "README_SNIPPETS/DO_NOT_EDIT.j2" | trim %}
716

roles/generate-jenkins/templates/EXTERNAL_TRIGGER.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ jobs:
2323
run: |
2424
printf "# External trigger for {{ project_repo_name }}\n\n" >> $GITHUB_STEP_SUMMARY
2525
{% if custom_version_command is defined or external_type != "os" %}
26-
if grep -q "^{{ project_name }}_{{ ls_branch }}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
26+
if grep -q "^{{ project_name }}_{{ ls_branch }}_" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
27+
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
28+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`{{ project_name }}_{{ ls_branch }}_\`; will skip trigger if version matches." >> $GITHUB_STEP_SUMMARY
29+
elif grep -q "^{{ project_name }}_{{ ls_branch }}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
2730
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
2831
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`{{ project_name }}_{{ ls_branch }}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
2932
exit 0
@@ -88,6 +91,11 @@ jobs:
8891
echo "No external release, exiting" >> $GITHUB_STEP_SUMMARY
8992
exit 0
9093
{% endif %}
94+
if grep -q "^{{ project_name }}_{{ ls_branch }}_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
95+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
96+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
97+
exit 0
98+
fi
9199
{% if custom_version_command is defined or external_type != "os" %}
92100
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
93101
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY

roles/generate-jenkins/templates/Jenkinsfile.j2

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,21 @@ pipeline {
4242
steps{
4343
echo "Running on node: ${NODE_NAME}"
4444
sh '''#! /bin/bash
45-
containers=$(docker ps -aq)
45+
echo "Pruning builder"
46+
docker builder prune -f --builder container || :
47+
containers=$(docker ps -q)
4648
if [[ -n "${containers}" ]]; then
47-
docker stop ${containers}
49+
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
50+
for container in ${containers}; do
51+
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
52+
echo "skipping buildx container in docker stop"
53+
else
54+
echo "Stopping container ${container}"
55+
docker stop ${container}
56+
fi
57+
done
4858
fi
49-
docker system prune -af --volumes || : '''
59+
docker system prune -f --volumes || : '''
5060
script{
5161
env.EXIT_STATUS = ''
5262
env.LS_RELEASE = sh(
@@ -1447,12 +1457,21 @@ EOF
14471457
}
14481458
cleanup {
14491459
sh '''#! /bin/bash
1450-
echo "Performing docker system prune!!"
1451-
containers=$(docker ps -aq)
1460+
echo "Pruning builder!!"
1461+
docker builder prune -f --builder container || :
1462+
containers=$(docker ps -q)
14521463
if [[ -n "${containers}" ]]; then
1453-
docker stop ${containers}
1464+
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
1465+
for container in ${containers}; do
1466+
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
1467+
echo "skipping buildx container in docker stop"
1468+
else
1469+
echo "Stopping container ${container}"
1470+
docker stop ${container}
1471+
fi
1472+
done
14541473
fi
1455-
docker system prune -af --volumes || :
1474+
docker system prune -f --volumes || :
14561475
'''
14571476
cleanWs()
14581477
}

vars/common

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ lsio_short_url: "{{ lsio_project_name }}"
1010
lsio_full_url: "https://{{ lsio_project_name }}"
1111
lsio_blog_url: "https://blog.{{ lsio_short_url }}"
1212
lsio_ci_url: "https://ci.{{ lsio_short_url }}"
13-
lsio_discord_url: "https://discord.gg/YWrKVTn"
13+
lsio_discord_url: "https://linuxserver.io/discord"
1414
lsio_discourse_url: "https://discourse.{{ lsio_short_url }}"
1515
lsio_docker_hub_url: "https://hub.docker.com/r/{{ lsio_project_name_short }}"
1616
lsio_docs_url: "https://docs.{{ lsio_short_url }}"
1717
lsio_fleet_url: "https://fleet.{{ lsio_short_url }}"
1818
lsio_github_url: "https://github.com/{{ lsio_project_name_short }}"
1919
lsio_gitlab_url: "https://gitlab.com/{{ lsio_project_name }}"
20-
lsio_irc_url: "https://irc.{{ lsio_short_url }}"
21-
lsio_microbadger_url: "https://microbadger.com/images/{{ lsio_project_name_short }}"
2220
lsio_mods_url: "https://mods.{{ lsio_short_url }}/?mod={{ project_name }}"
2321
lsio_universal_mods_url: "https://mods.{{ lsio_short_url }}/?mod=universal"
2422
lsio_object_url: "https://ci-tests.{{ lsio_short_url }}"
2523
lsio_opencollective_url: "https://opencollective.com/{{ lsio_project_name_short }}"
26-
lsio_podcast_url: "https://anchor.fm/linuxserverio"
2724

2825
# project defaults
2926
project_deprecation_status: false
@@ -43,12 +40,9 @@ lsio_discord_desc: "realtime support / chat with the community and the team."
4340
lsio_discourse_desc: "post on our community forum."
4441
lsio_fleet_desc: "an online web interface which displays all of our maintained images."
4542
lsio_github_desc: "view the source for all of our repositories."
46-
lsio_irc_desc: "on freenode at `#{{ lsio_project_name }}`. Our primary support channel is Discord."
47-
lsio_microbadger_desc: "Get your own version badge on microbadger.com"
4843
lsio_mods_desc: "view available mods for this container."
4944
lsio_universal_mods_desc: "view available universal mods."
5045
lsio_opencollective_desc: "please consider helping us by either donating or contributing to our budget"
51-
lsio_podcast_desc: "on hiatus. Coming back soon (late 2018)."
5246

5347
# asset urls
5448
lsio_primary_logo_url: https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png

0 commit comments

Comments
 (0)