Skip to content

Commit 9c29d73

Browse files
committed
WIP
1 parent 7213931 commit 9c29d73

3 files changed

Lines changed: 37 additions & 10 deletions

File tree

.devcontainer/.env.example

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Official Ruby images
2-
IMAGE=ruby
2+
IMAGE="ruby:3.4.5-slim-bookworm"
33

4-
# Adjust as needed
5-
VERSION=3.4.5
6-
7-
# IMAGE=jruby
8-
# VERSION=latest
4+
# IMAGE="jruby:latest"
95

106
# E2E testing
117
SENTRY_DSN="http://user:pass@sentry.localhost/project/42"

.devcontainer/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ARG IMAGE="ruby"
2-
ARG VERSION="3.4.5"
3-
ARG DISTRO="slim-bookworm"
42

5-
FROM ${IMAGE}:${VERSION}-${DISTRO} AS build
3+
FROM ${IMAGE} AS build
64

75
RUN apt-get update && apt-get install -y --no-install-recommends \
86
sudo \

.github/workflows/build_images.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,51 @@ permissions:
1919
jobs:
2020
build-and-push:
2121
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
ruby_image:
25+
- ruby:2.7.8-slim-bullseye
26+
- ruby:3.0.7-slim-bullseye
27+
- ruby:3.1.7-slim-bookworm
28+
- ruby:3.2.9-slim-bookworm
29+
- ruby:3.3.9-slim-bookworm
30+
- ruby:3.4.5-slim-bookworm
31+
- jruby:latest
32+
2233
steps:
2334
- name: Check out current commit
2435
uses: actions/checkout@v4
2536

37+
- name: Generate short image name
38+
id: image_name
39+
run: |
40+
ruby_image="${{ matrix.ruby_image }}"
41+
42+
if [[ "$ruby_image" == ruby:* ]]; then
43+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
44+
short_name="sentry-ruby-devcontainer-${version}"
45+
elif [[ "$ruby_image" == jruby:latest ]]; then
46+
short_name="sentry-ruby-devcontainer-jruby-latest"
47+
elif [[ "$ruby_image" == jruby:* ]]; then
48+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
49+
short_name="sentry-ruby-devcontainer-jruby-${version}"
50+
else
51+
short_name="sentry-ruby-devcontainer-${ruby_image}"
52+
fi
53+
54+
echo "short_name=${short_name}" >> $GITHUB_OUTPUT
55+
echo "Generated short image name: ${short_name}"
56+
2657
- name: Build and push devcontainer image
2758
id: build
2859
uses: getsentry/action-build-and-push-images@main
2960
with:
30-
image_name: 'sentry-ruby-devcontainer-build'
61+
image_name: '${{ steps.image_name.outputs.short_name }}'
3162
dockerfile_path: '.devcontainer/Dockerfile'
3263
ghcr: true
3364
publish_on_pr: true
65+
build_args: |
66+
IMAGE=${{ matrix.ruby_image }}
3467
3568
- name: Use outputs
3669
run: |

0 commit comments

Comments
 (0)