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

chore: rename jdk scripts and add updatecli manifest #810

Merged
merged 1 commit into from
May 16, 2024
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
File renamed without changes.
4 changes: 2 additions & 2 deletions jdk-download.sh → adoptium-install-jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ if [ $# -eq 1 ]; then
OS=$1
fi

# Call jdk-download-url.sh with JAVA_VERSION and OS as arguments
# Call adoptium-get-jdk-link.sh with JAVA_VERSION and OS as arguments
# The two scripts should be in the same directory.
# That's why we're trying to find the directory of the current script and use it to call the other script.
SCRIPT_DIR=$(cd "$(dirname "$0")" || exit; pwd)
if ! DOWNLOAD_URL=$("${SCRIPT_DIR}"/jdk-download-url.sh "${JAVA_VERSION}" "${OS}"); then
if ! DOWNLOAD_URL=$("${SCRIPT_DIR}"/adoptium-get-jdk-link.sh "${JAVA_VERSION}" "${OS}"); then
echo "Error: Failed to fetch the URL. Exiting with status 1." >&2
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETPLATFORM

COPY jdk-download-url.sh /usr/bin/local/jdk-download-url.sh
COPY jdk-download.sh /usr/bin/local/jdk-download.sh
COPY adoptium-get-jdk-link.sh /usr/bin/local/adoptium-get-jdk-link.sh
COPY adoptium-install-jdk.sh /usr/bin/local/adoptium-install-jdk.sh

ARG JAVA_VERSION=17.0.11_9
# hadolint ignore=DL3018
RUN apk add --no-cache \
ca-certificates \
jq \
curl \
&& /usr/bin/local/jdk-download.sh alpine
&& /usr/bin/local/adoptium-install-jdk.sh alpine

ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"

Expand Down
6 changes: 3 additions & 3 deletions archlinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ ARG TARGETPLATFORM

SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]

COPY jdk-download-url.sh /usr/bin/local/jdk-download-url.sh
COPY jdk-download.sh /usr/bin/local/jdk-download.sh
COPY adoptium-get-jdk-link.sh /usr/bin/local/adoptium-get-jdk-link.sh
COPY adoptium-install-jdk.sh /usr/bin/local/adoptium-install-jdk.sh

ARG JAVA_VERSION=17.0.10_7
# hadolint ignore=DL3008
RUN pacman -Syu --noconfirm \
ca-certificates \
jq \
curl \
&& /usr/bin/local/jdk-download.sh
&& /usr/bin/local/adoptium-install-jdk.sh

ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,6 @@ foreach($agentType in $AgentTypes) {
if($lastExitCode -ne 0) {
Write-Error "Build failed!"
} else {
Write-Host "Build finished successfully"
Write-Host "= Build finished successfully"
}
exit $lastExitCode
6 changes: 3 additions & 3 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ SHELL ["/bin/bash", "-e", "-u", "-o", "pipefail", "-c"]
# Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETPLATFORM

COPY jdk-download-url.sh /usr/bin/local/jdk-download-url.sh
COPY jdk-download.sh /usr/bin/local/jdk-download.sh
COPY adoptium-get-jdk-link.sh /usr/bin/local/adoptium-get-jdk-link.sh
COPY adoptium-install-jdk.sh /usr/bin/local/adoptium-install-jdk.sh

ARG JAVA_VERSION=17.0.11_9
# hadolint ignore=DL3008
Expand All @@ -38,7 +38,7 @@ RUN set -x; apt-get update \
ca-certificates \
jq \
curl \
&& /usr/bin/local/jdk-download.sh
&& /usr/bin/local/adoptium-install-jdk.sh

ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"

Expand Down
78 changes: 78 additions & 0 deletions updatecli/updatecli.d/adoptium-scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: Update `adoptium-install-jdk.sh` script content

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
lastScriptContent:
kind: file
name: Get the latest `adoptium-install-jdk.sh` script content from jenkins-infra/shared-tools
spec:
file: https://raw.githubusercontent.com/jenkins-infra/shared-tools/main/adoptium/adoptium-install-jdk.sh

targets:
updateScriptContent:
name: Update script content
kind: file
spec:
file: adoptium-install-jdk.sh
scmid: default

actions:
default:
kind: github/pullrequest
title: Update `adoptium-install-jdk.sh` script content
scmid: default
spec:
labels:
- chore
- adoptium-scripts
---
name: Update `adoptium-get-jdk-link.sh` script content

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
lastScriptContent:
kind: file
name: Get the latest `adoptium-get-jdk-link.sh` script content from jenkins-infra/shared-tools
spec:
file: https://raw.githubusercontent.com/jenkins-infra/shared-tools/main/adoptium/adoptium-get-jdk-link.sh

targets:
updateScriptContent:
name: Update script content
kind: file
spec:
file: adoptium-get-jdk-link.sh
scmid: default

actions:
default:
kind: github/pullrequest
title: Update `adoptium-get-jdk-link.sh` script content
scmid: default
spec:
labels:
- chore
- adoptium-scripts
Loading