Skip to content

Commit db666b9

Browse files
Bot Updating Templated Files
1 parent 1b5c3f3 commit db666b9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Jenkinsfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pipeline {
123123
steps{
124124
script{
125125
env.EXT_RELEASE_CLEAN = sh(
126-
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:]//g' ''',
126+
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
127127
returnStdout: true).trim()
128128
}
129129
}
@@ -347,17 +347,22 @@ pipeline {
347347
apt -qq list --installed | awk "{print \$1,\$2}" > /tmp/package_versions.txt && \
348348
chmod 777 /tmp/package_versions.txt'
349349
fi
350-
if [ "$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )" != "${PACKAGE_TAG}" ]; then
350+
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
351+
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
352+
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
351353
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
352354
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
353355
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
354356
cd ${TEMPDIR}/${LS_REPO}/
355-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git add package_versions.txt
356-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git commit -m 'Bot Updating Package Versions'
357-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
357+
wait
358+
git add package_versions.txt
359+
git commit -m 'Bot Updating Package Versions'
360+
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
358361
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
362+
echo "Package tag updated, stopping build process"
359363
else
360364
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
365+
echo "Package tag is same as previous continue with build process"
361366
fi
362367
rm -Rf ${TEMPDIR}'''
363368
script{

0 commit comments

Comments
 (0)