Compare commits

...
Author SHA1 Message Date
LinuxServer-CI de0a9503e4 Bot Updating Package Versions 2024-03-16 15:52:54 +00:00
LinuxServer-CI 075e28475e Bot Updating Package Versions 2024-03-13 15:55:22 +00:00
LinuxServer-CI bab3fc7f84 Bot Updating Templated Files 2024-03-13 15:51:57 +00:00
LinuxServer-CI 323a26601f Bot Updating Package Versions 2024-03-08 15:55:07 +00:00
2 changed files with 54 additions and 25 deletions
Vendored
+45 -16
View File
@@ -278,8 +278,15 @@ pipeline {
set -e
TEMPDIR=$(mktemp -d)
docker pull ghcr.io/linuxserver/jenkins-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=main -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
# Stage 1 - Jenkinsfile update
# Cloned repo paths for templating:
# ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch main of ${LS_USER}/${LS_REPO} for running the jenkins builder on
# ${TEMPDIR}/repo/${LS_REPO}: Cloned branch main 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}/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
git clone --branch main --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 ghcr.io/linuxserver/jenkins-builder:latest
echo "Starting Stage 1 - Jenkinsfile update"
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
@@ -291,13 +298,13 @@ pipeline {
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "Updating Jenkinsfile"
echo "Updating Jenkinsfile and exiting build, new one will trigger based on commit"
rm -Rf ${TEMPDIR}
exit 0
else
echo "Jenkinsfile is up to date."
fi
# 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"
for i in ${OLD_TEMPLATES}; do
if [[ -f "${i}" ]]; then
@@ -316,13 +323,13 @@ pipeline {
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "Deleting old and deprecated templates"
echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit"
rm -Rf ${TEMPDIR}
exit 0
else
echo "No templates to delete"
fi
# Stage 3 - Update templates
echo "Starting Stage 3 - Update templates"
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
@@ -346,9 +353,14 @@ pipeline {
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git main
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "Updating templates and exiting build, new one will trigger based on commit"
rm -Rf ${TEMPDIR}
exit 0
else
echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "No templates to update"
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
@@ -356,6 +368,7 @@ pipeline {
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} || \
@@ -363,6 +376,8 @@ pipeline {
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
@@ -373,6 +388,7 @@ pipeline {
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; then
@@ -392,16 +408,27 @@ pipeline {
sleep $((RANDOM % MAXWAIT)) && \
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase && \
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH})
else
echo "No updates to Unraid template needed, skipping"
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
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
if curl -s https://hub.docker.com/v2/namespaces/${DOCKERHUB_IMAGE%%/*}/repositories/${DOCKERHUB_IMAGE##*/}/tags | jq -r '.message' | grep -q 404; then
echo "Docker Hub endpoint doesn't exist. Creating endpoint first."
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')
curl -s \
-H "Authorization: JWT ${DH_TOKEN}" \
-H "Content-Type: application/json" \
-X POST \
-d '{"name":"'${DOCKERHUB_IMAGE##*/}'", "namespace":"'${DOCKERHUB_IMAGE%%/*}'"}' \
https://hub.docker.com/v2/repositories/ || :
fi
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')
curl -s \
-H "Authorization: JWT ${DH_TOKEN}" \
@@ -466,14 +493,16 @@ pipeline {
}
steps{
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}',\
"name":"'${LS_REPO}'",
"mirror":true,\
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
"issues_access_level":"disabled",\
"merge_requests_access_level":"disabled",\
"repository_access_level":"enabled",\
"visibility":"public"}' '''
-d '{"namespace_id":'${GITLAB_NAMESPACE}',\
"name":"'${LS_REPO}'",
"mirror":true,\
"import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\
"issues_access_level":"disabled",\
"merge_requests_access_level":"disabled",\
"repository_access_level":"enabled",\
"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" '''
}
}
/* ###############
+9 -9
View File
@@ -7,7 +7,7 @@ Flask 3.0.0 python
Flask-Compress 1.14 python
Flask-Cors 4.0.0 python
Flask-Login 0.6.3 python
FlexGet 3.11.21 python
FlexGet 3.11.24 python
Jinja2 3.1.3 python
MarkupSafe 2.1.3 python
PyRSS2Gen 1.1 python
@@ -22,6 +22,7 @@ alpine-keys 2.4-r1 apk
alpine-release 3.18.6-r0 apk
aniso8601 9.0.1 python
annotated-types 0.6.0 python
anyio 4.3.0 python
apk-tools 2.14.0-r2 apk
attrs 23.2.0 python
autocommand 2.2.2 python
@@ -38,23 +39,23 @@ c-ares 1.19.1-r0 apk
ca-certificates 20230506-r0 apk
ca-certificates-bundle 20230506-r0 apk
certifi 2023.11.17 python
cffi 1.16.0 python
charset-normalizer 3.3.2 python
cheroot 10.0.0 python
click 8.1.7 python
cloudscraper 1.2.71 python
colorama 0.4.6 python
coreutils 9.3-r2 apk
cryptography 41.0.7 python
curl 8.5.0-r0 apk
decorator 5.1.1 python
deluge-client 1.9.0 python
feedparser 6.0.11 python
flask-restx 1.3.0 python
gdbm 1.23-r1 apk
greenlet 3.0.3 python
guessit 3.8.0 python
h11 0.14.0 python
html5lib 1.1 python
httpcore 1.0.4 python
httpx 0.27.0 python
icu-data-en 73.2-r2 apk
icu-libs 73.2-r2 apk
idna 3.6 python
@@ -75,7 +76,7 @@ libbz2 1.0.8-r5 apk
libc-utils 0.7.2-r5 apk
libcrypto3 3.1.4-r5 apk
libcurl 8.5.0-r0 apk
libexpat 2.6.0-r0 apk
libexpat 2.6.2-r0 apk
libffi 3.4.4-r2 apk
libgcc 12.2.1_git20220924-r10 apk
libidn2 2.3.4-r1 apk
@@ -108,13 +109,12 @@ portend 3.2.0 python
procps-ng 4.0.4-r0 apk
psutil 5.9.7 python
pyc 0.1-r0 apk
pycparser 2.21 python
pydantic 2.5.3 python
pydantic_core 2.14.6 python
pynzb 0.1.0 python
pyparsing 3.1.1 python
python-dateutil 2.8.2 python
python-telegram-bot 12.8 python
python-telegram-bot 21.0.1 python
python3 3.11.8-r0 apk
python3-pyc 3.11.8-r0 apk
python3-pycache-pyc0 3.11.8-r0 apk
@@ -134,12 +134,12 @@ sgmllib3k 1.0.0 python
shadow 4.13-r4 apk
six 1.16.0 python
skalibs 2.13.1.1-r1 apk
sniffio 1.3.1 python
soupsieve 2.5 python
sqlite-libs 3.41.2-r3 apk
ssl_client 1.36.1-r5 apk
tempora 5.5.0 python
time-machine 2.14.0 python
tornado 6.4 python
transmission-rpc 7.0.3 python
triangular 2.5.0 npm
typing_extensions 4.9.0 python
@@ -149,7 +149,7 @@ tzlocal 5.2 python
urllib3 1.26.18 python
utmps-libs 0.1.2.1-r1 apk
webencodings 0.5.1 python
wheel 0.42.0 python
wheel 0.43.0 python
xz-libs 5.4.3-r0 apk
zc.lockfile 3.0.post1 python
zlib 1.2.13-r1 apk