Skip to content

Commit

Permalink
Dev/add version control biome and wsl2agent (#62)
Browse files Browse the repository at this point in the history
Signed-off-by: Naoki Aoyama <[email protected]>
  • Loading branch information
naa0yama authored Sep 22, 2024
1 parent a34e9d2 commit a135ec0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
#- - Global
#- -----------------------------------------------------------------------------
ARG DEBIAN_FRONTEND=noninteractive \
DEFAULT_USERNAME=user \
\
DEFAULT_USERNAME=user
ASDF_VERSION="v0.14.0" \
BIOME_VERSION="cli/v1.8.3" \
WSL2SSHAGENT_VERSION="v0.9.5"


#- -----------------------------------------------------------------------------
Expand All @@ -13,7 +16,9 @@ FROM ubuntu:24.04 AS base

ARG DEFAULT_UID=1100 \
DEFAULT_GID=1100 \
DEFAULT_USERNAME
DEFAULT_USERNAME \
BIOME_VERSION \
WSL2SSHAGENT_VERSION

ENV TZ=Asia/Tokyo

Expand All @@ -26,6 +31,7 @@ RUN set -eux && \
RUN set -eux && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends unminimize && \
yes | unminimize && \
apt-get -y install --no-install-recommends \
automake \
Expand Down Expand Up @@ -101,7 +107,8 @@ RUN set -eux && \

# Add Biome latest install
RUN set -eux && \
curl -fSL -o /usr/local/bin/biome "$(curl -sfSL https://api.github.com/repos/biomejs/biome/releases/latest | \
if [ -z "${BIOME_VERSION}" ]; then echo "BIOME_VERSION is blank"; else echo "BIOME_VERSION is set to '$BIOME_VERSION'"; fi && \
curl -fSL -o /usr/local/bin/biome "$(curl -sfSL https://api.github.com/repos/biomejs/biome/releases/tags/${BIOME_VERSION} | \
jq -r '.assets[] | select(.name | endswith("linux-x64")) | .browser_download_url')" && \
chmod +x /usr/local/bin/biome && \
type -p biome
Expand All @@ -110,8 +117,11 @@ RUN set -eux && \
RUN set -eux && \
__TEMPDIR=$(mktemp -d) && \
cd ${__TEMPDIR} && \
curl -fSL -O https://github.com/mame/wsl2-ssh-agent/releases/latest/download/wsl2-ssh-agent && \
curl -fSL -O https://github.com/mame/wsl2-ssh-agent/releases/latest/download/checksums.txt && \
if [ -z "${WSL2SSHAGENT_VERSION}" ]; then echo "WSL2SSHAGENT_VERSION is blank"; else echo "WSL2SSHAGENT_VERSION is set to '$WSL2SSHAGENT_VERSION'"; fi && \
curl -fSL -O "$(curl -sfSL https://api.github.com/repos/mame/wsl2-ssh-agent/releases/tags/${WSL2SSHAGENT_VERSION} | \
jq -r '.assets[] | select(.name | endswith("wsl2-ssh-agent")) | .browser_download_url')" && \
curl -fSL -O "$(curl -sfSL https://api.github.com/repos/mame/wsl2-ssh-agent/releases/tags/${WSL2SSHAGENT_VERSION} | \
jq -r '.assets[] | select(.name | endswith("checksums.txt")) | .browser_download_url')" && \
grep -E '\swsl2-ssh-agent$' checksums.txt | sha256sum --status -c - && \
\
cp -av wsl2-ssh-agent /usr/local/bin/wsl2-ssh-agent && \
Expand Down Expand Up @@ -145,10 +155,10 @@ RUN set -eux && \
#- -----------------------------------------------------------------------------
FROM base AS user

ARG ASDF_VERSION=v0.14.0 \
ARG DEBIAN_FRONTEND \
DEFAULT_USERNAME \
\
DEBIAN_FRONTEND \
DEFAULT_USERNAME
ASDF_VERSION

COPY --chown=${DEFAULT_USERNAME} --chmod=644 .tool-versions /home/${DEFAULT_USERNAME}/.tool-versions

Expand Down
35 changes: 35 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,40 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>naa0yama/renovate-config"
],
"customManagers": [
{
"customType": "regex",
"fileMatch": [
"Dockerfile"
],
"matchStrings": [
"ASDF_VERSION: (?<currentValue>.*?)\\n"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "asdf-vm/asdf"
},
{
"customType": "regex",
"fileMatch": [
"Dockerfile"
],
"matchStrings": [
"BIOME_VERSION: (?<currentValue>.*?)\\n"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "biomejs/biome"
},
{
"customType": "regex",
"fileMatch": [
"Dockerfile"
],
"matchStrings": [
"WSL2SSHAGENT_VERSION: (?<currentValue>.*?)\\n"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "mame/wsl2-ssh-agent"
}
]
}

0 comments on commit a135ec0

Please sign in to comment.