From e7513ec53b5baf4fc3121bfe7d2ec952bdb88992 Mon Sep 17 00:00:00 2001 From: Roxedus Date: Tue, 19 Jan 2021 00:40:03 +0100 Subject: [PATCH] First attempt to move preview to v4 --- .github/workflows/external_trigger.yml | 2 +- Dockerfile | 13 ++++++------ Dockerfile.aarch64 | 29 +++++++++++++------------- Dockerfile.armhf | 29 +++++++++++++------------- Jenkinsfile | 24 +++++++++++---------- README.md | 13 ++++++++++-- jenkins-vars.yml | 6 +++--- readme-vars.yml | 9 +++++++- 8 files changed, 73 insertions(+), 52 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index b979ce5..7d34d60 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -18,7 +18,7 @@ jobs: fi echo "**** External trigger running off of development branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_OMBI_DEVELOPMENT\". ****" echo "**** Retrieving external version ****" - EXT_RELEASE=$(curl -sL GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version') + EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/Ombi-app/ombi/releases" | jq -r ". | first(.[] | select(.prerelease == true)) | .tag_name") if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" FAILURE_REASON="Can't retrieve external version for ombi branch development" diff --git a/Dockerfile b/Dockerfile index a1f81b1..9586918 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,15 +20,16 @@ RUN \ mkdir -p \ /opt/ombi && \ if [ -z ${OMBI_RELEASE+x} ]; then \ - OMBI_RELEASE=$(curl -sL GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version'); \ + OMBI_RELEASE=$(curl -sX GET "https://api.github.com/repos/Ombi-app/Ombi/releases" \ + | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \ fi && \ - OMBI_JOBID=$(curl -s "https://ci.appveyor.com/api/projects/tidusjar/requestplex/build/${OMBI_RELEASE}" | jq -jr '. | .build.jobs[0].jobId') \ - OMBI_DURL="https://ci.appveyor.com/api/buildjobs/${OMBI_JOBID}/artifacts/linux.tar.gz"; \ + OMBI_DURL=$(curl -s https://api.github.com/repos/Ombi-app/Ombi/releases/tags/"${OMBI_RELEASE}" \ + |jq -r '.assets[].browser_download_url' |grep 'linux-x64') && \ curl -o \ - /tmp/ombi-src.tar.gz -L \ + /tmp/ombi.tar.gz -L \ "${OMBI_DURL}" && \ - tar xzf /tmp/ombi-src.tar.gz -C \ - /opt/ombi/ && \ + tar xzf /tmp/ombi.tar.gz -C \ + /opt/ombi && \ chmod +x /opt/ombi/Ombi && \ echo "**** clean up ****" && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c18ad99..7a55055 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -13,28 +13,29 @@ ENV HOME="/config" RUN \ apt-get update && \ apt-get install -y \ - jq \ - libicu60 \ - libssl1.0 && \ + jq \ + libicu60 \ + libssl1.0 && \ echo "**** install ombi ****" && \ mkdir -p \ - /opt/ombi && \ + /opt/ombi && \ if [ -z ${OMBI_RELEASE+x} ]; then \ - OMBI_RELEASE=$(curl -sL GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version'); \ + OMBI_RELEASE=$(curl -sX GET "https://api.github.com/repos/Ombi-app/Ombi/releases" \ + | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \ fi && \ - OMBI_JOBID=$(curl -s "https://ci.appveyor.com/api/projects/tidusjar/requestplex/build/${OMBI_RELEASE}" | jq -jr '. | .build.jobs[0].jobId') \ - OMBI_DURL="https://ci.appveyor.com/api/buildjobs/${OMBI_JOBID}/artifacts/linux-arm64.tar.gz"; \ + OMBI_DURL=$(curl -s https://api.github.com/repos/Ombi-app/Ombi/releases/tags/"${OMBI_RELEASE}" \ + |jq -r '.assets[].browser_download_url' |grep 'linux-arm64') && \ curl -o \ - /tmp/ombi-src.tar.gz -L \ - "${OMBI_DURL}" && \ - tar xzf /tmp/ombi-src.tar.gz -C \ - /opt/ombi/ && \ + /tmp/ombi.tar.gz -L \ + "${OMBI_DURL}" && \ + tar xzf /tmp/ombi.tar.gz -C \ + /opt/ombi && \ chmod +x /opt/ombi/Ombi && \ echo "**** clean up ****" && \ rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # add local files COPY /root / diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 8d1b24b..ef0dc22 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -13,28 +13,29 @@ ENV HOME="/config" RUN \ apt-get update && \ apt-get install -y \ - jq \ - libicu60 \ - libssl1.0 && \ + jq \ + libicu60 \ + libssl1.0 && \ echo "**** install ombi ****" && \ mkdir -p \ - /opt/ombi && \ + /opt/ombi && \ if [ -z ${OMBI_RELEASE+x} ]; then \ - OMBI_RELEASE=$(curl -sL GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version'); \ + OMBI_RELEASE=$(curl -sX GET "https://api.github.com/repos/Ombi-app/Ombi/releases" \ + | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name'); \ fi && \ - OMBI_JOBID=$(curl -s "https://ci.appveyor.com/api/projects/tidusjar/requestplex/build/${OMBI_RELEASE}" | jq -jr '. | .build.jobs[0].jobId') \ - OMBI_DURL="https://ci.appveyor.com/api/buildjobs/${OMBI_JOBID}/artifacts/linux-arm.tar.gz"; \ + OMBI_DURL=$(curl -s https://api.github.com/repos/Ombi-app/Ombi/releases/tags/"${OMBI_RELEASE}" \ + |jq -r '.assets[].browser_download_url' |grep 'linux-arm.tar.gz') && \ curl -o \ - /tmp/ombi-src.tar.gz -L \ - "${OMBI_DURL}" && \ - tar xzf /tmp/ombi-src.tar.gz -C \ - /opt/ombi/ && \ + /tmp/ombi.tar.gz -L \ + "${OMBI_DURL}" && \ + tar xzf /tmp/ombi.tar.gz -C \ + /opt/ombi && \ chmod +x /opt/ombi/Ombi && \ echo "**** clean up ****" && \ rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/* + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* # add local files COPY /root / diff --git a/Jenkinsfile b/Jenkinsfile index 0ad0063..afdb577 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,6 +16,8 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') + JSON_URL = 'https://api.github.com/repos/Ombi-app/ombi/releases' + JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name' CONTAINER_NAME = 'ombi' BUILD_VERSION_ARG = 'OMBI_RELEASE' LS_USER = 'linuxserver' @@ -99,16 +101,16 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // 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 GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version' ''', - returnStdout: true).trim() - env.RELEASE_LINK = 'custom_command' - } - } + // If this is a custom json endpoint parse the return to get external tag + stage("Set ENV custom_json"){ + steps{ + script{ + env.EXT_RELEASE = sh( + script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''', + returnStdout: true).trim() + env.RELEASE_LINK = env.JSON_URL + } + } } // Sanitize the release tag and strip illegal docker or github characters stage("Sanitize tag"){ @@ -692,7 +694,7 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json + echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "target_commitish": "development",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ diff --git a/README.md b/README.md index e2dc7fd..096c7f8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,14 @@ The architectures supported by this image are: | arm64 | arm64v8-latest | | armhf | arm32v7-latest | +## Version Tags + +This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them. + +| Tag | Description | +| :----: | --- | +| latest | Stable Ombi releases | +| development | Releases from the `develop` branch of Ombi | ## Usage @@ -81,7 +89,7 @@ services: - PGID=1000 - TZ=Europe/London volumes: - - :/config + - /path/to/appdata/config:/config ports: - 3579:3579 restart: unless-stopped @@ -96,7 +104,7 @@ docker run -d \ -e PGID=1000 \ -e TZ=Europe/London \ -p 3579:3579 \ - -v :/config \ + -v /path/to/appdata/config:/config \ --restart unless-stopped \ ghcr.io/linuxserver/ombi ``` @@ -227,6 +235,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **18.01.21:** - Update upstream repo. Deprecate `v4-preview` tag, `develop` is now the tag for v4. * **14.04.20:** - Add donation links for Ombi. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **25.01.19:** - Add info on tags and development builds. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 322fb24..fa5a8a5 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -1,13 +1,13 @@ --- - # jenkins variables project_name: docker-ombi -external_type: na -custom_version_command: curl -sL GET https://ci.appveyor.com/api/projects/tidusjar/requestplex/history?recordsNumber=100 | jq -r '. | first(.builds[] | select(.status == "success") | select(.branch == "develop") | select(.pullRequestId == null)) | .version' +external_type: custom_json release_type: prerelease release_tag: development ls_branch: development repo_vars: + - JSON_URL = 'https://api.github.com/repos/Ombi-app/ombi/releases' + - JSON_PATH = 'first(.[] | select(.prerelease == true)) | .tag_name' - CONTAINER_NAME = 'ombi' - BUILD_VERSION_ARG = 'OMBI_RELEASE' - LS_USER = 'linuxserver' diff --git a/readme-vars.yml b/readme-vars.yml index 133bfc9..e044e1c 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -21,12 +21,18 @@ available_architectures: - { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} - { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"} +# development version +development_versions: true +development_versions_items: + - { tag: "latest", desc: "Stable Ombi releases" } + - { tag: "development", desc: "Releases from the `develop` branch of Ombi" } + # container parameters common_param_env_vars_enabled: true param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - { vol_path: "/config", vol_host_path: "", desc: "Contains all relevant configuration files." } + - { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Contains all relevant configuration files." } param_usage_include_ports: true param_ports: - { external_port: "3579", internal_port: "3579", port_desc: "web gui" } @@ -50,6 +56,7 @@ app_setup_block: | # changelog changelogs: + - { date: "18.01.21:", desc: "Update upstream repo. Deprecate `v4-preview` tag, `develop` is now the tag for v4." } - { date: "14.04.20:", desc: "Add donation links for Ombi." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "25.01.19:", desc: "Add info on tags and development builds." }