Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> External trigger running off of main branch. To disable this trigger, add \`obsidian_main\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest" | jq -r '. | .tag_name')
echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sL "https://api.github.com/repos/obsidianmd/obsidian-releases/releases?per_page=30" | jq -r '[.[] | select(.prerelease==false and .draft==false) | select(any(.assets[]; .name | test("^Obsidian-[0-9.]+\\.AppImage$")))][0].tag_name'
)
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
if grep -q "^obsidian_main_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ RUN \
DEBIAN_FRONTEND=noninteractive \
echo "**** install obsidian ****" && \
if [ -z ${OBSIDIAN_VERSION+x} ]; then \
OBSIDIAN_VERSION=$(curl -sX GET "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest"| jq -r '.tag_name'); \
OBSIDIAN_VERSION=$(curl -sL "https://api.github.com/repos/obsidianmd/obsidian-releases/releases?per_page=30" \
| jq -r '[.[] | select(.prerelease==false and .draft==false) | select(any(.assets[]; .name | test("^Obsidian-[0-9.]+\\.AppImage$")))][0].tag_name'); \
fi && \
apt-get install -y --no-install-recommends \
chromium \
Expand Down Expand Up @@ -57,5 +58,5 @@ RUN \
COPY /root /

# ports and volumes
EXPOSE 3000
EXPOSE 3001
VOLUME /config
5 changes: 3 additions & 2 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ RUN \
DEBIAN_FRONTEND=noninteractive \
echo "**** install obsidian ****" && \
if [ -z ${OBSIDIAN_VERSION+x} ]; then \
OBSIDIAN_VERSION=$(curl -sX GET "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest"| jq -r '.tag_name'); \
OBSIDIAN_VERSION=$(curl -sL "https://api.github.com/repos/obsidianmd/obsidian-releases/releases?per_page=30" \
| jq -r '[.[] | select(.prerelease==false and .draft==false) | select(any(.assets[]; .name | test("^Obsidian-[0-9.]+\\.AppImage$")))][0].tag_name'); \
fi && \
apt-get install -y --no-install-recommends \
chromium \
Expand Down Expand Up @@ -57,5 +58,5 @@ RUN \
COPY /root /

# ports and volumes
EXPOSE 3000
EXPOSE 3001
VOLUME /config
32 changes: 12 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ pipeline {
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
EXT_USER = 'obsidianmd'
EXT_REPO = 'obsidian-releases'
BUILD_VERSION_ARG = 'OBSIDIAN_VERSION'
LS_USER = 'linuxserver'
LS_REPO = 'docker-obsidian'
Expand Down Expand Up @@ -146,23 +144,17 @@ pipeline {
/* ########################
External Release Tagging
######################## */
// If this is a stable github release use the latest endpoint from github to determine the ext tag
stage("Set ENV github_stable"){
steps{
script{
env.EXT_RELEASE = sh(
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
returnStdout: true).trim()
}
}
}
// If this is a stable or devel github release generate the link for the build message
stage("Set ENV github_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
}
}
// If this is a custom command to determine version use that command
stage("Set tag custom bash"){
steps{
script{
env.EXT_RELEASE = sh(
script: ''' curl -sL "https://api.github.com/repos/obsidianmd/obsidian-releases/releases?per_page=30" | jq -r '[.[] | select(.prerelease==false and .draft==false) | select(any(.assets[]; .name | test("^Obsidian-[0-9.]+\\\\.AppImage$")))][0].tag_name'
''',
returnStdout: true).trim()
env.RELEASE_LINK = 'custom_command'
}
}
}
// Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){
Expand Down Expand Up @@ -1042,7 +1034,7 @@ pipeline {
"type": "commit",\
"tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}'
echo "Pushing New release for Tag"
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. |.body' > releasebody.json
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
jq -n \
--arg tag_name "$META_TAG" \
--arg target_commitish "main" \
Expand Down
6 changes: 3 additions & 3 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# jenkins variables
project_name: docker-obsidian
external_type: github_stable
external_type: na
custom_version_command: |
curl -sL "https://api.github.com/repos/obsidianmd/obsidian-releases/releases?per_page=30" | jq -r '[.[] | select(.prerelease==false and .draft==false) | select(any(.assets[]; .name | test("^Obsidian-[0-9.]+\\\\.AppImage$")))][0].tag_name'
release_type: stable
release_tag: latest
ls_branch: main
Expand All @@ -15,8 +17,6 @@ external_artifact_check: |
artifacts_found="false"
fi
repo_vars:
- EXT_USER = 'obsidianmd'
- EXT_REPO = 'obsidian-releases'
- BUILD_VERSION_ARG = 'OBSIDIAN_VERSION'
- LS_USER = 'linuxserver'
- LS_REPO = 'docker-obsidian'
Expand Down
6 changes: 2 additions & 4 deletions root/usr/bin/obsidian
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
BIN=/opt/obsidian/obsidian

# Wayland check
if ls -l /dev/dri/* > /dev/null 2>&1; then
if pgrep labwc > /dev/null 2>&1; then
WAYLAND="--ozone-platform=wayland"
fi
if [ "${PIXELFLUX_WAYLAND,,}" == "true" ]; then
WAYLAND="--ozone-platform=wayland"
fi

${BIN} \
Expand Down
Loading