mirror of
https://github.com/linuxserver/docker-code-server
synced 2025-06-26 18:27:40 +00:00
Compare commits
25 Commits
4.20.1-ls1
...
4.89.0-ls2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5003b3fcb | ||
|
|
d29b22e87d | ||
|
|
722941437f | ||
|
|
5a956a2027 | ||
|
|
747361b094 | ||
|
|
7100957e39 | ||
|
|
775affa6bf | ||
|
|
eaeab3349e | ||
|
|
ff420fc155 | ||
|
|
818d5ade66 | ||
|
|
1d46aa716e | ||
|
|
17570939d5 | ||
|
|
0c5f0c4a76 | ||
|
|
73811e24e4 | ||
|
|
309d28852d | ||
|
|
67773aa923 | ||
|
|
b18e8877ad | ||
|
|
48262b8882 | ||
|
|
d2a5ef414a | ||
|
|
4931dd3b82 | ||
|
|
2d7ee3529b | ||
|
|
33e0d230c9 | ||
|
|
7d835391a9 | ||
|
|
3ce9c4e675 | ||
|
|
d6dbb82493 |
4
.github/ISSUE_TEMPLATE/issue.bug.yml
vendored
4
.github/ISSUE_TEMPLATE/issue.bug.yml
vendored
@@ -67,10 +67,10 @@ body:
|
|||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
description: |
|
description: |
|
||||||
Provide a full docker log, output of "docker logs linuxserver.io"
|
Provide a full docker log, output of "docker logs code-server"
|
||||||
label: Container logs
|
label: Container logs
|
||||||
placeholder: |
|
placeholder: |
|
||||||
Output of `docker logs linuxserver.io`
|
Output of `docker logs code-server`
|
||||||
render: bash
|
render: bash
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
2
.github/workflows/external_trigger.yml
vendored
2
.github/workflows/external_trigger.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
external-trigger-master:
|
external-trigger-master:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: External Trigger
|
- name: External Trigger
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
external-trigger-scheduler:
|
external-trigger-scheduler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/package_trigger.yml
vendored
2
.github/workflows/package_trigger.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
package-trigger-master:
|
package-trigger-master:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Package Trigger
|
- name: Package Trigger
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
package-trigger-scheduler:
|
package-trigger-scheduler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
|
|||||||
340
Jenkinsfile
vendored
340
Jenkinsfile
vendored
@@ -245,9 +245,11 @@ 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.17 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
|
ghcr.io/linuxserver/baseimage-alpine:3.19 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
|
||||||
apk add --no-cache py3-pip && \
|
apk add --no-cache python3 && \
|
||||||
pip install s3cmd && \
|
python3 -m venv /lsiopy && \
|
||||||
|
pip install --no-cache-dir -U pip && \
|
||||||
|
pip install --no-cache-dir s3cmd && \
|
||||||
s3cmd put --no-preserve --acl-public -m text/xml /mnt/shellcheck-result.xml s3://ci-tests.linuxserver.io/${IMAGE}/${META_TAG}/shellcheck-result.xml" || :'''
|
s3cmd put --no-preserve --acl-public -m text/xml /mnt/shellcheck-result.xml s3://ci-tests.linuxserver.io/${IMAGE}/${META_TAG}/shellcheck-result.xml" || :'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,150 +264,178 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
sh '''#! /bin/bash
|
||||||
[
|
set -e
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
TEMPDIR=$(mktemp -d)
|
||||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
docker pull ghcr.io/linuxserver/jenkins-builder:latest
|
||||||
usernameVariable: 'DOCKERUSER',
|
# Cloned repo paths for templating:
|
||||||
passwordVariable: 'DOCKERPASS'
|
# ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch master 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}/docs/docker-documentation: Cloned docs repo for pushing docs updates to Github
|
||||||
sh '''#! /bin/bash
|
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
|
||||||
set -e
|
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
|
||||||
TEMPDIR=$(mktemp -d)
|
git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
docker pull 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
|
||||||
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
|
echo "Starting Stage 1 - Jenkinsfile update"
|
||||||
# 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 master
|
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 master
|
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 master
|
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"
|
rm -Rf ${TEMPDIR}
|
||||||
rm -Rf ${TEMPDIR}
|
exit 0
|
||||||
exit 0
|
else
|
||||||
else
|
echo "Jenkinsfile is up to date."
|
||||||
echo "Jenkinsfile is up to date."
|
fi
|
||||||
|
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"
|
||||||
|
for i in ${OLD_TEMPLATES}; do
|
||||||
|
if [[ -f "${i}" ]]; then
|
||||||
|
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
|
||||||
fi
|
fi
|
||||||
# Stage 2 - Delete old templates
|
done
|
||||||
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"
|
if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then
|
||||||
for i in ${OLD_TEMPLATES}; do
|
mkdir -p ${TEMPDIR}/repo
|
||||||
if [[ -f "${i}" ]]; then
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
fi
|
git checkout -f master
|
||||||
|
for i in ${TEMPLATES_TO_DELETE}; do
|
||||||
|
git rm "${i}"
|
||||||
done
|
done
|
||||||
if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then
|
git commit -m 'Bot Updating Templated Files'
|
||||||
mkdir -p ${TEMPDIR}/repo
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
git checkout -f master
|
echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit"
|
||||||
for i in ${TEMPLATES_TO_DELETE}; do
|
rm -Rf ${TEMPDIR}
|
||||||
git rm "${i}"
|
exit 0
|
||||||
done
|
else
|
||||||
git commit -m 'Bot Updating Templated Files'
|
echo "No templates to delete"
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
fi
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
echo "Starting Stage 3 - Update templates"
|
||||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||||
echo "Deleting old and deprecated templates"
|
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
rm -Rf ${TEMPDIR}
|
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
||||||
exit 0
|
if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then
|
||||||
else
|
mkdir -p ${TEMPDIR}/repo
|
||||||
echo "No templates to delete"
|
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
||||||
fi
|
cd ${TEMPDIR}/repo/${LS_REPO}
|
||||||
# Stage 3 - Update templates
|
git checkout -f master
|
||||||
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
|
||||||
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
||||||
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
|
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
||||||
if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then
|
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
|
||||||
mkdir -p ${TEMPDIR}/repo
|
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
|
||||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
|
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}
|
cd ${TEMPDIR}/repo/${LS_REPO}/
|
||||||
git checkout -f master
|
if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then
|
||||||
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
|
echo ".jenkins-external" >> .gitignore
|
||||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
|
git add .gitignore
|
||||||
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
|
fi
|
||||||
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
|
git add readme-vars.yml ${TEMPLATED_FILES}
|
||||||
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
|
git commit -m 'Bot Updating Templated Files'
|
||||||
cd ${TEMPDIR}/repo/${LS_REPO}/
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
||||||
if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
||||||
echo ".jenkins-external" >> .gitignore
|
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
git add .gitignore
|
echo "Updating templates and exiting build, new one will trigger based on commit"
|
||||||
fi
|
rm -Rf ${TEMPDIR}
|
||||||
git add readme-vars.yml ${TEMPLATED_FILES}
|
exit 0
|
||||||
git commit -m 'Bot Updating Templated Files'
|
else
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
|
echo "No templates to update"
|
||||||
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
fi
|
||||||
|
echo "Starting Stage 4 - External repo updates: Docs, Unraid Template and Readme Sync to Docker Hub"
|
||||||
|
mkdir -p ${TEMPDIR}/docs
|
||||||
|
git clone 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
|
||||||
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/
|
||||||
|
cd ${TEMPDIR}/docs/docker-documentation
|
||||||
|
GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
|
||||||
|
git add docs/images/docker-${CONTAINER_NAME}.md
|
||||||
|
echo "Updating docs repo"
|
||||||
|
git commit -m 'Bot Updating Documentation'
|
||||||
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
|
||||||
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
|
||||||
|
(MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
|
||||||
|
sleep $((RANDOM % MAXWAIT)) && \
|
||||||
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase && \
|
||||||
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH})
|
||||||
|
else
|
||||||
|
echo "Docs update not needed, skipping"
|
||||||
|
fi
|
||||||
|
mkdir -p ${TEMPDIR}/unraid
|
||||||
|
git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates
|
||||||
|
git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates
|
||||||
|
if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then
|
||||||
|
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml
|
||||||
|
elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then
|
||||||
|
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml
|
||||||
|
fi
|
||||||
|
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
|
||||||
|
echo "Updating Unraid template"
|
||||||
|
cd ${TEMPDIR}/unraid/templates/
|
||||||
|
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
|
||||||
|
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
|
||||||
|
echo "Image is on the ignore list, and already in the deprecation folder."
|
||||||
|
elif grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
|
||||||
|
echo "Image is on the ignore list, marking Unraid template as deprecated"
|
||||||
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
|
||||||
|
git add -u unraid/${CONTAINER_NAME}.xml
|
||||||
|
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
|
||||||
|
git commit -m 'Bot Moving Deprecated Unraid Template' || :
|
||||||
else
|
else
|
||||||
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
|
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
|
||||||
|
git add unraid/${CONTAINER_NAME}.xml
|
||||||
|
git commit -m 'Bot Updating Unraid Template'
|
||||||
fi
|
fi
|
||||||
mkdir -p ${TEMPDIR}/docs
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase
|
||||||
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} || \
|
||||||
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
|
(MAXWAIT="10" && echo "Push to unraid templates failed, trying again in ${MAXWAIT} seconds" && \
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/
|
sleep $((RANDOM % MAXWAIT)) && \
|
||||||
cd ${TEMPDIR}/docs/docker-documentation
|
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase && \
|
||||||
GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
|
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH})
|
||||||
git add docs/images/docker-${CONTAINER_NAME}.md
|
else
|
||||||
git commit -m 'Bot Updating Documentation'
|
echo "No updates to Unraid template needed, skipping"
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH}
|
fi
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH}
|
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then
|
||||||
|
if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) -gt 25000 ]]; then
|
||||||
|
echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub"
|
||||||
|
DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite"
|
||||||
|
else
|
||||||
|
echo "Syncing readme to Docker Hub"
|
||||||
|
DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md"
|
||||||
fi
|
fi
|
||||||
mkdir -p ${TEMPDIR}/unraid
|
if curl -s https://hub.docker.com/v2/namespaces/${DOCKERHUB_IMAGE%%/*}/repositories/${DOCKERHUB_IMAGE##*/}/tags | jq -r '.message' | grep -q 404; then
|
||||||
git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates
|
echo "Docker Hub endpoint doesn't exist. Creating endpoint first."
|
||||||
git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates
|
DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token')
|
||||||
if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then
|
|
||||||
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml
|
|
||||||
elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then
|
|
||||||
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml
|
|
||||||
fi
|
|
||||||
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
|
|
||||||
cd ${TEMPDIR}/unraid/templates/
|
|
||||||
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
|
|
||||||
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
|
|
||||||
echo "Image is on the ignore list, marking Unraid template as deprecated"
|
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
|
|
||||||
git add -u unraid/${CONTAINER_NAME}.xml
|
|
||||||
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
|
|
||||||
git commit -m 'Bot Moving Deprecated Unraid Template' || :
|
|
||||||
else
|
|
||||||
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
|
|
||||||
git add unraid/${CONTAINER_NAME}.xml
|
|
||||||
git commit -m 'Bot Updating Unraid Template'
|
|
||||||
fi
|
|
||||||
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH}
|
|
||||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH}
|
|
||||||
fi
|
|
||||||
# Stage 4 - Sync Readme to Docker Hub
|
|
||||||
if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then
|
|
||||||
if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) > 25000 ]]; then
|
|
||||||
echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub"
|
|
||||||
DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite"
|
|
||||||
else
|
|
||||||
echo "Syncing readme to Docker Hub"
|
|
||||||
DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md"
|
|
||||||
fi
|
|
||||||
DH_TOKEN=$(curl -d '{"username":"'${DOCKERUSER}'", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token')
|
|
||||||
curl -s \
|
curl -s \
|
||||||
-H "Authorization: JWT ${DH_TOKEN}" \
|
-H "Authorization: JWT ${DH_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-X PATCH \
|
-X POST \
|
||||||
-d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \
|
-d '{"name":"'${DOCKERHUB_IMAGE##*/}'", "namespace":"'${DOCKERHUB_IMAGE%%/*}'"}' \
|
||||||
https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || :
|
https://hub.docker.com/v2/repositories/ || :
|
||||||
else
|
|
||||||
echo "Not the default Github branch. Skipping readme sync to Docker Hub."
|
|
||||||
fi
|
fi
|
||||||
rm -Rf ${TEMPDIR}'''
|
DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token')
|
||||||
script{
|
curl -s \
|
||||||
env.FILES_UPDATED = sh(
|
-H "Authorization: JWT ${DH_TOKEN}" \
|
||||||
script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''',
|
-H "Content-Type: application/json" \
|
||||||
returnStdout: true).trim()
|
-X PATCH \
|
||||||
}
|
-d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \
|
||||||
|
https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || :
|
||||||
|
else
|
||||||
|
echo "Not the default Github branch. Skipping readme sync to Docker Hub."
|
||||||
|
fi
|
||||||
|
rm -Rf ${TEMPDIR}'''
|
||||||
|
script{
|
||||||
|
env.FILES_UPDATED = sh(
|
||||||
|
script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''',
|
||||||
|
returnStdout: true).trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,14 +485,16 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps{
|
steps{
|
||||||
sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \
|
sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \
|
||||||
-d '{"namespace_id":'${GITLAB_NAMESPACE}',\
|
-d '{"namespace_id":'${GITLAB_NAMESPACE}',\
|
||||||
"name":"'${LS_REPO}'",
|
"name":"'${LS_REPO}'",
|
||||||
"mirror":true,\
|
"mirror":true,\
|
||||||
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
|
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
|
||||||
"issues_access_level":"disabled",\
|
"issues_access_level":"disabled",\
|
||||||
"merge_requests_access_level":"disabled",\
|
"merge_requests_access_level":"disabled",\
|
||||||
"repository_access_level":"enabled",\
|
"repository_access_level":"enabled",\
|
||||||
"visibility":"public"}' '''
|
"visibility":"public"}' '''
|
||||||
|
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" '''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* ###############
|
/* ###############
|
||||||
@@ -578,7 +610,7 @@ pipeline {
|
|||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
TEMPDIR=$(mktemp -d)
|
TEMPDIR=$(mktemp -d)
|
||||||
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
|
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" != "true" ]; then
|
||||||
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
|
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
|
||||||
else
|
else
|
||||||
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
|
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
|
||||||
@@ -703,12 +735,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
|
||||||
usernameVariable: 'DOCKERUSER',
|
|
||||||
passwordVariable: 'DOCKERPASS'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
credentialsId: 'Quay.io-Robot',
|
credentialsId: 'Quay.io-Robot',
|
||||||
@@ -719,7 +745,7 @@ pipeline {
|
|||||||
retry(5) {
|
retry(5) {
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --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 $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||||
@@ -750,12 +776,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
|
|
||||||
usernameVariable: 'DOCKERUSER',
|
|
||||||
passwordVariable: 'DOCKERPASS'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
credentialsId: 'Quay.io-Robot',
|
credentialsId: 'Quay.io-Robot',
|
||||||
@@ -766,7 +786,7 @@ pipeline {
|
|||||||
retry(5) {
|
retry(5) {
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
|
echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --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 $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
|
||||||
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
|
||||||
|
|||||||
1090
package_versions.txt
1090
package_versions.txt
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user