@@ -19,6 +19,9 @@ pipeline {
1919 DOCKERHUB_TOKEN = credentials(' docker-hub-ci-pat' )
2020 QUAYIO_API_TOKEN = credentials(' quayio-repo-api-token' )
2121 GIT_SIGNING_KEY = credentials(' 484fbca6-9a4f-455e-b9e3-97ac98785f5f' )
22+ EXT_GIT_BRANCH = ' master'
23+ EXT_USER = ' FreeCAD'
24+ EXT_REPO = ' FreeCAD'
2225 BUILD_VERSION_ARG = ' FREECAD_VERSION'
2326 LS_USER = ' linuxserver'
2427 LS_REPO = ' docker-freecad'
@@ -30,8 +33,8 @@ pipeline {
3033 MULTIARCH = ' true'
3134 CI = ' true'
3235 CI_WEB = ' true'
33- CI_PORT = ' 3000 '
34- CI_SSL = ' false '
36+ CI_PORT = ' 3001 '
37+ CI_SSL = ' true '
3538 CI_DELAY = ' 120'
3639 CI_DOCKERENV = ' TZ=US/Pacific'
3740 CI_AUTH = ' user:password'
@@ -94,7 +97,11 @@ pipeline {
9497 env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
9598 env. PULL_REQUEST = env. CHANGE_ID
9699 env. TEMPLATED_FILES = ' Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml'
100+ if ( env. SYFT_IMAGE_TAG == null ) {
101+ env. SYFT_IMAGE_TAG = ' latest'
102+ }
97103 }
104+ echo " Using syft image tag ${ SYFT_IMAGE_TAG} "
98105 sh ''' #! /bin/bash
99106 echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
100107 script{
@@ -138,16 +145,23 @@ pipeline {
138145 /* ########################
139146 External Release Tagging
140147 ######################## */
141- // If this is a custom command to determine version use that command
142- stage(" Set tag custom bash" ){
143- steps{
144- script{
145- env. EXT_RELEASE = sh(
146- script : ''' curl -sX GET https://ftp.debian.org/debian/dists/bookworm/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: freecad' | awk -F ': ' '/Version/{print $2;exit}' | awk -F '+' '{print $1}' ''' ,
147- returnStdout : true ). trim()
148- env. RELEASE_LINK = ' custom_command'
149- }
150- }
148+ // If this is a stable github release use the latest endpoint from github to determine the ext tag
149+ stage(" Set ENV github_stable" ){
150+ steps{
151+ script{
152+ env. EXT_RELEASE = sh(
153+ script : ''' curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''' ,
154+ returnStdout : true ). trim()
155+ }
156+ }
157+ }
158+ // If this is a stable or devel github release generate the link for the build message
159+ stage(" Set ENV github_link" ){
160+ steps{
161+ script{
162+ env. RELEASE_LINK = ' https://github.com/' + env. EXT_USER + ' /' + env. EXT_REPO + ' /releases/tag/' + env. EXT_RELEASE
163+ }
164+ }
151165 }
152166 // Sanitize the release tag and strip illegal docker or github characters
153167 stage(" Sanitize tag" ){
@@ -780,7 +794,7 @@ pipeline {
780794 docker run --rm \
781795 -v /var/run/docker.sock:/var/run/docker.sock:ro \
782796 -v ${TEMPDIR}:/tmp \
783- ghcr.io/anchore/syft:v1.26.1 \
797+ ghcr.io/anchore/syft:${SYFT_IMAGE_TAG} \
784798 ${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
785799 NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
786800 echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
@@ -890,6 +904,7 @@ pipeline {
890904 -e WEB_AUTH=\" ${CI_AUTH}\" \
891905 -e WEB_PATH=\" ${CI_WEBPATH}\" \
892906 -e NODE_NAME=\" ${NODE_NAME}\" \
907+ -e SYFT_IMAGE_TAG=\" ${CI_SYFT_IMAGE_TAG:-${SYFT_IMAGE_TAG}}\" \
893908 -t ghcr.io/linuxserver/ci:latest \
894909 python3 test_build.py'''
895910 }
@@ -983,7 +998,7 @@ pipeline {
983998 "tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
984999 echo " Pushing New release for Tag"
9851000 sh ''' #! /bin/bash
986- echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
1001+ curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^. \\ (.* \\ ).$: \\ 1:' > releasebody.json
9871002 echo '{"tag_name":"'${META_TAG}'",\
9881003 "target_commitish": "master",\
9891004 "name": "'${META_TAG}'",\
0 commit comments