Change release logic (#154)
This commit is contained in:
2
.github/workflows/external_trigger.yml
vendored
2
.github/workflows/external_trigger.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
fi
|
||||
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_QBITTORRENT_MASTER\". ****"
|
||||
echo "**** Retrieving external version ****"
|
||||
EXT_RELEASE=$(echo release-$(curl -s 'https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog' | grep -Po '^\w{3} \w{3} \d{2} \d{4} - .* - \K(v\d+\.\d+\.\d+\.?\d?)$' | head -1 | cut -c2-))
|
||||
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET 'https://api.github.com/repos/qbittorrent/qBittorrent/tags' | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$')
|
||||
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
|
||||
echo "**** Can't retrieve external version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve external version for qbittorrent branch master"
|
||||
|
||||
@@ -53,7 +53,7 @@ RUN \
|
||||
cmake --install build && \
|
||||
echo "**** build qbittorrent ****" && \
|
||||
if [ -z ${QBITTORRENT_VERSION+x} ]; then \
|
||||
QBITTORRENT_VERSION="release-"$(curl -s "https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog" | grep -Po '^\w{3} \w{3} \d{2} \d{4} - .* - \K(v\d+\.\d+\.\d+\.?\d?)$' | head -1 | cut -c2-); \
|
||||
QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \
|
||||
fi && \
|
||||
git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \
|
||||
git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \
|
||||
|
||||
@@ -53,7 +53,7 @@ RUN \
|
||||
cmake --install build && \
|
||||
echo "**** build qbittorrent ****" && \
|
||||
if [ -z ${QBITTORRENT_VERSION+x} ]; then \
|
||||
QBITTORRENT_VERSION="release-"$(curl -s "https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog" | grep -Po '^\w{3} \w{3} \d{2} \d{4} - .* - \K(v\d+\.\d+\.\d+\.?\d?)$' | head -1 | cut -c2-); \
|
||||
QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \
|
||||
fi && \
|
||||
git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \
|
||||
git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \
|
||||
|
||||
@@ -53,7 +53,7 @@ RUN \
|
||||
cmake --install build && \
|
||||
echo "**** build qbittorrent ****" && \
|
||||
if [ -z ${QBITTORRENT_VERSION+x} ]; then \
|
||||
QBITTORRENT_VERSION="release-"$(curl -s "https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog" | grep -Po '^\w{3} \w{3} \d{2} \d{4} - .* - \K(v\d+\.\d+\.\d+\.?\d?)$' | head -1 | cut -c2-); \
|
||||
QBITTORRENT_VERSION=$(curl -sX GET "https://api.github.com/repos/qbittorrent/qBittorrent/tags" | jq -r '.[].name' | grep -Po -m 1 '^release-(\d+(\.)?)+$'); \
|
||||
fi && \
|
||||
git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git ~/qbittorrent && cd ~/qbittorrent && \
|
||||
git checkout "$(git tag -l --sort=-v:refname "${QBITTORRENT_VERSION}" | head -n 1)" && \
|
||||
|
||||
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -104,7 +104,7 @@ pipeline {
|
||||
steps{
|
||||
script{
|
||||
env.EXT_RELEASE = sh(
|
||||
script: ''' echo release-$(curl -s 'https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog' | grep -Po '^\\w{3} \\w{3} \\d{2} \\d{4} - .* - \\K(v\\d+\\.\\d+\\.\\d+\\.?\\d?)$' | head -1 | cut -c2-) ''',
|
||||
script: ''' curl -sX GET 'https://api.github.com/repos/qbittorrent/qBittorrent/tags' | jq -r '.[].name' | grep -Po -m 1 '^release-(\\d+(\\.)?)+$' ''',
|
||||
returnStdout: true).trim()
|
||||
env.RELEASE_LINK = 'custom_command'
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# jenkins variables
|
||||
project_name: docker-qbittorrent
|
||||
external_type: na
|
||||
custom_version_command: "echo release-$(curl -s 'https://raw.githubusercontent.com/qbittorrent/qBittorrent/HEAD/Changelog' | grep -Po '^\\\\w{3} \\\\w{3} \\\\d{2} \\\\d{4} - .* - \\\\K(v\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.?\\\\d?)$' | head -1 | cut -c2-)"
|
||||
custom_version_command: "curl -sX GET 'https://api.github.com/repos/qbittorrent/qBittorrent/tags' | jq -r '.[].name' | grep -Po -m 1 '^release-(\\\\d+(\\\\.)?)+$'"
|
||||
release_type: stable
|
||||
release_tag: latest
|
||||
ls_branch: master
|
||||
|
||||
Reference in New Issue
Block a user