Skip to content

Commit

Permalink
Add support for Java (#6)
Browse files Browse the repository at this point in the history
* add support for python 3.12

* java JRE 21 support

* checkout@v4 for java GH action

Co-authored-by: Zahid <[email protected]>

---------

Co-authored-by: Zahid <[email protected]>
  • Loading branch information
pcrock-thmdo and zahidkizmaz authored Nov 6, 2023
1 parent d2a2008 commit 97c7a47
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
version:
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4

Expand All @@ -64,3 +65,26 @@ jobs:
creds: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/thermondo/sigsci

build-java:
runs-on: ubuntu-22.04
needs: lint
strategy:
matrix:
version:
- "21"
steps:
- uses: actions/checkout@v4

- name: Build Java container
run: make java
env:
JAVA_VERSION: ${{ matrix.version }}

- name: Publish
uses: thermondo/gce-docker-push-action@a51e08b0f3c379d26d65e327ce0271aa21ecd50c
with:
username: ${{ github.repository_owner }}
creds: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/thermondo/sigsci
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# https://docs.fastly.com/signalsciences/install-guides/agent-installation/ubuntu-agent/
# https://docs.fastly.com/en/ngwaf/installing-the-agent-on-ubuntu
# https://docs.fastly.com/en/ngwaf/installing-the-agent-on-debian
ARG BASE_IMAGE

# we're allowing the CI process to tag our image explicitly
Expand All @@ -8,13 +9,17 @@ LABEL org.opencontainers.image.source="https://github.com/thermondo/sigsci-conta
ARG DEBIAN_FRONTEND=noninteractive
SHELL [ "/bin/bash", "-Eeuo", "pipefail", "-c" ]

# sometimes we're working with a debian base image, sometimes we're working with an ubuntu base
# image. this requires customizing our APT source a little bit, which we can do via build args.
ARG APT_SOURCE

# Don't want to pin apt package versions (yet... TODO perhaps)
# hadolint ignore=DL3008
RUN \
apt-get update; \
apt-get install --yes --no-install-recommends apt-transport-https curl gnupg ca-certificates; \
curl --silent --fail --show-error --location https://apt.signalsciences.net/release/gpgkey | gpg --dearmor -o /usr/share/keyrings/sigsci.gpg; \
echo "deb [signed-by=/usr/share/keyrings/sigsci.gpg] https://apt.signalsciences.net/release/ubuntu/ jammy main" > /etc/apt/sources.list.d/sigsci-release.list; \
echo "deb [signed-by=/usr/share/keyrings/sigsci.gpg] ${APT_SOURCE}" > /etc/apt/sources.list.d/sigsci-release.list; \
apt-get update; \
apt-get install --yes --no-install-recommends sigsci-agent; \
apt-get clean; \
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PYTHON_VERSION?=3.11
PYTHON_VERSION?=3.12
JAVA_VERSION?=21

all: lint general python
.PHONY: all
Expand All @@ -9,6 +10,7 @@ general:
--tag "localhost/thermondo-sigsci" \
--tag "ghcr.io/thermondo/sigsci" \
--build-arg "BASE_IMAGE=debian:bookworm-slim" \
--build-arg "APT_SOURCE=https://apt.signalsciences.net/release/debian/ bookworm main" \
.
.PHONY: general

Expand All @@ -18,9 +20,20 @@ python:
--tag "localhost/thermondo-sigsci:python-${PYTHON_VERSION}" \
--tag "ghcr.io/thermondo/sigsci:python-${PYTHON_VERSION}" \
--build-arg "BASE_IMAGE=python:${PYTHON_VERSION}-slim" \
--build-arg "APT_SOURCE=https://apt.signalsciences.net/release/debian/ bookworm main" \
.
.PHONY: python

java:
docker build \
--pull \
--tag "localhost/thermondo-sigsci:jre-${JAVA_VERSION}" \
--tag "ghcr.io/thermondo/sigsci:jre-${JAVA_VERSION}" \
--build-arg "BASE_IMAGE=eclipse-temurin:${JAVA_VERSION}-jre-jammy" \
--build-arg "APT_SOURCE=https://apt.signalsciences.net/release/ubuntu/ jammy main" \
.
.PHONY: java

lint:
hadolint Dockerfile
shellcheck *.sh
Expand Down

0 comments on commit 97c7a47

Please sign in to comment.