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

Currency: Added build-script, dockerfile and updated build_info.json for json4s #4805

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions j/json4s/Dockerfiles/ubi_9.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM registry.access.redhat.com/ubi9:9.3

ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
ENV PATH=$JAVA_HOME/bin:$PATH
ENV TZ=Australia/Canberra
ENV HOME_DIR=${PWD}

ARG PACKAGE_VERSION=v4.1.0-M8

RUN yum update -y && \
yum install -y curl git java-1.8.0-openjdk-devel nodejs clang wget tar --allowerasing && \
rm -f /etc/yum.repos.d/bintray-rpm.repo && \
curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo && \
mv sbt-rpm.repo /etc/yum.repos.d/ && \
yum install -y sbt && \
cd $HOME_DIR && \
wget https://github.com/lampepfl/dotty/releases/download/3.5.2/scala3-3.5.2.tar.gz && \
tar -xvf scala3-3.5.2.tar.gz && \
export PATH=$HOME_DIR/scala3-3.5.2/bin:$PATH && \
cd $HOME_DIR && \
git clone https://github.com/json4s/json4s && \
cd json4s && \
git checkout $PACKAGE_VERSION && \
sbt package

CMD ["/bin/bash"]
9 changes: 5 additions & 4 deletions j/json4s/build_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"maintainer": "pooja0805",
"package_name": "json4s",
"github_url": "https://github.com/json4s/json4s",
"version": "v4.1.0-M2",
"version": "v4.1.0-M8",
"package_dir": "j/json4s",
"default_branch": "master",
"docker_cmd": "docker build -t ${package_name}:$PACKAGE_VERSION ${dir}",
"build_script": "json4s_ubi_8.5.sh",
"build_script": "json4s_ubi_9.3.sh",
"docker_build": true,
"validate_build_script": true,
"use_non_root_user": true,
"v4.1.0-M*": {
"dir": "ubi_8.5",
"build_script": "json4s_ubi_8.5.sh"
"dir": "ubi_9.3",
"build_script": "json4s_ubi_9.3.sh"
}
}
67 changes: 67 additions & 0 deletions j/json4s/json4s_ubi_9.3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash -e
# -----------------------------------------------------------------------------
#
# Package : jon4s
# Version : v4.1.0-M8
# Source repo : https://github.com/json4s/json4s.git
# Tested on : UBI: 9.3
# Language : Scala
# Travis-Check : True
# Script License: Apache License, Version 2 or later
# Maintainer : Pooja Shah <[email protected]>
#
# Disclaimer: This script has been tested in root mode on given
# ========== platform using the mentioned version of the package.
# It may not work as expected with newer versions of the
# package and/or distribution. In such case, please
# contact "Maintainer" of this script.
#
# ----------------------------------------------------------------------------

PACKAGE_NAME=json4s
PACKAGE_VERSION=${1:-v4.1.0-M8}
PACKAGE_URL=https://github.com/json4s/json4s.git

sudo yum install -y curl git java-11-openjdk-devel nodejs clang wget tar --allowerasing

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export PATH=$JAVA_HOME/bin:$PATH
java -version

#Install Scala
cd $HOME
wget https://github.com/lampepfl/dotty/releases/download/3.5.2/scala3-3.5.2.tar.gz
tar -xvf scala3-3.5.2.tar.gz
export PATH=$HOME/scala3-3.5.2/bin:$PATH

#Install sbt
sudo rm -f /etc/yum.repos.d/bintray-rpm.repo
curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo
sudo mv sbt-rpm.repo /etc/yum.repos.d/
sudo yum install -y sbt

# Clone json4s
cd $HOME_DIR
git clone $PACKAGE_URL
cd $PACKAGE_NAME
git checkout $PACKAGE_VERSION
export TZ=Australia/Canberra
export SBT_OPTS="-XX:+UseG1GC"

if ! sbt compile ; then
echo "------------------$PACKAGE_NAME:install_fails-------------------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails"
exit 1
fi
if ! sbt test ; then
echo "------------------$PACKAGE_NAME:install_success_but_test_fails---------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails"
exit 2
else
echo "------------------$PACKAGE_NAME:install_&_test_both_success-------------------------"
echo "$PACKAGE_URL $PACKAGE_NAME"
echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success"
exit 0
fi