Skip to content

Commit 7ed7b27

Browse files
Bot Updating Templated Files
1 parent 2275fdc commit 7ed7b27

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Jenkinsfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pipeline {
109109
steps{
110110
script{
111111
env.EXT_RELEASE_CLEAN = sh(
112-
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:]//g' ''',
112+
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
113113
returnStdout: true).trim()
114114
}
115115
}
@@ -330,20 +330,25 @@ pipeline {
330330
chmod 777 /tmp/package_versions.txt'
331331
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
332332
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
333-
apt -qq list --installed | awk "{print \$1,\$2}" > /tmp/package_versions.txt && \
333+
apt list -qq --installed > /tmp/package_versions.txt && \
334334
chmod 777 /tmp/package_versions.txt'
335335
fi
336-
if [ "$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )" != "${PACKAGE_TAG}" ]; then
336+
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
337+
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
338+
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then
337339
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO}
338340
git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master
339341
cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/
340342
cd ${TEMPDIR}/${LS_REPO}/
341-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git add package_versions.txt
342-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git commit -m 'Bot Updating Package Versions'
343-
git --git-dir ${TEMPDIR}/${LS_REPO}/.git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
343+
wait
344+
git add package_versions.txt
345+
git commit -m 'Bot Updating Package Versions'
346+
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
344347
echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
348+
echo "Package tag updated, stopping build process"
345349
else
346350
echo "false" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER}
351+
echo "Package tag is same as previous continue with build process"
347352
fi
348353
rm -Rf ${TEMPDIR}'''
349354
script{

0 commit comments

Comments
 (0)