mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2025-10-27 03:03:38 +09:00
Bot Updating Templated Files
This commit is contained in:
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@@ -345,17 +345,22 @@ pipeline {
|
||||
apt -qq list --installed | awk "{print \$1,\$2}" > /tmp/package_versions.txt && \
|
||||
chmod 777 /tmp/package_versions.txt'
|
||||
fi
|
||||
if [ "$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )" != "${PACKAGE_TAG}" ]; then
|
||||
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
|
||||
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
|
||||
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
|
||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
|
||||
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
|
||||
cd ${TEMPDIR}/${LS_REPO}/
|
||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git add package_versions.txt
|
||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git commit -m 'Bot Updating Package Versions'
|
||||
git --git-dir ${TEMPDIR}/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
wait
|
||||
git add package_versions.txt
|
||||
git commit -m 'Bot Updating Package Versions'
|
||||
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
|
||||
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Package tag updated, stopping build process"
|
||||
else
|
||||
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
|
||||
echo "Package tag is same as previous continue with build process"
|
||||
fi
|
||||
rm -Rf ${TEMPDIR}'''
|
||||
script{
|
||||
|
||||
Reference in New Issue
Block a user