Skip to content

Commit 0109b69

Browse files
committed
WIP
1 parent 7213931 commit 0109b69

3 files changed

Lines changed: 38 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: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,52 @@ 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:9.4.13.0"
32+
- "jruby:latest"
33+
2234
steps:
2335
- name: Check out current commit
2436
uses: actions/checkout@v4
2537

38+
- name: Generate short image name
39+
id: image_name
40+
run: |
41+
ruby_image="${{ matrix.ruby_image }}"
42+
43+
if [[ "$ruby_image" == ruby:* ]]; then
44+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
45+
short_name="sentry-ruby-devcontainer-${version}"
46+
elif [[ "$ruby_image" == jruby:latest ]]; then
47+
short_name="sentry-ruby-devcontainer-jruby-latest"
48+
elif [[ "$ruby_image" == jruby:* ]]; then
49+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
50+
short_name="sentry-ruby-devcontainer-jruby-${version}"
51+
else
52+
short_name="sentry-ruby-devcontainer-${ruby_image}"
53+
fi
54+
55+
echo "short_name=${short_name}" >> $GITHUB_OUTPUT
56+
echo "Generated short image name: ${short_name}"
57+
2658
- name: Build and push devcontainer image
2759
id: build
2860
uses: getsentry/action-build-and-push-images@main
2961
with:
30-
image_name: 'sentry-ruby-devcontainer-build'
62+
image_name: '${{ steps.image_name.outputs.short_name }}'
3163
dockerfile_path: '.devcontainer/Dockerfile'
3264
ghcr: true
3365
publish_on_pr: true
66+
build_args: |
67+
IMAGE="${{ matrix.ruby_image }}"
3468
3569
- name: Use outputs
3670
run: |

0 commit comments

Comments
 (0)