Compare commits
31 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1337f947bf | ||
|
|
7daaf3badb | ||
|
|
132c23290d | ||
|
|
3e083a40f2 | ||
|
|
46d99acd36 | ||
|
|
a1b51ed90c | ||
|
|
f72217ab32 | ||
|
|
7ed758b8d9 | ||
|
|
866c98f694 | ||
|
|
b2899eebf0 | ||
|
|
b94ed7f019 | ||
|
|
91d71d886e | ||
|
|
e60d0a3907 | ||
|
|
175b983376 | ||
|
|
1006d82341 | ||
|
|
da864d79b1 | ||
|
|
3069ae4d4a | ||
|
|
5726980044 | ||
|
|
f93d37a97f | ||
|
|
ea880d5500 | ||
|
|
2425ccbe24 | ||
|
|
36e6c569e5 | ||
|
|
4df92eb973 | ||
|
|
305444a29a | ||
|
|
1f28cd5ffc | ||
|
|
b4491470a4 | ||
|
|
809fc7ed82 | ||
|
|
e734eb6ca4 | ||
|
|
95c98c1857 | ||
|
|
328d184b56 | ||
|
|
ec8d60f795 |
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
|
|
@ -6,7 +6,7 @@
|
||||||
* Read, and fill the Pull Request template
|
* Read, and fill the Pull Request template
|
||||||
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
|
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
|
||||||
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
|
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
|
||||||
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
|
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://linuxserver.io/discord)
|
||||||
|
|
||||||
## Common files
|
## Common files
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
## Readme
|
## Readme
|
||||||
|
|
||||||
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
|
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
|
||||||
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-baseimage-alpine/edit/master/readme-vars.yml).
|
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-baseimage-alpine/edit/3.19/readme-vars.yml).
|
||||||
|
|
||||||
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
|
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
|
||||||
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
|
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
|
||||||
|
|
@ -105,17 +105,17 @@ docker build \
|
||||||
-t linuxserver/baseimage-alpine:latest .
|
-t linuxserver/baseimage-alpine:latest .
|
||||||
```
|
```
|
||||||
|
|
||||||
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
The ARM variants can be built on x86_64 hardware and vice versa using `lscr.io/linuxserver/qemu-static`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
|
||||||
```
|
```
|
||||||
|
|
||||||
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||||
|
|
||||||
## Update the changelog
|
## Update the changelog
|
||||||
|
|
||||||
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-baseimage-alpine/tree/master/root), add an entry to the changelog
|
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-baseimage-alpine/tree/3.19/root), add an entry to the changelog
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
changelogs:
|
changelogs:
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Discord chat support
|
- name: Discord chat support
|
||||||
url: https://discord.gg/YWrKVTn
|
url: https://linuxserver.io/discord
|
||||||
about: Realtime support / chat with the community and the team.
|
about: Realtime support / chat with the community and the team.
|
||||||
|
|
||||||
- name: Discourse discussion forum
|
- name: Discourse discussion forum
|
||||||
|
|
|
||||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-alpine/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
|
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-alpine/blob/3.19/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
14
.github/workflows/external_trigger.yml
vendored
14
.github/workflows/external_trigger.yml
vendored
|
|
@ -4,14 +4,22 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
external-trigger-master:
|
external-trigger-3-19:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: External Trigger
|
- name: External Trigger
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/3.19'
|
||||||
|
env:
|
||||||
|
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
|
||||||
run: |
|
run: |
|
||||||
echo "**** No external release, exiting ****"
|
printf "# External trigger for docker-baseimage-alpine\n\n" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Type is \`os\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "No external release, exiting" >> $GITHUB_STEP_SUMMARY
|
echo "No external release, exiting" >> $GITHUB_STEP_SUMMARY
|
||||||
exit 0
|
exit 0
|
||||||
|
if grep -q "^baseimage-alpine_3.19_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
|
||||||
24
.github/workflows/external_trigger_scheduler.yml
vendored
24
.github/workflows/external_trigger_scheduler.yml
vendored
|
|
@ -15,31 +15,31 @@ jobs:
|
||||||
|
|
||||||
- name: External Trigger Scheduler
|
- name: External Trigger Scheduler
|
||||||
run: |
|
run: |
|
||||||
echo "**** Branches found: ****"
|
printf "# External trigger scheduler for docker-baseimage-alpine\n\n" >> $GITHUB_STEP_SUMMARY
|
||||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
|
||||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
for br in $(git for-each-ref --format='%(refname:lstrip=3)' refs/remotes)
|
||||||
do
|
do
|
||||||
br=$(echo "$br" | sed 's|origin/||g')
|
if [[ "${br}" == "HEAD" ]]; then
|
||||||
echo "**** Evaluating branch ${br} ****"
|
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
|
||||||
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/jenkins-vars.yml)
|
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/jenkins-vars.yml)
|
||||||
ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch')
|
ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch')
|
||||||
ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type')
|
ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type')
|
||||||
if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then
|
if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then
|
||||||
echo "**** Branch ${br} appears to be live and trigger is not os; checking workflow. ****"
|
echo "Branch appears to be live and trigger is not os; checking workflow." >> $GITHUB_STEP_SUMMARY
|
||||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
|
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
|
||||||
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
|
echo "Triggering external trigger workflow for branch." >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Triggering external trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
curl -iX POST \
|
curl -iX POST \
|
||||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||||
https://api.github.com/repos/linuxserver/docker-baseimage-alpine/actions/workflows/external_trigger.yml/dispatches
|
https://api.github.com/repos/linuxserver/docker-baseimage-alpine/actions/workflows/external_trigger.yml/dispatches
|
||||||
else
|
else
|
||||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
echo "Skipping branch due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Skipping branch ${br} due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "**** ${br} is either a dev branch, or has no external version; skipping trigger. ****"
|
echo "Skipping branch due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Skipping branch ${br} due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
with:
|
||||||
issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.'
|
issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.'
|
||||||
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-alpine/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
|
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-alpine/blob/3.19/.github/PULL_REQUEST_TEMPLATE.md)!'
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
42
.github/workflows/package_trigger.yml
vendored
42
.github/workflows/package_trigger.yml
vendored
|
|
@ -1,42 +0,0 @@
|
||||||
name: Package Trigger Main
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
package-trigger-master:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4.1.1
|
|
||||||
|
|
||||||
- name: Package Trigger
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
run: |
|
|
||||||
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_MASTER }}" ]; then
|
|
||||||
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_MASTER is set; skipping trigger. ****"
|
|
||||||
echo "Github secret \`PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_MASTER\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-alpine/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
|
|
||||||
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
|
|
||||||
echo "There already seems to be an active build on Jenkins; skipping package trigger" >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_MASTER\". ****"
|
|
||||||
echo "Package trigger running off of master branch. To disable, set a Github secret named \`PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ALPINE_MASTER\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
response=$(curl -iX POST \
|
|
||||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-alpine/job/master/buildWithParameters?PACKAGE_CHECK=true \
|
|
||||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
|
||||||
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
|
|
||||||
echo "**** Sleeping 10 seconds until job starts ****"
|
|
||||||
sleep 10
|
|
||||||
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
|
||||||
buildurl="${buildurl%$'\r'}"
|
|
||||||
echo "**** Jenkins job build url: ${buildurl} ****"
|
|
||||||
echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "**** Attempting to change the Jenkins job description ****"
|
|
||||||
curl -iX POST \
|
|
||||||
"${buildurl}submitDescription" \
|
|
||||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
|
||||||
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
|
||||||
--data-urlencode "Submit=Submit"
|
|
||||||
94
.github/workflows/package_trigger_scheduler.yml
vendored
94
.github/workflows/package_trigger_scheduler.yml
vendored
|
|
@ -14,37 +14,87 @@ jobs:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Package Trigger Scheduler
|
- name: Package Trigger Scheduler
|
||||||
|
env:
|
||||||
|
SKIP_PACKAGE_TRIGGER: ${{ vars.SKIP_PACKAGE_TRIGGER }}
|
||||||
run: |
|
run: |
|
||||||
echo "**** Branches found: ****"
|
printf "# Package trigger scheduler for docker-baseimage-alpine\n\n" >> $GITHUB_STEP_SUMMARY
|
||||||
git for-each-ref --format='%(refname:short)' refs/remotes
|
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
|
||||||
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
|
for br in $(git for-each-ref --format='%(refname:lstrip=3)' refs/remotes)
|
||||||
do
|
do
|
||||||
br=$(echo "$br" | sed 's|origin/||g')
|
if [[ "${br}" == "HEAD" ]]; then
|
||||||
echo "**** Evaluating branch ${br} ****"
|
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
|
||||||
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/jenkins-vars.yml | yq -r '.ls_branch')
|
continue
|
||||||
if [ "${br}" == "${ls_branch}" ]; then
|
fi
|
||||||
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
|
||||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
|
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/jenkins-vars.yml)
|
||||||
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
|
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/Jenkinsfile >/dev/null 2>&1; then
|
||||||
echo "Triggering package trigger workflow for branch ${br}" >> $GITHUB_STEP_SUMMARY
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
triggered_branches="${triggered_branches}${br} "
|
echo "> No Jenkinsfile found. Branch is either deprecated or is an early dev branch." >> $GITHUB_STEP_SUMMARY
|
||||||
curl -iX POST \
|
skipped_branches="${skipped_branches}${br} "
|
||||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
elif [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
echo "Branch appears to be live; checking workflow." >> $GITHUB_STEP_SUMMARY
|
||||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
README_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-alpine/${br}/readme-vars.yml)
|
||||||
https://api.github.com/repos/linuxserver/docker-baseimage-alpine/actions/workflows/package_trigger.yml/dispatches
|
if [[ $(yq -r '.project_deprecation_status' <<< "${README_VARS}") == "true" ]]; then
|
||||||
sleep 30
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Branch appears to be deprecated; skipping trigger." >> $GITHUB_STEP_SUMMARY
|
||||||
|
skipped_branches="${skipped_branches}${br} "
|
||||||
|
elif [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Skipping branch ${br} due to \`skip_package_check\` being set in \`jenkins-vars.yml\`." >> $GITHUB_STEP_SUMMARY
|
||||||
|
skipped_branches="${skipped_branches}${br} "
|
||||||
|
elif grep -q "^baseimage-alpine_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`baseimage-alpine_${br}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
|
||||||
|
skipped_branches="${skipped_branches}${br} "
|
||||||
|
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-alpine/job/${br}/lastBuild/api/json | jq -r '.building' 2>/dev/null) == "true" ]; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> There already seems to be an active build on Jenkins; skipping package trigger for ${br}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
skipped_branches="${skipped_branches}${br} "
|
||||||
else
|
else
|
||||||
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Skipping branch ${br} due to no package trigger workflow present." >> $GITHUB_STEP_SUMMARY
|
echo "> Triggering package trigger for branch ${br}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
printf "> To disable, add \`baseimage-alpine_%s\` into the Github organizational variable \`SKIP_PACKAGE_TRIGGER\`.\n\n" "${br}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
triggered_branches="${triggered_branches}${br} "
|
||||||
|
response=$(curl -iX POST \
|
||||||
|
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-alpine/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
|
||||||
|
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
||||||
|
if [[ -z "${response}" ]]; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Jenkins build could not be triggered. Skipping branch."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
|
||||||
|
sleep 10
|
||||||
|
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
|
||||||
|
buildurl="${buildurl%$'\r'}"
|
||||||
|
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
|
||||||
|
if ! curl -ifX POST \
|
||||||
|
"${buildurl}submitDescription" \
|
||||||
|
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
|
||||||
|
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
|
--data-urlencode "Submit=Submit"; then
|
||||||
|
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "> Unable to change the Jenkins job description."
|
||||||
|
fi
|
||||||
|
sleep 20
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
|
|
||||||
echo "Skipping branch ${br} due to being detected as dev branch." >> $GITHUB_STEP_SUMMARY
|
echo "Skipping branch ${br} due to being detected as dev branch." >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [[ -n "${triggered_branches}" ]] || [[ -n "${skipped_branches}" ]]; then
|
||||||
|
if [[ -n "${triggered_branches}" ]]; then
|
||||||
|
NOTIFY_BRANCHES="**Triggered:** ${triggered_branches} \n"
|
||||||
|
NOTIFY_BUILD_URL="**Build URL:** https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-baseimage-alpine/activity/ \n"
|
||||||
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
|
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
|
||||||
|
fi
|
||||||
|
if [[ -n "${skipped_branches}" ]]; then
|
||||||
|
NOTIFY_BRANCHES="${NOTIFY_BRANCHES}**Skipped:** ${skipped_branches} \n"
|
||||||
|
fi
|
||||||
echo "**** Notifying Discord ****"
|
echo "**** Notifying Discord ****"
|
||||||
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
|
||||||
"description": "**Package Check Build(s) Triggered for baseimage-alpine** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-baseimage-alpine/activity/"' \n"}],
|
"description": "**Package Check Build(s) for baseimage-alpine** \n'"${NOTIFY_BRANCHES}"''"${NOTIFY_BUILD_URL}"'"}],
|
||||||
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
fi
|
||||||
|
|
|
||||||
2
.github/workflows/permissions.yml
vendored
2
.github/workflows/permissions.yml
vendored
|
|
@ -5,6 +5,8 @@ on:
|
||||||
- '**/run'
|
- '**/run'
|
||||||
- '**/finish'
|
- '**/finish'
|
||||||
- '**/check'
|
- '**/check'
|
||||||
|
- 'root/migrations/*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
permission_check:
|
permission_check:
|
||||||
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1
|
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,13 @@ ARG BUILD_DATE
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG MODS_VERSION="v3"
|
ARG MODS_VERSION="v3"
|
||||||
ARG PKG_INST_VERSION="v1"
|
ARG PKG_INST_VERSION="v1"
|
||||||
|
ARG LSIOWN_VERSION="v1"
|
||||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
LABEL maintainer="TheLamer"
|
LABEL maintainer="TheLamer"
|
||||||
|
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
|
||||||
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,13 @@ ARG BUILD_DATE
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG MODS_VERSION="v3"
|
ARG MODS_VERSION="v3"
|
||||||
ARG PKG_INST_VERSION="v1"
|
ARG PKG_INST_VERSION="v1"
|
||||||
|
ARG LSIOWN_VERSION="v1"
|
||||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
LABEL maintainer="TheLamer"
|
LABEL maintainer="TheLamer"
|
||||||
|
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
|
||||||
|
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
||||||
|
|
|
||||||
455
Jenkinsfile
vendored
455
Jenkinsfile
vendored
|
|
@ -17,6 +17,8 @@ pipeline {
|
||||||
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||||
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||||
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
|
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
|
||||||
|
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
|
||||||
|
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
|
||||||
BUILD_VERSION_ARG = 'OS'
|
BUILD_VERSION_ARG = 'OS'
|
||||||
LS_USER = 'linuxserver'
|
LS_USER = 'linuxserver'
|
||||||
LS_REPO = 'docker-baseimage-alpine'
|
LS_REPO = 'docker-baseimage-alpine'
|
||||||
|
|
@ -31,20 +33,46 @@ pipeline {
|
||||||
CI_PORT='80'
|
CI_PORT='80'
|
||||||
CI_SSL='true'
|
CI_SSL='true'
|
||||||
CI_DELAY='30'
|
CI_DELAY='30'
|
||||||
CI_DOCKERENV='TZ=US/Pacific|LSIO_FIRST_PARTY=true'
|
CI_DOCKERENV='LSIO_FIRST_PARTY=true'
|
||||||
CI_AUTH='user:password'
|
CI_AUTH=''
|
||||||
CI_WEBPATH=''
|
CI_WEBPATH=''
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
stage("Set git config"){
|
||||||
|
steps{
|
||||||
|
sh '''#!/bin/bash
|
||||||
|
cat ${GIT_SIGNING_KEY} > /config/.ssh/id_sign
|
||||||
|
chmod 600 /config/.ssh/id_sign
|
||||||
|
ssh-keygen -y -f /config/.ssh/id_sign > /config/.ssh/id_sign.pub
|
||||||
|
echo "Using $(ssh-keygen -lf /config/.ssh/id_sign) to sign commits"
|
||||||
|
git config --global gpg.format ssh
|
||||||
|
git config --global user.signingkey /config/.ssh/id_sign
|
||||||
|
git config --global commit.gpgsign true
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
// Setup all the basic environment variables needed for the build
|
// Setup all the basic environment variables needed for the build
|
||||||
stage("Set ENV Variables base"){
|
stage("Set ENV Variables base"){
|
||||||
steps{
|
steps{
|
||||||
|
echo "Running on node: ${NODE_NAME}"
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
containers=$(docker ps -aq)
|
echo "Pruning builder"
|
||||||
|
docker builder prune -f --builder container || :
|
||||||
|
containers=$(docker ps -q)
|
||||||
if [[ -n "${containers}" ]]; then
|
if [[ -n "${containers}" ]]; then
|
||||||
docker stop ${containers}
|
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
|
||||||
|
for container in ${containers}; do
|
||||||
|
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
|
||||||
|
echo "skipping buildx container in docker stop"
|
||||||
|
else
|
||||||
|
echo "Stopping container ${container}"
|
||||||
|
docker stop ${container}
|
||||||
fi
|
fi
|
||||||
docker system prune -af --volumes || : '''
|
done
|
||||||
|
fi
|
||||||
|
docker system prune -f --volumes || :
|
||||||
|
docker image prune -af || :
|
||||||
|
'''
|
||||||
script{
|
script{
|
||||||
env.EXIT_STATUS = ''
|
env.EXIT_STATUS = ''
|
||||||
env.LS_RELEASE = sh(
|
env.LS_RELEASE = sh(
|
||||||
|
|
@ -65,7 +93,7 @@ pipeline {
|
||||||
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
|
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
|
||||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
|
||||||
env.PULL_REQUEST = env.CHANGE_ID
|
env.PULL_REQUEST = env.CHANGE_ID
|
||||||
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml'
|
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml'
|
||||||
}
|
}
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
|
echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
|
||||||
|
|
@ -153,10 +181,10 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If this is a master build use live docker endpoints
|
// If this is a 3.19 build use live docker endpoints
|
||||||
stage("Set ENV live build"){
|
stage("Set ENV live build"){
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
|
@ -173,13 +201,14 @@ pipeline {
|
||||||
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
env.META_TAG = '3.19-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
env.META_TAG = '3.19-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
||||||
|
env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If this is a dev build use dev docker endpoints
|
// If this is a dev build use dev docker endpoints
|
||||||
stage("Set ENV dev build"){
|
stage("Set ENV dev build"){
|
||||||
when {
|
when {
|
||||||
not {branch "master"}
|
not {branch "3.19"}
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
|
@ -197,6 +226,7 @@ pipeline {
|
||||||
env.META_TAG = '3.19-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
env.META_TAG = '3.19-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
|
||||||
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
||||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
|
||||||
|
env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -221,6 +251,7 @@ pipeline {
|
||||||
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
env.EXT_RELEASE_TAG = '3.19-version-' + env.EXT_RELEASE_CLEAN
|
||||||
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
|
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
|
||||||
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
|
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/'
|
||||||
|
env.BUILDCACHE = 'docker.io/lsiodev/buildcache,registry.gitlab.com/linuxserver.io/docker-jenkins-builder/lsiodev-buildcache,ghcr.io/linuxserver/lsiodev-buildcache,quay.io/linuxserver.io/lsiodev-buildcache'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -243,7 +274,7 @@ pipeline {
|
||||||
-v ${WORKSPACE}:/mnt \
|
-v ${WORKSPACE}:/mnt \
|
||||||
-e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \
|
-e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \
|
||||||
-e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \
|
-e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \
|
||||||
ghcr.io/linuxserver/baseimage-alpine:3.19 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
|
ghcr.io/linuxserver/baseimage-alpine:3.20 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
|
||||||
apk add --no-cache python3 && \
|
apk add --no-cache python3 && \
|
||||||
python3 -m venv /lsiopy && \
|
python3 -m venv /lsiopy && \
|
||||||
pip install --no-cache-dir -U pip && \
|
pip install --no-cache-dir -U pip && \
|
||||||
|
|
@ -255,7 +286,7 @@ pipeline {
|
||||||
// Use helper containers to render templated files
|
// Use helper containers to render templated files
|
||||||
stage('Update-Templates') {
|
stage('Update-Templates') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
expression {
|
expression {
|
||||||
env.CONTAINER_NAME != null
|
env.CONTAINER_NAME != null
|
||||||
|
|
@ -267,24 +298,24 @@ pipeline {
|
||||||
TEMPDIR=$(mktemp -d)
|
TEMPDIR=$(mktemp -d)
|
||||||
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
# Cloned repo paths for templating:
|
# Cloned repo paths for templating:
|
||||||
# ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch master of ${LS_USER}/${LS_REPO} for running the jenkins builder on
|
# ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch 3.19 of ${LS_USER}/${LS_REPO} for running the jenkins builder on
|
||||||
# ${TEMPDIR}/repo/${LS_REPO}: Cloned branch master of ${LS_USER}/${LS_REPO} for commiting various templated file changes and pushing back to Github
|
# ${TEMPDIR}/repo/${LS_REPO}: Cloned branch 3.19 of ${LS_USER}/${LS_REPO} for commiting various templated file changes and pushing back to Github
|
||||||
# ${TEMPDIR}/docs/docker-documentation: Cloned docs repo for pushing docs updates to Github
|
# ${TEMPDIR}/docs/docker-documentation: Cloned docs repo for pushing docs updates to Github
|
||||||
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
|
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
|
||||||
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
|
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
|
||||||
git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
|
git clone --branch 3.19 --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true -e PUID=$(id -u) -e PGID=$(id -g) ghcr.io/linuxserver/jenkins-builder:latest
|
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true -e PUID=$(id -u) -e PGID=$(id -g) ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
echo "Starting Stage 1 - Jenkinsfile update"
|
echo "Starting Stage 1 - Jenkinsfile update"
|
||||||
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
|
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
|
||||||
mkdir -p ${TEMPDIR}/repo
|
mkdir -p ${TEMPDIR}/repo
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
git checkout -f master
|
git checkout -f 3.19
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
git add Jenkinsfile
|
git add Jenkinsfile
|
||||||
git commit -m 'Bot Updating Templated Files'
|
git commit -m 'Bot Updating Templated Files'
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
echo "Updating Jenkinsfile and exiting build, new one will trigger based on commit"
|
echo "Updating Jenkinsfile and exiting build, new one will trigger based on commit"
|
||||||
rm -Rf ${TEMPDIR}
|
rm -Rf ${TEMPDIR}
|
||||||
|
|
@ -293,7 +324,7 @@ pipeline {
|
||||||
echo "Jenkinsfile is up to date."
|
echo "Jenkinsfile is up to date."
|
||||||
fi
|
fi
|
||||||
echo "Starting Stage 2 - Delete old templates"
|
echo "Starting Stage 2 - Delete old templates"
|
||||||
OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf"
|
OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml .github/workflows/package_trigger.yml"
|
||||||
for i in ${OLD_TEMPLATES}; do
|
for i in ${OLD_TEMPLATES}; do
|
||||||
if [[ -f "${i}" ]]; then
|
if [[ -f "${i}" ]]; then
|
||||||
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
|
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
|
||||||
|
|
@ -303,13 +334,13 @@ pipeline {
|
||||||
mkdir -p ${TEMPDIR}/repo
|
mkdir -p ${TEMPDIR}/repo
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
git checkout -f master
|
git checkout -f 3.19
|
||||||
for i in ${TEMPLATES_TO_DELETE}; do
|
for i in ${TEMPLATES_TO_DELETE}; do
|
||||||
git rm "${i}"
|
git rm "${i}"
|
||||||
done
|
done
|
||||||
git commit -m 'Bot Updating Templated Files'
|
git commit -m 'Bot Updating Templated Files'
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit"
|
echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit"
|
||||||
rm -Rf ${TEMPDIR}
|
rm -Rf ${TEMPDIR}
|
||||||
|
|
@ -325,7 +356,7 @@ pipeline {
|
||||||
mkdir -p ${TEMPDIR}/repo
|
mkdir -p ${TEMPDIR}/repo
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
git checkout -f master
|
git checkout -f 3.19
|
||||||
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
||||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
|
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
|
||||||
|
|
@ -338,8 +369,8 @@ pipeline {
|
||||||
fi
|
fi
|
||||||
git add readme-vars.yml ${TEMPLATED_FILES}
|
git add readme-vars.yml ${TEMPLATED_FILES}
|
||||||
git commit -m 'Bot Updating Templated Files'
|
git commit -m 'Bot Updating Templated Files'
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
echo "Updating templates and exiting build, new one will trigger based on commit"
|
echo "Updating templates and exiting build, new one will trigger based on commit"
|
||||||
rm -Rf ${TEMPDIR}
|
rm -Rf ${TEMPDIR}
|
||||||
|
|
@ -350,7 +381,7 @@ pipeline {
|
||||||
fi
|
fi
|
||||||
echo "Starting Stage 4 - External repo updates: Docs, Unraid Template and Readme Sync to Docker Hub"
|
echo "Starting Stage 4 - External repo updates: Docs, Unraid Template and Readme Sync to Docker Hub"
|
||||||
mkdir -p ${TEMPDIR}/docs
|
mkdir -p ${TEMPDIR}/docs
|
||||||
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation
|
git clone --depth=1 https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation
|
||||||
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/
|
||||||
cd ${TEMPDIR}/docs/docker-documentation
|
cd ${TEMPDIR}/docs/docker-documentation
|
||||||
|
|
@ -406,7 +437,7 @@ pipeline {
|
||||||
// Exit the build if the Templated files were just updated
|
// Exit the build if the Templated files were just updated
|
||||||
stage('Template-exit') {
|
stage('Template-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'FILES_UPDATED', value: 'true'
|
environment name: 'FILES_UPDATED', value: 'true'
|
||||||
expression {
|
expression {
|
||||||
|
|
@ -419,10 +450,10 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If this is a master build check the S6 service file perms
|
// If this is a 3.19 build check the S6 service file perms
|
||||||
stage("Check S6 Service file Permissions"){
|
stage("Check S6 Service file Permissions"){
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
|
|
@ -440,10 +471,10 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* #######################
|
/* #######################
|
||||||
GitLab Mirroring
|
GitLab Mirroring and Quay.io Repo Visibility
|
||||||
####################### */
|
####################### */
|
||||||
// Ping into Gitlab to mirror this repo and have a registry endpoint
|
// Ping into Gitlab to mirror this repo and have a registry endpoint & mark this repo on Quay.io as public
|
||||||
stage("GitLab Mirror"){
|
stage("GitLab Mirror and Quay.io Visibility"){
|
||||||
when {
|
when {
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
|
|
@ -459,6 +490,8 @@ pipeline {
|
||||||
"visibility":"public"}' '''
|
"visibility":"public"}' '''
|
||||||
sh '''curl -H "Private-Token: ${GITLAB_TOKEN}" -X PUT "https://gitlab.com/api/v4/projects/Linuxserver.io%2F${LS_REPO}" \
|
sh '''curl -H "Private-Token: ${GITLAB_TOKEN}" -X PUT "https://gitlab.com/api/v4/projects/Linuxserver.io%2F${LS_REPO}" \
|
||||||
-d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" '''
|
-d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" '''
|
||||||
|
sh '''curl -H "Content-Type: application/json" -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" -X POST "https://quay.io/api/v1/repository${QUAYIMAGE/quay.io/}/changevisibility" \
|
||||||
|
-d '{"visibility":"public"}' ||: '''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* ###############
|
/* ###############
|
||||||
|
|
@ -488,7 +521,42 @@ pipeline {
|
||||||
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
||||||
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
||||||
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
|
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
|
||||||
|
--provenance=true --sbom=true --builder=container --load \
|
||||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker tag ${IMAGE}:${META_TAG} ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'Quay.io-Robot',
|
||||||
|
usernameVariable: 'QUAYUSER',
|
||||||
|
passwordVariable: 'QUAYPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
retry_backoff(5,5) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
|
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||||
|
if [[ "${PACKAGE_CHECK}" != "true" ]]; then
|
||||||
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
|
||||||
|
done
|
||||||
|
for p in $(jobs -p); do
|
||||||
|
wait "$p" || { echo "job $p failed" >&2; exit 1; }
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Build MultiArch Docker containers for push to LS Repo
|
// Build MultiArch Docker containers for push to LS Repo
|
||||||
|
|
@ -518,7 +586,42 @@ pipeline {
|
||||||
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
||||||
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
||||||
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
|
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
|
||||||
|
--provenance=true --sbom=true --builder=container --load \
|
||||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker tag ${IMAGE}:amd64-${META_TAG} ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'Quay.io-Robot',
|
||||||
|
usernameVariable: 'QUAYUSER',
|
||||||
|
passwordVariable: 'QUAYPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
retry_backoff(5,5) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
|
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||||
|
if [[ "${PACKAGE_CHECK}" != "true" ]]; then
|
||||||
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
|
||||||
|
done
|
||||||
|
for p in $(jobs -p); do
|
||||||
|
wait "$p" || { echo "job $p failed" >&2; exit 1; }
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build ARM64') {
|
stage('Build ARM64') {
|
||||||
|
|
@ -527,10 +630,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "Running on node: ${NODE_NAME}"
|
echo "Running on node: ${NODE_NAME}"
|
||||||
echo 'Logging into Github'
|
|
||||||
sh '''#! /bin/bash
|
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
|
||||||
'''
|
|
||||||
sh "docker buildx build \
|
sh "docker buildx build \
|
||||||
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
|
||||||
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
--label \"org.opencontainers.image.authors=linuxserver.io\" \
|
||||||
|
|
@ -545,17 +644,50 @@ pipeline {
|
||||||
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
--label \"org.opencontainers.image.title=Baseimage-alpine\" \
|
||||||
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
--label \"org.opencontainers.image.description=baseimage-alpine image by linuxserver.io\" \
|
||||||
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
|
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
|
||||||
|
--provenance=true --sbom=true --builder=container --load \
|
||||||
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
|
||||||
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
sh '''#! /bin/bash
|
||||||
retry(5) {
|
set -e
|
||||||
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker tag ${IMAGE}:arm64v8-${META_TAG} ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
|
done
|
||||||
|
'''
|
||||||
|
withCredentials([
|
||||||
|
[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'Quay.io-Robot',
|
||||||
|
usernameVariable: 'QUAYUSER',
|
||||||
|
passwordVariable: 'QUAYPASS'
|
||||||
|
]
|
||||||
|
]) {
|
||||||
|
retry_backoff(5,5) {
|
||||||
|
sh '''#! /bin/bash
|
||||||
|
set -e
|
||||||
|
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
||||||
|
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
|
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||||
|
if [[ "${PACKAGE_CHECK}" != "true" ]]; then
|
||||||
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
|
for i in "${CACHE[@]}"; do
|
||||||
|
docker push ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} &
|
||||||
|
done
|
||||||
|
for p in $(jobs -p); do
|
||||||
|
wait "$p" || { echo "job $p failed" >&2; exit 1; }
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
containers=$(docker ps -aq)
|
containers=$(docker ps -aq)
|
||||||
if [[ -n "${containers}" ]]; then
|
if [[ -n "${containers}" ]]; then
|
||||||
docker stop ${containers}
|
docker stop ${containers}
|
||||||
fi
|
fi
|
||||||
docker system prune -af --volumes || : '''
|
docker system prune -f --volumes || :
|
||||||
|
docker image prune -af || :
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -563,7 +695,7 @@ pipeline {
|
||||||
// Take the image we just built and dump package versions for comparison
|
// Take the image we just built and dump package versions for comparison
|
||||||
stage('Update-packages') {
|
stage('Update-packages') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
|
|
@ -586,14 +718,14 @@ pipeline {
|
||||||
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
|
||||||
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
||||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
|
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f 3.19
|
||||||
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
||||||
cd ${TEMPDIR}/${LS_REPO}/
|
cd ${TEMPDIR}/${LS_REPO}/
|
||||||
wait
|
wait
|
||||||
git add package_versions.txt
|
git add package_versions.txt
|
||||||
git commit -m 'Bot Updating Package Versions'
|
git commit -m 'Bot Updating Package Versions'
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git 3.19
|
||||||
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
echo "Package tag updated, stopping build process"
|
echo "Package tag updated, stopping build process"
|
||||||
else
|
else
|
||||||
|
|
@ -611,7 +743,7 @@ pipeline {
|
||||||
// Exit the build if the package file was just updated
|
// Exit the build if the package file was just updated
|
||||||
stage('PACKAGE-exit') {
|
stage('PACKAGE-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'PACKAGE_UPDATED', value: 'true'
|
environment name: 'PACKAGE_UPDATED', value: 'true'
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
|
@ -625,7 +757,7 @@ pipeline {
|
||||||
// Exit the build if this is just a package check and there are no changes to push
|
// Exit the build if this is just a package check and there are no changes to push
|
||||||
stage('PACKAGECHECK-exit') {
|
stage('PACKAGECHECK-exit') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'PACKAGE_UPDATED', value: 'false'
|
environment name: 'PACKAGE_UPDATED', value: 'false'
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
|
|
@ -659,27 +791,37 @@ pipeline {
|
||||||
}
|
}
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
if grep -q 'docker-baseimage' <<< "${LS_REPO}"; then
|
||||||
|
echo "Detected baseimage, setting LSIO_FIRST_PARTY=true"
|
||||||
|
if [ -n "${CI_DOCKERENV}" ]; then
|
||||||
|
CI_DOCKERENV="LSIO_FIRST_PARTY=true|${CI_DOCKERENV}"
|
||||||
|
else
|
||||||
|
CI_DOCKERENV="LSIO_FIRST_PARTY=true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
docker pull ghcr.io/linuxserver/ci:latest
|
docker pull ghcr.io/linuxserver/ci:latest
|
||||||
if [ "${MULTIARCH}" == "true" ]; then
|
if [ "${MULTIARCH}" == "true" ]; then
|
||||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} --platform=arm64
|
||||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
||||||
fi
|
fi
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--shm-size=1gb \
|
--shm-size=1gb \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-e IMAGE=\"${IMAGE}\" \
|
-e IMAGE=\"${IMAGE}\" \
|
||||||
-e DELAY_START=\"${CI_DELAY}\" \
|
-e DOCKER_LOGS_TIMEOUT=\"${CI_DELAY}\" \
|
||||||
-e TAGS=\"${CI_TAGS}\" \
|
-e TAGS=\"${CI_TAGS}\" \
|
||||||
-e META_TAG=\"${META_TAG}\" \
|
-e META_TAG=\"${META_TAG}\" \
|
||||||
|
-e RELEASE_TAG=\"3.19\" \
|
||||||
-e PORT=\"${CI_PORT}\" \
|
-e PORT=\"${CI_PORT}\" \
|
||||||
-e SSL=\"${CI_SSL}\" \
|
-e SSL=\"${CI_SSL}\" \
|
||||||
-e BASE=\"${DIST_IMAGE}\" \
|
-e BASE=\"${DIST_IMAGE}\" \
|
||||||
-e SECRET_KEY=\"${S3_SECRET}\" \
|
-e SECRET_KEY=\"${S3_SECRET}\" \
|
||||||
-e ACCESS_KEY=\"${S3_KEY}\" \
|
-e ACCESS_KEY=\"${S3_KEY}\" \
|
||||||
-e DOCKER_ENV=\"LSIO_FIRST_PARTY=true|${CI_DOCKERENV}\" \
|
-e DOCKER_ENV=\"${CI_DOCKERENV}\" \
|
||||||
-e WEB_SCREENSHOT=\"${CI_WEB}\" \
|
-e WEB_SCREENSHOT=\"${CI_WEB}\" \
|
||||||
-e WEB_AUTH=\"${CI_AUTH}\" \
|
-e WEB_AUTH=\"${CI_AUTH}\" \
|
||||||
-e WEB_PATH=\"${CI_WEBPATH}\" \
|
-e WEB_PATH=\"${CI_WEBPATH}\" \
|
||||||
|
-e NODE_NAME=\"${NODE_NAME}\" \
|
||||||
-t ghcr.io/linuxserver/ci:latest \
|
-t ghcr.io/linuxserver/ci:latest \
|
||||||
python3 test_build.py'''
|
python3 test_build.py'''
|
||||||
}
|
}
|
||||||
|
|
@ -695,40 +837,26 @@ pipeline {
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
retry_backoff(5,5) {
|
||||||
[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: 'Quay.io-Robot',
|
|
||||||
usernameVariable: 'QUAYUSER',
|
|
||||||
passwordVariable: 'QUAYPASS'
|
|
||||||
]
|
|
||||||
]) {
|
|
||||||
retry(5) {
|
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
for PUSHIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
[[ ${PUSHIMAGE%%/*} =~ \\. ]] && PUSHIMAGEPLUS="${PUSHIMAGE}" || PUSHIMAGEPLUS="docker.io/${PUSHIMAGE}"
|
||||||
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
for i in "${CACHE[@]}"; do
|
||||||
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
|
if [[ "${PUSHIMAGEPLUS}" == "$(cut -d "/" -f1 <<< ${i})"* ]]; then
|
||||||
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
|
CACHEIMAGE=${i}
|
||||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:3.19
|
|
||||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
|
||||||
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${SEMVER}
|
|
||||||
fi
|
fi
|
||||||
docker push ${PUSHIMAGE}:3.19
|
done
|
||||||
docker push ${PUSHIMAGE}:${META_TAG}
|
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${META_TAG} -t ${PUSHIMAGE}:3.19 -t ${PUSHIMAGE}:${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG}
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
if [ -n "${SEMVER}" ]; then
|
||||||
docker push ${PUSHIMAGE}:${SEMVER}
|
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// If this is a multi arch release push all images and define the manifest
|
// If this is a multi arch release push all images and define the manifest
|
||||||
stage('Docker-Push-Multi') {
|
stage('Docker-Push-Multi') {
|
||||||
when {
|
when {
|
||||||
|
|
@ -736,86 +864,41 @@ pipeline {
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
retry_backoff(5,5) {
|
||||||
[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: 'Quay.io-Robot',
|
|
||||||
usernameVariable: 'QUAYUSER',
|
|
||||||
passwordVariable: 'QUAYPASS'
|
|
||||||
]
|
|
||||||
]) {
|
|
||||||
retry(5) {
|
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
|
|
||||||
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
|
||||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
|
||||||
if [ "${CI}" == "false" ]; then
|
|
||||||
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
|
||||||
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
|
|
||||||
fi
|
|
||||||
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
|
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
|
||||||
docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG}
|
[[ ${MANIFESTIMAGE%%/*} =~ \\. ]] && MANIFESTIMAGEPLUS="${MANIFESTIMAGE}" || MANIFESTIMAGEPLUS="docker.io/${MANIFESTIMAGE}"
|
||||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-3.19
|
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
|
||||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
for i in "${CACHE[@]}"; do
|
||||||
docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
if [[ "${MANIFESTIMAGEPLUS}" == "$(cut -d "/" -f1 <<< ${i})"* ]]; then
|
||||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-3.19
|
CACHEIMAGE=${i}
|
||||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
|
||||||
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${SEMVER}
|
|
||||||
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
|
||||||
fi
|
fi
|
||||||
docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
|
done
|
||||||
docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
|
docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:amd64-${META_TAG} -t ${MANIFESTIMAGE}:amd64-3.19 -t ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
docker push ${MANIFESTIMAGE}:amd64-3.19
|
docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:arm64v8-${META_TAG} -t ${MANIFESTIMAGE}:arm64v8-3.19 -t ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} ${CACHEIMAGE}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
|
||||||
docker push ${MANIFESTIMAGE}:arm64v8-3.19
|
|
||||||
docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
if [ -n "${SEMVER}" ]; then
|
||||||
docker push ${MANIFESTIMAGE}:amd64-${SEMVER}
|
docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:amd64-${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
docker push ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
docker buildx imagetools create --prefer-index=false -t ${MANIFESTIMAGE}:arm64v8-${SEMVER} ${CACHEIMAGE}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
fi
|
fi
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:3.19 || :
|
done
|
||||||
docker manifest create ${MANIFESTIMAGE}:3.19 ${MANIFESTIMAGE}:amd64-3.19 ${MANIFESTIMAGE}:arm64v8-3.19
|
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
|
||||||
docker manifest annotate ${MANIFESTIMAGE}:3.19 ${MANIFESTIMAGE}:arm64v8-3.19 --os linux --arch arm64 --variant v8
|
docker buildx imagetools create -t ${MANIFESTIMAGE}:3.19 ${MANIFESTIMAGE}:amd64-3.19 ${MANIFESTIMAGE}:arm64v8-3.19
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || :
|
docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
||||||
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
|
|
||||||
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
|
docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || :
|
|
||||||
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
|
|
||||||
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
if [ -n "${SEMVER}" ]; then
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER} || :
|
docker buildx imagetools create -t ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
||||||
docker manifest create ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
|
|
||||||
docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} --os linux --arch arm64 --variant v8
|
|
||||||
fi
|
|
||||||
token=$(curl -sX GET "https://ghcr.io/token?scope=repository%3Alinuxserver%2F${CONTAINER_NAME}%3Apull" | jq -r '.token')
|
|
||||||
digest=$(curl -s \
|
|
||||||
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
|
||||||
--header "Authorization: Bearer ${token}" \
|
|
||||||
"https://ghcr.io/v2/linuxserver/${CONTAINER_NAME}/manifests/arm32v7-3.19")
|
|
||||||
if [[ $(echo "$digest" | jq -r '.layers') != "null" ]]; then
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:arm32v7-3.19 || :
|
|
||||||
docker manifest create ${MANIFESTIMAGE}:arm32v7-3.19 ${MANIFESTIMAGE}:amd64-3.19
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:arm32v7-3.19
|
|
||||||
fi
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:3.19
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG}
|
|
||||||
if [ -n "${SEMVER}" ]; then
|
|
||||||
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER}
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// If this is a public release tag it in the LS Github
|
// If this is a public release tag it in the LS Github
|
||||||
stage('Github-Tag-Push-Release') {
|
stage('Github-Tag-Push-Release') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
expression {
|
expression {
|
||||||
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
|
||||||
}
|
}
|
||||||
|
|
@ -827,17 +910,17 @@ pipeline {
|
||||||
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
|
||||||
-d '{"tag":"'${META_TAG}'",\
|
-d '{"tag":"'${META_TAG}'",\
|
||||||
"object": "'${COMMIT_SHA}'",\
|
"object": "'${COMMIT_SHA}'",\
|
||||||
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
|
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to 3.19",\
|
||||||
"type": "commit",\
|
"type": "commit",\
|
||||||
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
"tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
||||||
echo "Pushing New release for Tag"
|
echo "Pushing New release for Tag"
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
echo "Updating base packages to ${PACKAGE_TAG}" > releasebody.json
|
echo "Updating base packages to ${PACKAGE_TAG}" > releasebody.json
|
||||||
echo '{"tag_name":"'${META_TAG}'",\
|
echo '{"tag_name":"'${META_TAG}'",\
|
||||||
"target_commitish": "master",\
|
"target_commitish": "3.19",\
|
||||||
"name": "'${META_TAG}'",\
|
"name": "'${META_TAG}'",\
|
||||||
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**OS Changes:**\\n\\n' > start
|
"body": "**CI Report:**\\n\\n'${CI_URL:-N/A}'\\n\\n**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start
|
||||||
printf '","draft": false,"prerelease": false}' >> releasebody.json
|
printf '","draft": false,"prerelease": true}' >> releasebody.json
|
||||||
paste -d'\\0' start releasebody.json > releasebody.json.done
|
paste -d'\\0' start releasebody.json > releasebody.json.done
|
||||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
|
||||||
}
|
}
|
||||||
|
|
@ -845,14 +928,14 @@ pipeline {
|
||||||
// Add protection to the release branch
|
// Add protection to the release branch
|
||||||
stage('Github-Release-Branch-Protection') {
|
stage('Github-Release-Branch-Protection') {
|
||||||
when {
|
when {
|
||||||
branch "master"
|
branch "3.19"
|
||||||
environment name: 'CHANGE_ID', value: ''
|
environment name: 'CHANGE_ID', value: ''
|
||||||
environment name: 'EXIT_STATUS', value: ''
|
environment name: 'EXIT_STATUS', value: ''
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "Setting up protection for release branch master"
|
echo "Setting up protection for release branch 3.19"
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X PUT https://api.github.com/repos/${LS_USER}/${LS_REPO}/branches/master/protection \
|
curl -H "Authorization: token ${GITHUB_TOKEN}" -X PUT https://api.github.com/repos/${LS_USER}/${LS_REPO}/branches/3.19/protection \
|
||||||
-d $(jq -c . << EOF
|
-d $(jq -c . << EOF
|
||||||
{
|
{
|
||||||
"required_status_checks": null,
|
"required_status_checks": null,
|
||||||
|
|
@ -961,32 +1044,94 @@ EOF
|
||||||
###################### */
|
###################### */
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
sh '''#!/bin/bash
|
||||||
|
rm -rf /config/.ssh/id_sign
|
||||||
|
rm -rf /config/.ssh/id_sign.pub
|
||||||
|
git config --global --unset gpg.format
|
||||||
|
git config --global --unset user.signingkey
|
||||||
|
git config --global --unset commit.gpgsign
|
||||||
|
'''
|
||||||
script{
|
script{
|
||||||
|
env.JOB_DATE = sh(
|
||||||
|
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
|
||||||
|
returnStdout: true).trim()
|
||||||
if (env.EXIT_STATUS == "ABORTED"){
|
if (env.EXIT_STATUS == "ABORTED"){
|
||||||
sh 'echo "build aborted"'
|
sh 'echo "build aborted"'
|
||||||
|
}else{
|
||||||
|
if (currentBuild.currentResult == "SUCCESS"){
|
||||||
|
if (env.GITHUBIMAGE =~ /lspipepr/){
|
||||||
|
env.JOB_WEBHOOK_STATUS='Success'
|
||||||
|
env.JOB_WEBHOOK_COLOUR=3957028
|
||||||
|
env.JOB_WEBHOOK_FOOTER='PR Build'
|
||||||
|
}else if (env.GITHUBIMAGE =~ /lsiodev/){
|
||||||
|
env.JOB_WEBHOOK_STATUS='Success'
|
||||||
|
env.JOB_WEBHOOK_COLOUR=3957028
|
||||||
|
env.JOB_WEBHOOK_FOOTER='Dev Build'
|
||||||
|
}else{
|
||||||
|
env.JOB_WEBHOOK_STATUS='Success'
|
||||||
|
env.JOB_WEBHOOK_COLOUR=1681177
|
||||||
|
env.JOB_WEBHOOK_FOOTER='Live Build'
|
||||||
}
|
}
|
||||||
else if (currentBuild.currentResult == "SUCCESS"){
|
}else{
|
||||||
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"color": 1681177,\
|
if (env.GITHUBIMAGE =~ /lspipepr/){
|
||||||
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** Success\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
env.JOB_WEBHOOK_STATUS='Failure'
|
||||||
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
env.JOB_WEBHOOK_COLOUR=12669523
|
||||||
|
env.JOB_WEBHOOK_FOOTER='PR Build'
|
||||||
|
}else if (env.GITHUBIMAGE =~ /lsiodev/){
|
||||||
|
env.JOB_WEBHOOK_STATUS='Failure'
|
||||||
|
env.JOB_WEBHOOK_COLOUR=12669523
|
||||||
|
env.JOB_WEBHOOK_FOOTER='Dev Build'
|
||||||
|
}else{
|
||||||
|
env.JOB_WEBHOOK_STATUS='Failure'
|
||||||
|
env.JOB_WEBHOOK_COLOUR=16711680
|
||||||
|
env.JOB_WEBHOOK_FOOTER='Live Build'
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"color": 16711680,\
|
sh ''' curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/jenkins-avatar.png","embeds": [{"'color'": '${JOB_WEBHOOK_COLOUR}',\
|
||||||
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** failure\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
"footer": {"text" : "'"${JOB_WEBHOOK_FOOTER}"'"},\
|
||||||
|
"timestamp": "'${JOB_DATE}'",\
|
||||||
|
"description": "**Build:** '${BUILD_NUMBER}'\\n**CI Results:** '${CI_URL}'\\n**ShellCheck Results:** '${SHELLCHECK_URL}'\\n**Status:** '${JOB_WEBHOOK_STATUS}'\\n**Job:** '${RUN_DISPLAY_URL}'\\n**Change:** '${CODE_URL}'\\n**External Release:**: '${RELEASE_LINK}'\\n**DockerHub:** '${DOCKERHUB_LINK}'\\n"}],\
|
||||||
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanup {
|
cleanup {
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
echo "Performing docker system prune!!"
|
echo "Pruning builder!!"
|
||||||
containers=$(docker ps -aq)
|
docker builder prune -f --builder container || :
|
||||||
|
containers=$(docker ps -q)
|
||||||
if [[ -n "${containers}" ]]; then
|
if [[ -n "${containers}" ]]; then
|
||||||
docker stop ${containers}
|
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
|
||||||
|
for container in ${containers}; do
|
||||||
|
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
|
||||||
|
echo "skipping buildx container in docker stop"
|
||||||
|
else
|
||||||
|
echo "Stopping container ${container}"
|
||||||
|
docker stop ${container}
|
||||||
fi
|
fi
|
||||||
docker system prune -af --volumes || :
|
done
|
||||||
|
fi
|
||||||
|
docker system prune -f --volumes || :
|
||||||
|
docker image prune -af || :
|
||||||
'''
|
'''
|
||||||
cleanWs()
|
cleanWs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def retry_backoff(int max_attempts, int power_base, Closure c) {
|
||||||
|
int n = 0
|
||||||
|
while (n < max_attempts) {
|
||||||
|
try {
|
||||||
|
c()
|
||||||
|
return
|
||||||
|
} catch (err) {
|
||||||
|
if ((n + 1) >= max_attempts) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
sleep(power_base ** n)
|
||||||
|
n++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
||||||
<!-- Please read https://github.com/linuxserver/docker-baseimage-alpine/blob/master/.github/CONTRIBUTING.md -->
|
<!-- Please read https://github.com/linuxserver/docker-baseimage-alpine/blob/3.19/.github/CONTRIBUTING.md -->
|
||||||
[linuxserverurl]: https://linuxserver.io
|
[linuxserverurl]: https://linuxserver.io
|
||||||
[forumurl]: https://forum.linuxserver.io
|
[forumurl]: https://forum.linuxserver.io
|
||||||
[ircurl]: https://mibbit.com/?server=irc.libera.chat&channel=%23linuxserver.io
|
[ircurl]: https://mibbit.com/?server=irc.libera.chat&channel=%23linuxserver.io
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
# jenkins variables
|
# jenkins variables
|
||||||
project_name: docker-baseimage-alpine
|
project_name: docker-baseimage-alpine
|
||||||
external_type: os
|
external_type: os
|
||||||
release_type: stable
|
release_type: prerelease
|
||||||
release_tag: "3.19"
|
release_tag: "3.19"
|
||||||
ls_branch: master
|
ls_branch: "3.19"
|
||||||
repo_vars:
|
repo_vars:
|
||||||
- BUILD_VERSION_ARG = 'OS'
|
- BUILD_VERSION_ARG = 'OS'
|
||||||
- LS_USER = 'linuxserver'
|
- LS_USER = 'linuxserver'
|
||||||
|
|
@ -21,6 +21,6 @@ repo_vars:
|
||||||
- CI_PORT='80'
|
- CI_PORT='80'
|
||||||
- CI_SSL='true'
|
- CI_SSL='true'
|
||||||
- CI_DELAY='30'
|
- CI_DELAY='30'
|
||||||
- CI_DOCKERENV='TZ=US/Pacific|LSIO_FIRST_PARTY=true'
|
- CI_DOCKERENV='LSIO_FIRST_PARTY=true'
|
||||||
- CI_AUTH='user:password'
|
- CI_AUTH=''
|
||||||
- CI_WEBPATH=''
|
- CI_WEBPATH=''
|
||||||
|
|
|
||||||
|
|
@ -2,39 +2,40 @@ NAME VERSION TYPE
|
||||||
alpine-baselayout 3.4.3-r2 apk
|
alpine-baselayout 3.4.3-r2 apk
|
||||||
alpine-baselayout-data 3.4.3-r2 apk
|
alpine-baselayout-data 3.4.3-r2 apk
|
||||||
alpine-keys 2.4-r1 apk
|
alpine-keys 2.4-r1 apk
|
||||||
alpine-release 3.19.1-r0 apk
|
alpine-release 3.19.7-r0 apk
|
||||||
apk-tools 2.14.4-r0 apk
|
apk-tools 2.14.4-r0 apk
|
||||||
bash 5.2.21-r0 apk
|
bash 5.2.21-r0 apk
|
||||||
brotli-libs 1.1.0-r1 apk
|
brotli-libs 1.1.0-r1 apk
|
||||||
busybox 1.36.1-r15 apk
|
busybox 1.36.1-r19 apk
|
||||||
busybox-binsh 1.36.1-r15 apk
|
busybox-binsh 1.36.1-r19 apk
|
||||||
c-ares 1.27.0-r0 apk
|
c-ares 1.27.0-r0 apk
|
||||||
ca-certificates 20240226-r0 apk
|
ca-certificates 20241121-r1 apk
|
||||||
ca-certificates-bundle 20240226-r0 apk
|
ca-certificates-bundle 20241121-r1 apk
|
||||||
catatonit 0.2.0-r0 apk
|
catatonit 0.2.0-r0 apk
|
||||||
coreutils 9.4-r2 apk
|
coreutils 9.4-r2 apk
|
||||||
coreutils-env 9.4-r2 apk
|
coreutils-env 9.4-r2 apk
|
||||||
coreutils-fmt 9.4-r2 apk
|
coreutils-fmt 9.4-r2 apk
|
||||||
coreutils-sha512sum 9.4-r2 apk
|
coreutils-sha512sum 9.4-r2 apk
|
||||||
curl 8.5.0-r0 apk
|
curl 8.12.1-r0 apk
|
||||||
findutils 4.9.0-r5 apk
|
findutils 4.9.0-r5 apk
|
||||||
jq 1.7.1-r0 apk
|
jq 1.7.1-r0 apk
|
||||||
libacl 2.3.1-r4 apk
|
libacl 2.3.1-r4 apk
|
||||||
libattr 2.5.1-r5 apk
|
libattr 2.5.1-r5 apk
|
||||||
libbsd 0.11.7-r3 apk
|
libbsd 0.11.7-r3 apk
|
||||||
libc-utils 0.7.2-r5 apk
|
libc-utils 0.7.2-r5 apk
|
||||||
libcrypto3 3.1.4-r6 apk
|
libcrypto3 3.1.8-r0 apk
|
||||||
libcurl 8.5.0-r0 apk
|
libcurl 8.12.1-r0 apk
|
||||||
libidn2 2.3.4-r4 apk
|
libidn2 2.3.4-r4 apk
|
||||||
libintl 0.22.3-r0 apk
|
libintl 0.22.3-r0 apk
|
||||||
libmd 1.1.0-r0 apk
|
libmd 1.1.0-r0 apk
|
||||||
libncursesw 6.4_p20231125-r0 apk
|
libncursesw 6.4_p20231125-r0 apk
|
||||||
libproc2 4.0.4-r0 apk
|
libproc2 4.0.4-r0 apk
|
||||||
libssl3 3.1.4-r6 apk
|
libpsl 0.21.5-r0 apk
|
||||||
|
libssl3 3.1.8-r0 apk
|
||||||
libunistring 1.1-r2 apk
|
libunistring 1.1-r2 apk
|
||||||
linux-pam 1.5.3-r7 apk
|
linux-pam 1.5.3-r7 apk
|
||||||
musl 1.2.4_git20230717-r4 apk
|
musl 1.2.4_git20230717-r5 apk
|
||||||
musl-utils 1.2.4_git20230717-r4 apk
|
musl-utils 1.2.4_git20230717-r5 apk
|
||||||
ncurses-terminfo-base 6.4_p20231125-r0 apk
|
ncurses-terminfo-base 6.4_p20231125-r0 apk
|
||||||
netcat-openbsd 1.226-r0 apk
|
netcat-openbsd 1.226-r0 apk
|
||||||
nghttp2-libs 1.58.0-r0 apk
|
nghttp2-libs 1.58.0-r0 apk
|
||||||
|
|
@ -44,7 +45,7 @@ readline 8.2.1-r2 apk
|
||||||
scanelf 1.3.7-r2 apk
|
scanelf 1.3.7-r2 apk
|
||||||
shadow 4.14.2-r0 apk
|
shadow 4.14.2-r0 apk
|
||||||
skalibs 2.14.0.1-r0 apk
|
skalibs 2.14.0.1-r0 apk
|
||||||
ssl_client 1.36.1-r15 apk
|
ssl_client 1.36.1-r19 apk
|
||||||
tzdata 2024a-r0 apk
|
tzdata 2025b-r0 apk
|
||||||
utmps-libs 0.1.2.2-r0 apk
|
utmps-libs 0.1.2.2-r0 apk
|
||||||
zlib 1.3.1-r0 apk
|
zlib 1.3.1-r0 apk
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue