Skip to content

Commit c7f73e2

Browse files
committed
WIP
1 parent d5db348 commit c7f73e2

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.devcontainer/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Official Ruby images
22
IMAGE="ruby:3.4.5-slim-bookworm"
3+
VERSION="3.4.5"
34

45
# IMAGE="jruby:latest"
6+
# VERSION="latest"
57

68
# E2E testing
79
SENTRY_DSN="http://user:[email protected]/project/42"

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
dockerfile: .devcontainer/Dockerfile
77
args:
88
IMAGE: ${IMAGE}
9+
VERSION: ${VERSION}
910
volumes:
1011
- ..:/workspace/sentry:cached
1112
working_dir: /workspace/sentry

.github/workflows/build_images.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
- .github/workflows/build_images.yml
1010

1111
# Uncomment if you want to test things out in a PR
12-
#
13-
# pull_request:
14-
# paths:
15-
# - .devcontainer/**
16-
# - .github/workflows/build_images.yml
12+
13+
pull_request:
14+
paths:
15+
- .devcontainer/**
16+
- .github/workflows/build_images.yml
1717

1818
permissions:
1919
contents: read
@@ -36,25 +36,32 @@ jobs:
3636
- name: Check out current commit
3737
uses: actions/checkout@v4
3838

39-
- name: Generate short image name
39+
- name: Generate short image name and extract version
4040
id: image_name
4141
run: |
4242
ruby_image="${{ matrix.ruby_image }}"
4343
44+
# Extract full version for GEM_HOME (e.g., ruby:3.4.5-slim-bookworm -> 3.4.5)
4445
if [[ "$ruby_image" == ruby:* ]]; then
46+
full_version=$(echo "$ruby_image" | cut -d: -f2 | cut -d- -f1)
4547
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
4648
short_name="sentry-ruby-devcontainer-${version}"
4749
elif [[ "$ruby_image" == jruby:latest ]]; then
50+
full_version="latest"
4851
short_name="sentry-ruby-devcontainer-jruby-latest"
4952
elif [[ "$ruby_image" == jruby:* ]]; then
53+
full_version=$(echo "$ruby_image" | cut -d: -f2 | cut -d- -f1)
5054
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
5155
short_name="sentry-ruby-devcontainer-jruby-${version}"
5256
else
57+
full_version="latest"
5358
short_name="sentry-ruby-devcontainer-${ruby_image}"
5459
fi
5560
5661
echo "short_name=${short_name}" >> $GITHUB_OUTPUT
62+
echo "full_version=${full_version}" >> $GITHUB_OUTPUT
5763
echo "Generated short image name: ${short_name}"
64+
echo "Extracted full version: ${full_version}"
5865
5966
- name: Build and push devcontainer image
6067
id: build
@@ -66,6 +73,7 @@ jobs:
6673
publish_on_pr: true
6774
build_args: |
6875
IMAGE=${{ matrix.ruby_image }}
76+
VERSION=${{ steps.image_name.outputs.full_version }}
6977
7078
- name: Use outputs
7179
run: |

0 commit comments

Comments
 (0)