utils.jdk
jdk.py
Common code useful for pipelines with jdk needs.
Example Usage: from utils import jdk from utils.jdk import install_jdk_17_with_yum
1#!/usr/bin/env python3 2""" 3jdk.py 4 5Common code useful for pipelines with jdk needs. 6 7Example Usage: 8 from utils import jdk 9 from utils.jdk import install_jdk_17_with_yum 10""" 11 12from subprocess_tee import run as _run 13# try: 14# from .common import subprocess_run as _run 15# except ImportError: 16# from utils.common import subprocess_run as _run 17 18 19def install_jdk_17_with_yum(): 20 _run("sudo rpm --import https://yum.corretto.aws/corretto.key 2>&1 >>.jdk.install.txt", check=True, shell=True) 21 _run("sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo 2>&1 >>.jdk.install.txt", check=True, shell=True) 22 _run("sudo mkdir -p /etc/alternatives 2>&1 >>.jdk.install.txt", check=True, shell=True) 23 _run("sudo yum install -y java-17-amazon-corretto-devel 2>&1 >>.jdk.install.txt", check=False, shell=True) 24 return
def
install_jdk_17_with_yum()
20def install_jdk_17_with_yum(): 21 _run("sudo rpm --import https://yum.corretto.aws/corretto.key 2>&1 >>.jdk.install.txt", check=True, shell=True) 22 _run("sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo 2>&1 >>.jdk.install.txt", check=True, shell=True) 23 _run("sudo mkdir -p /etc/alternatives 2>&1 >>.jdk.install.txt", check=True, shell=True) 24 _run("sudo yum install -y java-17-amazon-corretto-devel 2>&1 >>.jdk.install.txt", check=False, shell=True) 25 return