Skip to content

Commit c6edb3d

Browse files
authored
Merge pull request #60 from rasa/rasa/upgrade-versions
Upgrade alpine/shfmt/gh versions
2 parents 76ab0b2 + 035121b commit c6edb3d

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM alpine:3.16.0
1+
FROM alpine:3.18.4
22
LABEL "name"="sh-checker"
33
LABEL "maintainer"="Luiz Muller <contact@luizm.dev>"
44

5-
ARG shfmt_version=3.6.0
5+
ARG shfmt_version=3.7.0
66
ARG shellcheck_version=0.9.0
7-
ARG gh_version=2.23.0
7+
ARG gh_version=2.37.0
88

99
RUN apk add --no-cache bash git jq curl checkbashisms xz \
1010
&& apk add --no-cache --virtual .build-deps tar \

upgrade.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
# shellcheck disable=SC2312 # (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
3+
4+
set -e
5+
6+
if command -v curl >/dev/null; then
7+
# -sq == --silent --disable
8+
dl="curl -sq"
9+
else
10+
# -q0 == --quiet --output-document
11+
dl='wget --no-config -qO -'
12+
fi
13+
14+
ALPINE_VER=$(${dl} 'https://registry.hub.docker.com/v2/repositories/library/alpine/tags/' | jq -r '.results[1].name')
15+
GH_VER=$(${dl} https://api.github.com/repos/cli/cli/tags | jq -r '.[0].name')
16+
SHELLCHECK_VER=$(${dl} https://api.github.com/repos/koalaman/shellcheck/tags | jq -r '.[0].name')
17+
SHFMT_VER=$(${dl} https://api.github.com/repos/mvdan/sh/tags | jq -r '.[0].name')
18+
19+
GH_VER="${GH_VER/v/}"
20+
SHELLCHECK_VER="${SHELLCHECK_VER/v/}"
21+
SHFMT_VER="${SHFMT_VER/v/}"
22+
23+
sed -Ei "
24+
s/^(FROM\s+alpine:).*/\1${ALPINE_VER}/;
25+
s/^(ARG\s+gh_version=).*/\1${GH_VER}/;
26+
s/^(ARG\s+shellcheck_version=).*/\1${SHELLCHECK_VER}/;
27+
s/^(ARG\s+shfmt_version=).*/\1${SHFMT_VER}/;
28+
" Dockerfile
29+
30+
git diff

0 commit comments

Comments
 (0)