-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build image for testing early jdk8 (#11594)
- Loading branch information
Showing
5 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: PR build early jdk8 images for smoke tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "smoke-tests/images/early-jdk8/**" | ||
- ".github/workflows/pr-smoke-test-early-jdk8-images.yml" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Free disk space | ||
run: .github/scripts/gha-free-disk-space.sh | ||
|
||
- name: Set up JDK for running Gradle | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | ||
with: | ||
distribution: temurin | ||
java-version-file: .java-version | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@d9336dac04dea2507a617466bc058a3def92b18b # v3.4.0 | ||
with: | ||
cache-read-only: true | ||
# gradle enterprise is used for the build cache | ||
gradle-home-cache-excludes: caches/build-cache-1 | ||
|
||
- name: Build Docker image | ||
run: ./gradlew :smoke-tests:images:early-jdk8:imageBuild |
53 changes: 53 additions & 0 deletions
53
.github/workflows/publish-smoke-test-early-jdk8-images.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Publish early jdk8 images for smoke tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- "smoke-tests/images/early-jdk8/**" | ||
- ".github/workflows/pr-smoke-test-early-jdk8-images.yml" | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Free disk space | ||
run: .github/scripts/gha-free-disk-space.sh | ||
|
||
- name: Set up JDK for running Gradle | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version-file: .java-version | ||
|
||
- name: Login to GitHub package registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set tag | ||
run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@d9336dac04dea2507a617466bc058a3def92b18b # v3.4.0 | ||
|
||
- name: Build Docker image | ||
run: ./gradlew :smoke-tests:images:early-jdk8:dockerPush -PextraTag=${{ env.TAG }} | ||
|
||
workflow-notification: | ||
needs: | ||
- publish | ||
if: always() | ||
uses: ./.github/workflows/reusable-workflow-notification.yml | ||
with: | ||
success: >- | ||
${{ | ||
needs.publishLinux.result == 'success' && | ||
needs.publishWindows.result == 'success' | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# https://github.com/zulu-openjdk/zulu-openjdk/blob/master/ubuntu/8u412-8.78/Dockerfile | ||
FROM ubuntu:jammy | ||
|
||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' | ||
|
||
RUN apt-get -qq update && \ | ||
apt-get -qq -y --no-install-recommends install software-properties-common locales curl tzdata unzip && \ | ||
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ | ||
locale-gen en_US.UTF-8 && \ | ||
curl -sLO https://cdn.azul.com/zulu/bin/zulu1.8.0_31-8.5.0.1-x86lx64.zip && \ | ||
unzip zulu1.8.0_31-8.5.0.1-x86lx64.zip -d /opt && \ | ||
apt-get -qq -y purge --auto-remove software-properties-common curl unzip && \ | ||
rm zulu1.8.0_31-8.5.0.1-x86lx64.zip | ||
|
||
ENV JAVA_HOME=/opt/zulu1.8.0_31-8.5.0.1-x86lx64 | ||
ENV PATH="${PATH}:/opt/zulu1.8.0_31-8.5.0.1-x86lx64/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage | ||
import com.bmuschko.gradle.docker.tasks.image.DockerPushImage | ||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
plugins { | ||
id("com.bmuschko.docker-remote-api") | ||
} | ||
|
||
val extraTag = findProperty("extraTag") | ||
?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) | ||
|
||
tasks { | ||
val dockerWorkingDir = layout.buildDirectory.dir("docker") | ||
|
||
val imagePrepare by registering(Copy::class) { | ||
into(dockerWorkingDir) | ||
from("Dockerfile") | ||
} | ||
|
||
val imageBuild by registering(DockerBuildImage::class) { | ||
dependsOn(imagePrepare) | ||
inputDir.set(dockerWorkingDir) | ||
|
||
images.add("ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-zulu-openjdk-8u31:$extraTag") | ||
dockerFile.set(dockerWorkingDir.get().file("Dockerfile")) | ||
} | ||
|
||
val dockerPush by registering(DockerPushImage::class) { | ||
group = "publishing" | ||
description = "Push all Docker images" | ||
dependsOn(imageBuild) | ||
images.add("ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-zulu-openjdk-8u31:$extraTag") | ||
} | ||
} |