Skip to content

Commit f404fd3

Browse files
Bot Updating Templated Files
1 parent a2e762c commit f404fd3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Jenkinsfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,22 @@ pipeline {
336336
apt -qq list --installed | awk "{print \$1,\$2}" > /tmp/package_versions.txt && \
337337
chmod 777 /tmp/package_versions.txt'
338338
fi
339-
if [ "$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )" != "${PACKAGE_TAG}" ]; then
339+
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
340+
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
341+
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
340342
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
341343
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
342344
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
343345
cd ${TEMPDIR}/${LS_REPO}/
344-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git add package_versions.txt
345-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git commit -m 'Bot Updating Package Versions'
346-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
346+
wait
347+
git add package_versions.txt
348+
git commit -m 'Bot Updating Package Versions'
349+
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
347350
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
351+
echo "Package tag updated, stopping build process"
348352
else
349353
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
354+
echo "Package tag is same as previous continue with build process"
350355
fi
351356
rm -Rf ${TEMPDIR}'''
352357
script{

0 commit comments

Comments
 (0)