Skip to content

Commit

Permalink
Merge pull request #18 from Heliozoa/master
Browse files Browse the repository at this point in the history
Split main sandbox image to per-language images
  • Loading branch information
Heliozoa authored May 26, 2021
2 parents cbac80e + 0da6325 commit 04f094a
Show file tree
Hide file tree
Showing 39 changed files with 2,962 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/upload-csharp-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy csharp
on:
push:
tags:
- "all-v*"
- "csharp-v*"

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upload-cyber-security-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy cyber-security-base
on:
push:
tags:
- "all-v*"
- "cyber-security-base-v*"

jobs:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/upload-java-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Java

on:
push:
tags:
- "all-v*"
- "java-v*"

jobs:
build_and_upload:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Enable Docker IPv6
run: |
echo '{ "ipv6": true }' | sudo tee -a /etc/docker/daemon.json
sudo systemctl reload docker
- uses: actions/checkout@v1
- name: Authenticate to Google Cloud
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo Authenticating to Google Cloud
echo $GCLOUD_SERVICE_KEY | python -m base64 -d > /tmp/key.json
gcloud auth activate-service-account --key-file=/tmp/key.json
if gcloud auth configure-docker -q; then
echo "Authenticated to Google Cloud..."
else
echo "Authentication to Google Cloud failed. Exiting..."
exit 1
fi
- name: Building image
run: |
source ./env
cd java
docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-java:$RUST_CLI_VER" --build-arg "RUST_CLI_URL=$RUST_CLI_URL"
cd ..
- name: Pushing image
run: |
source ./env
cd java
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-java:$RUST_CLI_VER"
docker tag "eu.gcr.io/moocfi-public/tmc-sandbox-java:$RUST_CLI_VER" "eu.gcr.io/moocfi-public/tmc-sandbox-java:latest"
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-java:latest"
cd ..
45 changes: 45 additions & 0 deletions .github/workflows/upload-make-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Make

on:
push:
tags:
- "all-v*"
- "make-v*"

jobs:
build_and_upload:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Enable Docker IPv6
run: |
echo '{ "ipv6": true }' | sudo tee -a /etc/docker/daemon.json
sudo systemctl reload docker
- uses: actions/checkout@v1
- name: Authenticate to Google Cloud
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo Authenticating to Google Cloud
echo $GCLOUD_SERVICE_KEY | python -m base64 -d > /tmp/key.json
gcloud auth activate-service-account --key-file=/tmp/key.json
if gcloud auth configure-docker -q; then
echo "Authenticated to Google Cloud..."
else
echo "Authentication to Google Cloud failed. Exiting..."
exit 1
fi
- name: Building image
run: |
source ./env
cd make
docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-make:$RUST_CLI_VER" --build-arg "RUST_CLI_URL=$RUST_CLI_URL"
cd ..
- name: Pushing image
run: |
source ./env
cd make
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-make:$RUST_CLI_VER"
docker tag "eu.gcr.io/moocfi-public/tmc-sandbox-make:$RUST_CLI_VER" "eu.gcr.io/moocfi-public/tmc-sandbox-make:latest"
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-make:latest"
cd ..
45 changes: 45 additions & 0 deletions .github/workflows/upload-python-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Python

on:
push:
tags:
- "all-v*"
- "python-v*"

jobs:
build_and_upload:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Enable Docker IPv6
run: |
echo '{ "ipv6": true }' | sudo tee -a /etc/docker/daemon.json
sudo systemctl reload docker
- uses: actions/checkout@v1
- name: Authenticate to Google Cloud
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo Authenticating to Google Cloud
echo $GCLOUD_SERVICE_KEY | python -m base64 -d > /tmp/key.json
gcloud auth activate-service-account --key-file=/tmp/key.json
if gcloud auth configure-docker -q; then
echo "Authenticated to Google Cloud..."
else
echo "Authentication to Google Cloud failed. Exiting..."
exit 1
fi
- name: Building image
run: |
source ./env
cd python
docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-python:$RUST_CLI_VER" --build-arg "RUST_CLI_URL=$RUST_CLI_URL"
cd ..
- name: Pushing image
run: |
source ./env
cd python
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-python:$RUST_CLI_VER"
docker tag "eu.gcr.io/moocfi-public/tmc-sandbox-python:$RUST_CLI_VER" "eu.gcr.io/moocfi-public/tmc-sandbox-python:latest"
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-python:latest"
cd ..
45 changes: 45 additions & 0 deletions .github/workflows/upload-r-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy R

on:
push:
tags:
- "all-v*"
- "r-v*"

jobs:
build_and_upload:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Enable Docker IPv6
run: |
echo '{ "ipv6": true }' | sudo tee -a /etc/docker/daemon.json
sudo systemctl reload docker
- uses: actions/checkout@v1
- name: Authenticate to Google Cloud
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo Authenticating to Google Cloud
echo $GCLOUD_SERVICE_KEY | python -m base64 -d > /tmp/key.json
gcloud auth activate-service-account --key-file=/tmp/key.json
if gcloud auth configure-docker -q; then
echo "Authenticated to Google Cloud..."
else
echo "Authentication to Google Cloud failed. Exiting..."
exit 1
fi
- name: Building image
run: |
source ./env
cd java
docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-r:$RUST_CLI_VER" --build-arg "RUST_CLI_URL=$RUST_CLI_URL"
cd ..
- name: Pushing image
run: |
source ./env
cd java
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-r:$RUST_CLI_VER"
docker tag "eu.gcr.io/moocfi-public/tmc-sandbox-r:$RUST_CLI_VER" "eu.gcr.io/moocfi-public/tmc-sandbox-r:latest"
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-r:latest"
cd ..
1 change: 1 addition & 0 deletions .github/workflows/upload-tmc-langs-rust-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy tmc-langs-rust
on:
push:
tags:
- "all-v*"
- "rust-v*"

jobs:
Expand Down
151 changes: 151 additions & 0 deletions java/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
FROM debian:buster

ARG RUST_CLI_URL
RUN test -n "$RUST_CLI_URL"

RUN \
apt update && \
# common utilities
apt install -y unzip curl build-essential libssl wget locale locale-all \
apt install -y openjdk-11-jdk maven ant && \
useradd --create-home user && \
rm -rf /var/lib/apt/lists/*

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

WORKDIR /app
RUN chown user /app
USER user

COPY maven-templates/maven-template /app/

RUN mvn -q clean compile test-compile
RUN mvn -q -U dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.6:test || true

COPY maven-templates/maven-template-2 /app/

RUN mvn -q clean compile test-compile
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.6:test || true

COPY maven-templates/maven-template-3 /app/

RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.6:test || true

COPY maven-templates/maven-template-4 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-5 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-6 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-7 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-8 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-9 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-10 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-11 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-12 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-13 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-14 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-15 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-16 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-17 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-18 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-19 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

COPY maven-templates/maven-template-20 /app
RUN mvn -q clean compile test-compile || true
RUN mvn -q dependency:resolve-plugins dependency:go-offline compile dependency:resolve-plugins
RUN mvn -q test || true
RUN mvn -q fi.helsinki.cs.tmc:tmc-maven-plugin:1.12:test || true

ENV M2_HOME="/usr/share/maven"

COPY Dockerfile /Dockerfile

ADD --chown=user ${RUST_CLI_URL} /tmc-langs-cli
RUN chmod +x /tmc-langs-cli && /tmc-langs-cli --version
ADD --chown=user tmc-run /tmc-run
Loading

0 comments on commit 04f094a

Please sign in to comment.