mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
switch to jq due to inconsistent github formatting
This commit is contained in:
parent
1a79295280
commit
d29efb71ca
@ -15,6 +15,10 @@ env:
|
||||
- BASEIMAGE="code-server"
|
||||
- MODNAME="powershell"
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get -y install jq
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: PR-BuildImage
|
||||
@ -26,7 +30,7 @@ jobs:
|
||||
if: (NOT (type IN (pull_request)))
|
||||
script:
|
||||
# Set version
|
||||
- PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]' | awk '{print substr($1,2); }')
|
||||
- PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" | jq -r .tag_name | awk '{print substr($1,2); }')
|
||||
# Build image
|
||||
- docker build --no-cache --build-arg PS_VERSION=${PS_VERSION} -t ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${PS_VERSION}-${TRAVIS_COMMIT} .
|
||||
- docker tag ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}-${PS_VERSION}-${TRAVIS_COMMIT} ${DOCKERHUB}:${BASEIMAGE}-${MODNAME}
|
||||
|
||||
22
Dockerfile
22
Dockerfile
@ -4,21 +4,27 @@ ARG PS_VERSION
|
||||
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
curl && \
|
||||
curl \
|
||||
jq && \
|
||||
if [ -z ${PS_VERSION+x} ]; then \
|
||||
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]' | awk '{print substr($1,2); }'); \
|
||||
| jq -r .tag_name | awk '{print substr($1,2); }'); \
|
||||
fi && \
|
||||
mkdir -p /root-layer/powershell && \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_x86_64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-x64.tar.gz" && \
|
||||
/root-layer/powershell/powershell_x86_64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-x64.tar.gz" && \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_armv7l.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm32.tar.gz" && \
|
||||
/root-layer/powershell/powershell_armv7l.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm32.tar.gz" && \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_aarch64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm64.tar.gz"
|
||||
/root-layer/powershell/powershell_aarch64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm64.tar.gz" && \
|
||||
echo "******** run basic test to validate tarballs *********" && \
|
||||
for i in x86_64 armv7l aarch64; do \
|
||||
mkdir -p "/tmp/${i}"; \
|
||||
tar xzf "/root-layer/powershell/powershell_${i}.tar.gz" -C "/tmp/${i}"; \
|
||||
done
|
||||
|
||||
COPY root/ /root-layer/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user