Skip to content

Commit

Permalink
Merge pull request #60 from rasa/rasa/upgrade-versions
Browse files Browse the repository at this point in the history
Upgrade alpine/shfmt/gh versions
  • Loading branch information
luizm authored Oct 24, 2023
2 parents 76ab0b2 + 035121b commit c6edb3d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM alpine:3.16.0
FROM alpine:3.18.4
LABEL "name"="sh-checker"
LABEL "maintainer"="Luiz Muller <contact@luizm.dev>"

ARG shfmt_version=3.6.0
ARG shfmt_version=3.7.0
ARG shellcheck_version=0.9.0
ARG gh_version=2.23.0
ARG gh_version=2.37.0

RUN apk add --no-cache bash git jq curl checkbashisms xz \
&& apk add --no-cache --virtual .build-deps tar \
Expand Down
30 changes: 30 additions & 0 deletions upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# shellcheck disable=SC2312 # (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

set -e

if command -v curl >/dev/null; then
# -sq == --silent --disable
dl="curl -sq"
else
# -q0 == --quiet --output-document
dl='wget --no-config -qO -'
fi

ALPINE_VER=$(${dl} 'https://registry.hub.docker.com/v2/repositories/library/alpine/tags/' | jq -r '.results[1].name')
GH_VER=$(${dl} https://api.github.com/repos/cli/cli/tags | jq -r '.[0].name')
SHELLCHECK_VER=$(${dl} https://api.github.com/repos/koalaman/shellcheck/tags | jq -r '.[0].name')
SHFMT_VER=$(${dl} https://api.github.com/repos/mvdan/sh/tags | jq -r '.[0].name')

GH_VER="${GH_VER/v/}"
SHELLCHECK_VER="${SHELLCHECK_VER/v/}"
SHFMT_VER="${SHFMT_VER/v/}"

sed -Ei "
s/^(FROM\s+alpine:).*/\1${ALPINE_VER}/;
s/^(ARG\s+gh_version=).*/\1${GH_VER}/;
s/^(ARG\s+shellcheck_version=).*/\1${SHELLCHECK_VER}/;
s/^(ARG\s+shfmt_version=).*/\1${SHFMT_VER}/;
" Dockerfile

git diff

0 comments on commit c6edb3d

Please sign in to comment.