Skip to content
This repository was archived by the owner on May 25, 2024. It is now read-only.

Commit 89ba8e9

Browse files
authored
Merge pull request #2 from linuxserver/commits
build upstream commits
2 parents 56d278d + 12e565d commit 89ba8e9

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

.github/workflows/external_trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fi
1919
echo "**** External trigger running off of main branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_ENDLESSH_MAIN\". ****"
2020
echo "**** Retrieving external version ****"
21-
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/skeeto/endlessh/releases" | jq -r '.[0] | .tag_name')
21+
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/skeeto/endlessh/commits/master" | jq -r '. | .sha' | cut -c1-8)
2222
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2323
echo "**** Can't retrieve external version, exiting ****"
2424
FAILURE_REASON="Can't retrieve external version for endlessh branch main"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN \
1515
jq && \
1616
echo "**** fetch source code ****" && \
1717
if [ -z ${ENDLESSH_RELEASE+x} ]; then \
18-
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/releases" \
19-
| jq -r '.[0] | .tag_name'); \
18+
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/commits/master" \
19+
| jq -r '.sha' | cut -c1-8); \
2020
fi && \
2121
mkdir -p /app/endlessh && \
2222
curl -o \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN \
1515
jq && \
1616
echo "**** fetch source code ****" && \
1717
if [ -z ${ENDLESSH_RELEASE+x} ]; then \
18-
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/releases" \
19-
| jq -r '.[0] | .tag_name'); \
18+
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/commits/master" \
19+
| jq -r '.sha' | cut -c1-8); \
2020
fi && \
2121
mkdir -p /app/endlessh && \
2222
curl -o \

Dockerfile.armhf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN \
1515
jq && \
1616
echo "**** fetch source code ****" && \
1717
if [ -z ${ENDLESSH_RELEASE+x} ]; then \
18-
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/releases" \
19-
| jq -r '.[0] | .tag_name'); \
18+
ENDLESSH_RELEASE=$(curl -sX GET "https://api.github.com/repos/skeeto/endlessh/commits/master" \
19+
| jq -r '.sha' | cut -c1-8); \
2020
fi && \
2121
mkdir -p /app/endlessh && \
2222
curl -o \

Jenkinsfile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,23 @@ pipeline {
101101
/* ########################
102102
External Release Tagging
103103
######################## */
104-
// If this is a devel github release use the first in an array from github to determine the ext tag
105-
stage("Set ENV github_devel"){
106-
steps{
107-
script{
108-
env.EXT_RELEASE = sh(
109-
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq -r '.[0] | .tag_name' ''',
110-
returnStdout: true).trim()
111-
}
112-
}
104+
// If this is a github commit trigger determine the current commit at head
105+
stage("Set ENV github_commit"){
106+
steps{
107+
script{
108+
env.EXT_RELEASE = sh(
109+
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''',
110+
returnStdout: true).trim()
111+
}
112+
}
113113
}
114-
// If this is a stable or devel github release generate the link for the build message
115-
stage("Set ENV github_link"){
116-
steps{
117-
script{
118-
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
119-
}
120-
}
114+
// If this is a github commit trigger Set the external release link
115+
stage("Set ENV commit_link"){
116+
steps{
117+
script{
118+
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
119+
}
120+
}
121121
}
122122
// Sanitize the release tag and strip illegal docker or github characters
123123
stage("Sanitize tag"){
@@ -800,7 +800,7 @@ pipeline {
800800
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
801801
echo "Pushing New release for Tag"
802802
sh '''#! /bin/bash
803-
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases | jq '.[0] |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
803+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_RELEASE_CLEAN} | jq '.commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
804804
echo '{"tag_name":"'${META_TAG}'",\
805805
"target_commitish": "main",\
806806
"name": "'${META_TAG}'",\

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# jenkins variables
44
project_name: docker-endlessh
5-
external_type: github_devel
5+
external_type: github_commit
66
release_type: stable
77
release_tag: latest
88
ls_branch: main

0 commit comments

Comments
 (0)