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

Backing up CI/CD jobs into the Jersey project #5574

Merged
merged 2 commits into from
Mar 27, 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
92 changes: 92 additions & 0 deletions etc/scripts/TCK/EE10/jakarta-ee10-tck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash
#
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#

#
# script for listing staging from the staging repo.
#
# Input Parameters:
# JERSEY_VERSION - type: String
# - example: 3.1.5
# - description: version of Jersey (EE10) to be tested
# GLASSFISH_VERSION - type: String
# - example: 7.0.6
# - description: version of GF (EE10) to be used within tests
# TCK_VERSION - type: String
# - example: 3.1.3
# - description: version of a TCK bundle which will be downloaded from the staging/central
# Configuration:
#
# JDK:
# openjdk-jdk11-latest
# Git:
# https://github.com/eclipse-ee4j/jersey
# Branch:
# */3.1
#
#

#
# The first sh invocation
#
#!/bin/bash -xe

MVN_HOME="/opt/tools/apache-maven/latest/"
PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}"

mvn -f tests/jersey-tck/pom.xml clean install \
-Dtck.version=${TCK_VERSION} \
-Dglassfish.container.version=${GLASSFISH_VERSION} \
-Djersey.version=${JERSEY_VERSION} | tee tck.log


#
# The second sh invocation
#
#!/bin/bash -xe

MVN_HOME="/opt/tools/apache-maven/latest/"
PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}"

mvn -f tests/jersey-tck/pom.xml dependency:copy -Dartifact=jakarta.ws.rs:jakarta-restful-ws-tck:${TCK_VERSION} -Dtck.version=${TCK_VERSION} -Dtransitive=false
export DOWNLOAD_PATH='tests/jersey-tck/target/dependency/'
export NAME=`ls ${DOWNLOAD_PATH}`

echo '***********************************************************************************' >> SUMMARY.TXT
echo '*** TCK bundle information ***' >> SUMMARY.TXT
echo "*** Name: ${NAME} ***" >> SUMMARY.TXT
echo '*** Artifact ID: jakarta.ws.rs:jakarta-restful-ws-tck:'${TCK_VERSION}' ***' >> SUMMARY.TXT
echo '*** Date and size: '`stat -c "date: %y, size(b): %s" ${DOWNLOAD_PATH}/${NAME}`' ***' >> SUMMARY.TXT
echo '*** SHA256SUM: '`sha256sum ${DOWNLOAD_PATH}/${NAME} | awk '{print $1}'`' ***' >> SUMMARY.TXT
echo '*** ***' >> SUMMARY.TXT
echo '***********************************************************************************' >> SUMMARY.TXT
echo '*** TCK results summary ***' >> SUMMARY.TXT
export TESTS_RUN=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Tests run: [0-9]*' | awk '{ SUM += $3 } END { print SUM }'`
export FAILURES=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Failures: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'`
export ERRORS=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Errors: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'`
export SKIPPED=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Skipped: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'`
echo '[INFO] Number of Tests Passed = '${TESTS_RUN} >> SUMMARY.TXT
echo '[INFO] Number of Tests Failed = '${FAILURES} >> SUMMARY.TXT
echo '[INFO] Number of Tests with Errors = '${ERRORS} >> SUMMARY.TXT
echo '[INFO] Number of Skipped Tests = '${SKIPPED} >> SUMMARY.TXT
echo '[INFO] ****************************************************************************' >> SUMMARY.TXT
grep 'Tests run:' tck.log | grep --invert-match 'Skipped: [0-9]*$' >> SUMMARY.TXT


#
# Archive the artifacts:
# tck.log,tests/jersey-tck/target/glassfish7/glassfish/domains/domain1/logs/server.log,tests/jersey-tck/pom.xml,SUMMARY.TXT
#
106 changes: 106 additions & 0 deletions etc/scripts/TCK/EE8/jersey-staging-GF-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash -ex
#
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#

#
# script for Jersey EE8 integration into Glassfish 5.
#
# Input Parameters:
# GF_URL - type: String
# - value: http://central.maven.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip
# - description: actual URL of the Glassfish 5
# MAVEN_REPO_URL - type: String
# - value: https://jakarta.oss.sonatype.org/content/groups/staging/org/glassfish/jersey
# - description: Jersey binaries location
# JERSEY_VERSION - type: String
# - value: 2.42
# - description: the version of Jersey to be integrated into the GF
# JERSEY_JARS - type: Multi-line String
# - value: containers/glassfish/jersey-gf-ejb/${JERSEY_VERSION}/jersey-gf-ejb
# containers/jersey-container-grizzly2-http/${JERSEY_VERSION}/jersey-container-grizzly2-http
# containers/jersey-container-servlet/${JERSEY_VERSION}/jersey-container-servlet
# containers/jersey-container-servlet-core/${JERSEY_VERSION}/jersey-container-servlet-core
# core/jersey-client/${JERSEY_VERSION}/jersey-client
# core/jersey-common/${JERSEY_VERSION}/jersey-common
# core/jersey-server/${JERSEY_VERSION}/jersey-server
# ext/jersey-bean-validation/${JERSEY_VERSION}/jersey-bean-validation
# ext/cdi/jersey-cdi1x/${JERSEY_VERSION}/jersey-cdi1x
# ext/cdi/jersey-cdi1x-servlet/${JERSEY_VERSION}/jersey-cdi1x-servlet
# ext/cdi/jersey-cdi1x-transaction/${JERSEY_VERSION}/jersey-cdi1x-transaction
# ext/jersey-entity-filtering/${JERSEY_VERSION}/jersey-entity-filtering
# ext/jersey-mvc/${JERSEY_VERSION}/jersey-mvc
# ext/jersey-mvc-jsp/${JERSEY_VERSION}/jersey-mvc-jsp
# inject/jersey-hk2/${JERSEY_VERSION}/jersey-hk2
# media/jersey-media-jaxb/${JERSEY_VERSION}/jersey-media-jaxb
# media/jersey-media-json-binding/${JERSEY_VERSION}/jersey-media-json-binding
# media/jersey-media-json-jackson/${JERSEY_VERSION}/jersey-media-json-jackson
# media/jersey-media-json-jettison/${JERSEY_VERSION}/jersey-media-json-jettison
# media/jersey-media-json-processing/${JERSEY_VERSION}/jersey-media-json-processing
# media/jersey-media-moxy/${JERSEY_VERSION}/jersey-media-moxy
# media/jersey-media-multipart/${JERSEY_VERSION}/jersey-media-multipart
# media/jersey-media-sse/${JERSEY_VERSION}/jersey-media-sse
# - description: List of binaries to be integrated into the GF 5
#
#
# Configuration:
#
# JDK:
# (System)
# Git:
# ------none------
#
# Copy artifacts from another project:
# JAXRS_build
# Latest successful build
# Artifacts to copy:
# **/*.jar
# Target directory:
# download
# [X] Flatten directories [X] Fingerprint Artifacts
#
#
#
ls
cd download
wget -q ${GF_URL} -O glassfish.zip
#wget -q ${JAX_RS_JAR} -O jakarta.ws.rs-api.jar

while IFS= read -r line ; do wget -q ${MAVEN_REPO_URL}/$line-${JERSEY_VERSION}.jar; done <<< "${JERSEY_JARS}"

echo Listing grabbed jars
ls *.jar

#unzip
unzip -q glassfish.zip -d ${WORKSPACE}
cd ${WORKSPACE}/glassfish5/glassfish/modules

#replace API jar
#cp -v ${WORKSPACE}/download/jakarta.ws.rs-api.jar .

#replace Jersey Jar
for jarfile in ${WORKSPACE}/download/*.jar; do
echo $(basename $jarfile) | sed -e 's/-RC[0-9][0-9]*//' | sed -e 's/-SNAPSHOT//' | sed -e 's/\.[0-9][0-9]*//' | sed -e 's/\.[0-9][0-9]*//' | sed -e 's/-[0-9][0-9]*//' | while IFS= read -r gfnamejar ; do if [ -f $gfnamejar ]; then rm -v $gfnamejar; cp -v $jarfile $gfnamejar; fi; done;
done

cd ${WORKSPACE}
zip -r glassfish.zip glassfish5


#
# Archive the artifacts:
# glassfish.zip
#
#
163 changes: 163 additions & 0 deletions etc/scripts/TCK/EE8/tck-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#!/bin/bash -ex
#
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#

#
# script for building EE8 TCK bundle for Jersey.
#
# Input Parameters:
# GF_URL - type: String
# - value: https://search.maven.org/remotecontent?filepath=org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip
# - description: actual URL of the Glassfish 5
#
# Configuration:
#
# JDK:
# oracle-jdk8-latest
# Git:
# https://github.com/eclipse-ee4j/jakartaee-tck.git
# Branch:
# */master
# Check out to a sub-directory:
# CTS
#
# [X] With Ant:
# apache-ant-latest
# JDK:
# oracle-jdk8-latest
#
# Copy artifacts from another project:
# ts_jte_alter
# Latest successful build
# Artifacts to copy:
# ts.jte
# Target directory:
# download
# [X] Flatten directories [X] Fingerprint Artifacts
#
#
#

mkdir ${WORKSPACE}/CTS/tools
mkdir ${WORKSPACE}/CTS/tools/ant

#create zip command
#mkdir batch
#touch ${WORKSPACE}/batch/zip.sh
#chmod +x ${WORKSPACE}/batch/zip.sh
#touch ${WORKSPACE}/batch/zip
#chmod +x ${WORKSPACE}/batch/zip
#alias zip='${WORKSPACE}/batch/zip.sh'

#echo "echo ARG1=\$1">batch/zip.sh
#echo "echo ARG2=\$2">>batch/zip.sh
#echo "echo ARG3=\$3">>batch/zip.sh
#echo "if [ \$1='-T' ]; then">>batch/zip.sh
#echo " exit">>batch/zip.sh
#echo "fi">>batch/zip.sh
#echo "filename=\`echo \$2 | cut -d'.' -f 1,2\`">>batch/zip.sh
#echo "echo filename=\$filename">>batch/zip.sh
#echo "tar -zcvf '\${filename}'.tar.gz \$3">>batch/zip.sh
#echo "mv \${filename}.tar.gz \${filename}.zip">>batch/zip.sh
#echo "echo created \${filename}.zip">>batch/zip.sh

#echo "${WORKSPACE}/batch/zip.sh \$*">batch/zip

#cat batch/zip.sh
#cat batch/zip


#Set variables
export ANT_OPTS=-Djavax.xml.accessExternalSchema=all

cd download
#wget -4 https://jenkins.eclipse.org/jersey/view/TCK/job/ts_jte_alter/lastSuccessfulBuild/artifact/ts.jte

#wget -q https://ci.adoptopenjdk.net/view/Build%20Monitor/job/jtharness/lastSuccessfulBuild/artifact/jtharness.tar.gz -O jtharness.tar.gz
#wget -q https://ci.adoptopenjdk.net/view/Build%20Monitor/job/sigtest/lastSuccessfulBuild/artifact/sigtest.tar.gz -O sigtest.tar.gz
#wget -q http://central.maven.org/maven2/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar -O jaxb-xjc.jar
#wget -q http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar -O ant-contrib.jar
#wget -q http://central.maven.org/maven2/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
#wget -q http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
#wget -q http://central.maven.org/maven2/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
#tar xfz jtharness.tar.gz
#tar xvfz sigtest.tar.gz
#unzip -q sigtest-4.0
#cp -av ${WORKSPACE}/download/sigtest-4.0/lib/. ${WORKSPACE}/CTS/lib/
#cp -v ${WORKSPACE}/download/jtharness/lib/javatest.jar ${WORKSPACE}/CTS/lib/javatest.jar
#cp -v ${WORKSPACE}/download/jaxb-xjc.jar ${WORKSPACE}/CTS/lib/
#cp -v ${WORKSPACE}/download/ant-contrib.jar ${WORKSPACE}/CTS/lib/
#cp -v ${WORKSPACE}/download/ant-contrib.jar ${WORKSPACE}/CTS/lib/ant-contrib-1.0b3.jar
#cp -v ${WORKSPACE}/download/commons-httpclient-3.1.jar ${WORKSPACE}/CTS/lib/
#cp -v ${WORKSPACE}/download/commons-logging-1.1.1.jar ${WORKSPACE}/CTS/lib/
#cp -v ${WORKSPACE}/download/commons-codec-1.3.jar ${WORKSPACE}/CTS/lib/


ls

yes | cp -vr ${WORKSPACE}/download/ts.jte ${WORKSPACE}/CTS/install/jaxrs/bin/
#cp -v ${WORKSPACE}/download/ts.jte ${WORKSPACE}/CTS/bin/ts.jte

wget -q ${GF_URL} -O glassfish.zip
unzip -q glassfish.zip -d ${WORKSPACE}

#COMPILE TCK

export TS_HOME=${WORKSPACE}/CTS
export deliverabledir=jaxrs
export javaee_home=${WORKSPACE}/glassfish5

#touch ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/api = servlet >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/api/rs/ext/interceptor = standalone >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/ee = standalone >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/jaxrs21 = standalone >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/jaxrs21/api = servlet >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/spec = standalone >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/servlet3 = standalone >> ${WORKSPACE}/CTS/vehicle.properties
#echo com/sun/ts/tests/jaxrs/platform = standalone >> ${WORKSPACE}/CTS/vehicle.properties

#cat ${WORKSPACE}/CTS/vehicle.properties

#fix the test
cd ${WORKSPACE}/CTS/src/com/sun/ts/tests/jaxrs/jaxrs21/ee/sse/sseeventsink
sed -i '314s/open()/register(holder::add)/' JAXRSClient.java
sed -i '315s/register(holder::add)/open()/' JAXRSClient.java
#end of fix

cd ${WORKSPACE}/CTS/install/${deliverabledir}/bin
ant build.all
ant update.jaxrs.wars

# BUNDLE TCK

cd ${WORKSPACE}/CTS/release/tools/
ant jakartaee-jaxrs
#ls ${WORKSPACE}/CTS/release/JAXRS_BUILD/
cd ${WORKSPACE}/CTS/release/JAXRS_BUILD/latest
for fn in `ls *.zip`; do cp -v "${fn}" `echo ${fn} | cut -d'_' -f 1`_latest.zip; done

#zip -s 10m jaxrstck_split_latest.zip jaxrstck-2.1_latest.zip
#ls



#
# Archive the artifacts:
# CTS/release/JAXRS_BUILD/latest/*.z*
#
#

Loading