Skip to content
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
2 changes: 1 addition & 1 deletion ansible/roles/submitter_deploy/files/submitter-env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ JOB_CONFIG_DEFAULT = OPENJDK_17
AGENT_GROUPS_DEFAULT = AWSAgents,Spotinst Java Agents,DotNet,Bynet
#AGENT_GROUPS_DEFAULT = Spotinst Java Agents,DotNet,Bynet
DAILY_JOB_PRIORITY_DEFAULT = 0
NIGHTLY_JOB_PRIORITY_DEFAULT = 3
NIGHTLY_JOB_PRIORITY_DEFAULT = 3
99 changes: 62 additions & 37 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ FROM ubuntu

ARG user=newman
ARG group=newman
ARG uid=1000
ARG gid=1000
ARG uid=1001
ARG gid=1001

ARG JAVA_VER=17
# ARG NODE_VER=8.9.3
ARG NODE_VER=20.12.1
# ARG MVN_VER=3.3.9
ARG MVN_VER=3.6.3

RUN apt-get update -y
RUN apt-get install wget nano -y
RUN apt-get install wget vim nano sudo curl netbase openjdk-${JAVA_VER}-jdk -y && apt-get clean
ENV JAVA_HOME /usr/lib/jvm/java-${JAVA_VER}-openjdk-amd64/


# Jenkins is run with user `newman`, uid = 1000
Expand All @@ -15,45 +22,66 @@ RUN apt-get install wget nano -y
RUN groupadd -g ${gid} ${group} \
&& useradd -d "/home/${user}" -u ${uid} -g ${gid} -m -s /bin/bash ${user}

# Install Java.
RUN apt-get install openjdk-8-jdk -y
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/

# Install Maven
RUN wget --no-verbose -O /tmp/apache-maven-3.3.9.tar.gz \
http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
# RUN wget --no-verbose -O /tmp/apache-maven-3.3.9.tar.gz \
# http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

# stop building if md5sum does not match
RUN echo "516923b3955b6035ba6b0a5b031fbd8b /tmp/apache-maven-3.3.9.tar.gz" | \
md5sum -c
# # stop building if md5sum does not match
# RUN echo "516923b3955b6035ba6b0a5b031fbd8b /tmp/apache-maven-3.3.9.tar.gz" | \
# md5sum -c


# install in /opt/maven
RUN mkdir -p /opt/maven
# # install in /opt/maven
# RUN mkdir -p /opt/maven

RUN tar xzf /tmp/apache-maven-3.3.9.tar.gz --strip-components=1 \
-C /opt/maven
# RUN tar xzf /tmp/apache-maven-3.3.9.tar.gz --strip-components=1 \
# -C /opt/maven

RUN ln -s /opt/maven/bin/mvn /usr/local/bin
RUN rm -f /tmp/apache-maven-3.3.9.tar.gz
# RUN ln -s /opt/maven/bin/mvn /usr/local/bin
# RUN rm -f /tmp/apache-maven-3.3.9.tar.gz
# ==============================
# Install Maven
# ==============================
ARG MVN_ARCHIVE=apache-maven-${MVN_VER}-bin.tar.gz
RUN wget --no-verbose -O /tmp/${MVN_ARCHIVE} \
http://archive.apache.org/dist/maven/maven-3/${MVN_VER}/binaries/${MVN_ARCHIVE}
# stop building if md5sum does not match
# RUN echo "516923b3955b6035ba6b0a5b031fbd8b /tmp/${MVN_ARCHIVE}" | md5sum -c
RUN mkdir -p /opt/maven && \
tar xvfz /tmp/${MVN_ARCHIVE} --strip-components=1 -C /opt/maven && \
rm -f /tmp/${MVN_ARCHIVE}
ENV PATH="/opt/maven/bin:${PATH}"
RUN mvn --version

# get node
RUN echo 'get node tar.gz'
RUN wget --no-verbose -O /tmp/node-v8.9.3-linux-x64.tar.gz \
https://nodejs.org/dist/v8.9.3/node-v8.9.3-linux-x64.tar.gz

# ==============================
# Install NODE.JS runtime
# ==============================
RUN mkdir /opt/node
RUN wget --no-verbose -O /tmp/node-v${NODE_VER}-linux-x64.tar.gz \
https://nodejs.org/dist/v${NODE_VER}/node-v${NODE_VER}-linux-x64.tar.gz
RUN tar zxvf /tmp/node-v${NODE_VER}-linux-x64.tar.gz --strip-components=1 -C /opt/node && \
rm -f /tmp/node-v${NODE_VER}-linux-x64.tar.gz
ENV PATH="/opt/node/bin:${PATH}"
RUN node --version && npm --version

# unpack node tar.gz
RUN echo 'unpacking node tar.gz' && \
tar zxvf /tmp/node-v8.9.3-linux-x64.tar.gz --strip-components=1 \
-C /opt/node && \
rm -f /tmp/node-v8.9.3-linux-x64.tar.gz
# get node
# RUN echo 'get node tar.gz'
# RUN wget --no-verbose -O /tmp/node-v8.9.3-linux-x64.tar.gz \
# https://nodejs.org/dist/v8.9.3/node-v8.9.3-linux-x64.tar.gz

RUN ln -s /opt/node/bin/node /usr/local/bin && ln -s /opt/node/bin/npm /usr/local/bin
# RUN mkdir /opt/node

RUN node --version && \
npm --version
# RUN echo 'unpacking node tar.gz' && \
# tar zxvf /tmp/node-v8.9.3-linux-x64.tar.gz --strip-components=1 \
# -C /opt/node && \
# rm -f /tmp/node-v8.9.3-linux-x64.tar.gz

# RUN ln -s /opt/node/bin/node /usr/local/bin && ln -s /opt/node/bin/npm /usr/local/bin

# RUN node --version && \
# npm --version


USER ${user}
Expand All @@ -63,15 +91,12 @@ RUN echo 'installing elm' && \

ENV PATH=/home/${user}/.npm-global/:$PATH
ENV globalDir="/home/${user}/.npm-global/"
RUN cd ${globalDir} && wget --no-verbose -O "${globalDir}"/elm.tar.gz https://github.com/elm-lang/elm-platform/releases/download/0.18.0-exp/elm-platform-linux-64bit.tar.gz && \
tar -zxvf "${globalDir}"/elm.tar.gz
RUN echo ELM
RUN cd ${globalDir} && \
wget --no-verbose -O "${globalDir}"/elm.tar.gz https://github.com/elm-lang/elm-platform/releases/download/0.18.0-exp/elm-platform-linux-64bit.tar.gz && \
tar -zxvf "${globalDir}"/elm.tar.gz

#RUN npm install -g elm@0.18.0
#RUN npm install -g elm@0.19.0

VOLUME /newman/
ENV PATH=$JAVA_HOME/bin:$PATH

USER root
RUN apt-get install sudo curl -y netbase

USER ${user}
5 changes: 3 additions & 2 deletions docker/docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
DIRNAME=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`

docker build --build-arg user=$USER --build-arg uid=$(id -u) --build-arg gid=$(id -g) -t newman ${DIRNAME}
#docker build --build-arg user=$USER --build-arg uid=$(id -u) --build-arg gid=$(id -g) -t newman ${DIRNAME}
docker build -t newman ${DIRNAME}

docker pull mongo
docker pull mongo
48 changes: 48 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: "3.9"

networks:
default:
name: internal
driver: bridge
external:
driver: bridge

volumes:
mongo-data:
driver: local

services:
mongodb:
image: mongo:latest
container_name: mongodb_container
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
MONGO_INITDB_DATABASE: newmandb
volumes:
- ./mongo-data:/data/db

newman-server:
container_name: newman-server
image: gigaspaces/newman-server:latest
build:
context: ./
dockerfile: Dockerfile
platform: ${PLATFORM:-linux/amd64}
ports:
- 8443:8443
depends_on:
- mongodb
environment:
NODE_ENV: development
volumes:
- ./:/newman
# healthcheck:
# test: curl --fail https://127.0.0.1:8443 || exit 1
# interval: 30s
# retries: 10
# start_period: 30s
# timeout: 10s
2 changes: 1 addition & 1 deletion newman-analytics/bin/newman-crontab.file
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
00 7,10,15 * * * cd /data/newman/newman/newman-analytics/bin && ./newman-analytics.sh ../resources/crons/alert/alert.properties > /data/newman/newman/newman-analytics/logs/alert.log 2>&1
00 7,10,15 * * * cd /data/newman/newman/newman-analytics/bin && ./diskspace.sh > /data/newman/newman/newman-analytics/logs/ds_alert.log 2>&1

#@reboot . /etc/environment; cd /home/xap/newman-server; ./run.sh
@reboot crontab /data/newman/newman/newman-analytics/bin/newman-crontab.file
8 changes: 8 additions & 0 deletions newman-analytics/resources/crons/alert/alert.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cronjob-class = com.gigaspaces.newman.crons.alert.DiskSpaceAlertCronJob

# mailman properties
mail.account.username =
mail.account.password =
mail.message.recipients = rnd@gigaspaces.com

crons.alert.capacityThreshold = 70
4 changes: 4 additions & 0 deletions newman-analytics/resources/crons/cleanse/cleanse.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cronjob-class = com.gigaspaces.newman.crons.cleanse.CleanseCronJob

crons.cleanse.numberOfDaysToNotDelete = 20

65 changes: 65 additions & 0 deletions newman-analytics/resources/crons/suitediff/body-template.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<html>
<body>
$if(hiss)$
<div>
<p>Failing Tests that need your attention:</p>
$hiss:{
* $it.suiteName$ - <a href="$it.testURL$">$it.testName$</a><br>
}$
</div>
$endif$
$if(suitesThatDidNotParticipate)$
<div>
<p>Skipped Suites: &nbsp;
$suitesThatDidNotParticipate: {
$it$,
}$
</p></div>
$endif$
<div><p>
Summary:
$if(summary.increasingDiff)$<font color=red>(+$summary.totalIncreasingDiff$ &uarr;)</font>$endif$
$if(summary.decreasingDiff)$<font color=green>($summary.totalDecreasingDiff$ &darr;)</font>$endif$
<br>&nbsp; $totalSuites$ suites,
<br>&nbsp; $totalPassed$ passed, $totalFailed$ failed, $totalFailedx$ failedx3
</p></div>
<div class="styling">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse;">
<tr>
<th>Suite</th>
<th>Failures</th>
<th>Total</th>
</tr>
$diffs:{
<tr>
<td>$it.suiteName$</td>
<td>
$it.failedTests$
$if(it.increasingDiffFailedTests)$<font color=red>(+$it.diffFailedTests$ &uarr;)</font>
$elseif(it.decreasingDiffFailedTests)$<font color=green>($it.diffFailedTests$ &darr;)</font>
$endif$
</td>
<td>
$it.totalTests$
$if(it.increasingDiffTotalTests)$(+$it.diffTotalTests$ &uarr;)
$elseif(it.decreasingDiffTotalTests)$($it.diffTotalTests$ &darr;)
$endif$
</td>
</tr>
}$
</table>
</div>
<div>
<p></p>
<table border=0>
<tr><td>latest ($latestBuildBranch$)</td><td><a href="$latestUrl$">$latestBuildName$</a></td><td>$latestBuildDate$</td><td>&#9716; $latestBuildDuration$</td></tr>
<tr><td>previous ($previousBuildBranch$)</td><td><a href="$previousUrl$">$previousBuildName$</a></td><td>$previousBuildDate$</td><td>&#9719; $previousBuildDuration$</td></tr>
<tr><td>changes</td>
$if(insightEdgeChangeset)$<td><a href="$insightEdgeChangeset$">insightEdge</a></td><td></td><td></td>
$else$<td><a href="$xapOpenChangeset$">xap-open</a></td><td><a href="$xapChangeset$">xap</a></td><td></td>
$endif$
</tr>
</table>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[NEWMAN] ($latestBuildBranch$) $latestBuildName$ $suiteName$ with $latestBuildFailedTests$ failures
14 changes: 14 additions & 0 deletions newman-analytics/resources/crons/suitediff/suitediff.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cronjob-class = com.gigaspaces.newman.crons.suitediff.SuiteDiffCronJob
properties-path = "autowired with current path location"

# mailman properties
mail.account.username =
mail.account.password =
mail.message.recipients = rnd@gigaspaces.com

# report properties
crons.suitediff.trackLatest = true
#crons.suitediff.branch = master
#crons.suitediff.tag =
#crons.suitediff.latestBuildId
#crons.suitediff.previousBuildId
24 changes: 24 additions & 0 deletions newman-server/config/realm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
root=root, admin
support=support, user
user=user, user
alesia=alesia, user
anton=anton, user
davyd=davyd, user
ester=ester, user
esubotin=esubotin, user
evgeny=evgeny, user
inbal=inbal, user
irena=irena, user
michael=michael, user
michaelg=michaelg, user
mishel=mishel, user
moran=moran, user
noi=noi, user
oleksii=oleksii, user
sagiv=sagiv, user
sapir=sapir, user
shai=shai, user
support=support, user
tolik=tolik, user
yonatan=yonatan, user
yuval=yuval, user
Binary file added newman-server/web/elm/favicon.ico
Binary file not shown.