Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala2 #5

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,19 @@ jobs:
image_name_tag: ruby:2.5.3
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
build_scala2_image:
name: Build epicbox/scala2 image
runs-on: [self-hosted, small]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
uses: ./.github/workflows/actions/build
with:
path: epicbox-scala/2
image_name_tag: scala:2.12.7
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
build_scala3_image:
name: Build epicbox/scala3 image
runs-on: [self-hosted, small]
Expand Down
3 changes: 2 additions & 1 deletion epicbox-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM bitnami/minideb:bullseye
RUN install_packages \
curl \
locales \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen

ENV LANG en_US.UTF-8

Expand Down
15 changes: 15 additions & 0 deletions epicbox-scala/2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM openjdk:8u342-slim

ENV SCALA_VERSION 2.13.12
ENV PATH /opt/scala-$SCALA_VERSION/bin:$PATH

RUN apt-get update && \
apt-get install -y --no-install-recommends wget && \
rm -rf /var/lib/apt/lists/* && \
touch /usr/local/openjdk-8/release && \
wget -O - https://downloads.lightbend.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /opt

COPY java_lookup_main.sh /usr/local/bin/java_lookup_main.sh
RUN chmod +x /usr/local/bin/java_lookup_main.sh

RUN useradd -M -d /sandbox sandbox
15 changes: 15 additions & 0 deletions epicbox-scala/2/java_lookup_main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Grep *.class files in the given directory to find one with psvm method defined
# Usage: java_lookup_main.sh DIRECTORY_PATH

PSVM_REGEX="public static( final)? void main\(java\.lang\.String(\[\]|\.\.\.)\)"

shopt -s nullglob
for f in "$1"/*.class; do
if javap -p "$f" 2> /dev/null | grep -Pq "$PSVM_REGEX"; then
filename=$(basename "$f")
echo -n "${filename%.*}"
exit 0
fi
done
exit 1