Skip to content

Commit a40d5f8

Browse files
committed
Strip v from version to keep consistent with older releases
1 parent 71d0432 commit a40d5f8

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

.github/workflows/external_trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of main branch. To disable this trigger, add \`unifi-network-application_main\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}')
32+
EXT_RELEASE=$(curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}' | tr -d 'v')
3333
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
3434
if grep -q "^unifi-network-application_main_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3535
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ RUN \
2424
if [ -z ${UNIFI_VERSION+x} ]; then \
2525
UNIFI_VERSION=$(curl -sX GET "https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release" \
2626
| jq -r '._embedded.firmware[].version' \
27-
| awk -F '+' '{print $1}'); \
27+
| awk -F '+' '{print $1}' \
28+
| tr -d 'v'); \
2829
fi && \
2930
UNIFI_DOWNLOAD=$(curl -sX GET "https://fw-update.ubnt.com/api/firmware?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release&sort=-version" \
30-
| jq -r "._embedded.firmware[] | select(.version | test(\"${UNIFI_VERSION}\")) | ._links.data.href") && \
31+
| jq -r "._embedded.firmware[] | select(.version | test(\"v${UNIFI_VERSION}\")) | ._links.data.href") && \
3132
mkdir -p /app && \
3233
curl -o \
3334
/tmp/unifi.zip -L \

Dockerfile.aarch64

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ RUN \
2424
if [ -z ${UNIFI_VERSION+x} ]; then \
2525
UNIFI_VERSION=$(curl -sX GET "https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release" \
2626
| jq -r '._embedded.firmware[].version' \
27-
| awk -F '+' '{print $1}'); \
27+
| awk -F '+' '{print $1}' \
28+
| tr -d 'v'); \
2829
fi && \
2930
UNIFI_DOWNLOAD=$(curl -sX GET "https://fw-update.ubnt.com/api/firmware?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release&sort=-version" \
30-
| jq -r "._embedded.firmware[] | select(.version | test(\"${UNIFI_VERSION}\")) | ._links.data.href") && \
31+
| jq -r "._embedded.firmware[] | select(.version | test(\"v${UNIFI_VERSION}\")) | ._links.data.href") && \
3132
mkdir -p /app && \
3233
curl -o \
3334
/tmp/unifi.zip -L \

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pipeline {
147147
steps{
148148
script{
149149
env.EXT_RELEASE = sh(
150-
script: ''' curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}' ''',
150+
script: ''' curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}' | tr -d 'v' ''',
151151
returnStdout: true).trim()
152152
env.RELEASE_LINK = 'custom_command'
153153
}

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# jenkins variables
44
project_name: unifi-network-application
55
external_type: na
6-
custom_version_command: "curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}'"
6+
custom_version_command: "curl -sX GET 'https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release' | jq -r '._embedded.firmware[].version' | awk -F '+' '{print $1}' | tr -d 'v'"
77
release_type: stable
88
release_tag: latest
99
ls_branch: main

0 commit comments

Comments
 (0)