Skip to content

Commit

Permalink
Upgrade alpine/shfmt/gh versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa committed Oct 24, 2023
1 parent 76ab0b2 commit a837fb5
Show file tree
Hide file tree
Showing 2 changed files with 30 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 <[email protected]>"

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
27 changes: 27 additions & 0 deletions upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e

if command -v curl >/dev/null; then
dl="curl -s -K /dev/null"
else
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 a837fb5

Please sign in to comment.