Skip to content

Commit 0956cd5

Browse files
committed
The workspace used to build the OpenEdge appserver code and deploy the runtime libraries into a dockerized PASOE.
1 parent 646e94d commit 0956cd5

17 files changed

+631
-0
lines changed
Binary file not shown.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# MinimumPASOEDockerPipeline
22
A minimal viable pipeline setup for Docker PASOE image
3+
4+
https://www.jenkins.io/doc/book/pipeline/jenkinsfile/
5+
https://stackoverflow.com/questions/19179447/jenkins-how-to-access-build-number-environment-variable#19183529
6+
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
7+
https://github.com/Riverside-Software/pct/wiki/PCTCompile
8+

src/Pasoe/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
*.r

src/Pasoe/BuildScripts/Build.xml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<project name="PasoeSoftware" default="BuildDone" basedir="..">
4+
5+
<property name="Docker.Dir" location="Work/Input/Docker" />
6+
<property name="DLC" location="C:/Progress/OpenEdge127_64" />
7+
<property name="PCT.JAR" location="${DLC}/PCT/PCT.jar" />
8+
9+
<!--
10+
* PCT Initialisation
11+
*-->
12+
<taskdef resource="PCT.properties">
13+
<classpath>
14+
<pathelement location="${PCT.JAR}"/>
15+
</classpath>
16+
</taskdef>
17+
18+
<typedef resource="types.properties">
19+
<classpath>
20+
<pathelement location="${PCT.JAR}"/>
21+
</classpath>
22+
</typedef>
23+
24+
<target name="Init">
25+
<delete dir="Work" />
26+
<mkdir dir="Work" />
27+
<mkdir dir="Work/Output" />
28+
<mkdir dir="Work/Input" />
29+
<mkdir dir="Work/Output/Rcode" />
30+
<mkdir dir="${Docker.Dir}" />
31+
</target>
32+
33+
<target name="Compile" depends="Init">
34+
<PCTCompile
35+
graphicalMode="false"
36+
destDir="Work/Output/Rcode"
37+
dlcHome="${DLC}">
38+
39+
<fileset dir="OpenEdge" includes="**/*.cls" />
40+
41+
<propath>
42+
<pathelement path="${DLC}/tty/netlib/OpenEdge.Net.pl" />
43+
</propath>
44+
45+
</PCTCompile>
46+
47+
48+
</target>
49+
50+
<target name="CreateLibrary" depends="Compile">
51+
<PCTLibrary
52+
destfile="${Docker.Dir}/Application.pl"
53+
dlcHome="${DLC}">
54+
55+
<fileset dir="Work/Output/Rcode">
56+
<include name="**/*.r" />
57+
</fileset>
58+
</PCTLibrary>
59+
</target>
60+
61+
<target name="BundleDocker" depends="CreateLibrary">
62+
<copy file="Docker/Dockerfile" todir="${Docker.Dir}" />
63+
<copy file="JDK/OpenJDK17U-jdk_x64_linux_hotspot_17.0.4.1_1.tar.gz" todir="${Docker.Dir}" />
64+
<copy file="Docker/start.sh" todir="${Docker.Dir}" />
65+
66+
</target>
67+
68+
<target name="BuildDone" depends="BundleDocker">
69+
<echo message="Build Done!" />
70+
</target>
71+
72+
</project>

src/Pasoe/Docker/Dockerfile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Dockerfile for PASOE demo image
3+
#
4+
5+
FROM store/progresssoftware/pasoe:12.7.0
6+
7+
#
8+
# Add Java
9+
#
10+
11+
USER root
12+
ADD OpenJDK17U-jdk_x64_linux_hotspot_17.0.4.1_1.tar.gz /usr
13+
RUN mv /usr/jdk-17.0.4.1+1 /usr/java
14+
RUN chmod 777 /usr/java/bin/java
15+
RUN chmod 777 /usr/java/bin
16+
RUN chmod 777 /usr/java
17+
18+
# Deploy entry point script
19+
COPY start.sh /psc/wrk
20+
RUN mv /psc/wrk/start.sh /psc/wrk/start.txt
21+
RUN sed 's/\r//' /psc/wrk/start.txt > /psc/wrk/start.sh
22+
RUN chmod +x /psc/wrk/start.sh
23+
24+
#
25+
# Creating PASOE
26+
#
27+
USER pscadmin
28+
ENV Pasoe /psc/wrk/HelloWorldPasoe
29+
ENV AppRoot $Pasoe/openedge
30+
RUN export DLC=/psc/dlc JAVA_HOME=/usr/java &&\
31+
$DLC/servers/pasoe/bin/tcman.sh create -p 8820 -P 8821 -s 8822 $Pasoe
32+
33+
# Deploy app
34+
COPY Application.pl $AppRoot
35+
36+
RUN export DLC=/psc/dlc JAVA_HOME=/usr/java &&\
37+
$Pasoe/bin/oeprop.sh '+AppServer.Agent.HelloWorldPasoe.PROPATH=$AppRoot/Application.pl,${DLC}/tty/netlib/OpenEdge.Net.pl,${DLC}/tty/OpenEdge.Core.pl,${DLC}/tty'
38+
39+
RUN export DLC=/psc/dlc JAVA_HOME=/usr/java &&\
40+
$Pasoe/bin/oeprop.sh '+HelloWorldPasoe.ROOT.WEB.adapterEnabled=1' &&\
41+
$Pasoe/bin/oeprop.sh '+HelloWorldPasoe.ROOT.WEB.defaultHandler=OpenEdge.Web.CompatibilityHandler' &&\
42+
$Pasoe/bin/oeprop.sh '+HelloWorldPasoe.ROOT.WEB.handler1=WebHandlers.HelloWorldWebHandler:/HelloWorld'
43+
44+
45+
ENTRYPOINT ["/psc/wrk/start.sh"]
46+
EXPOSE 8820
47+
EXPOSE 8821
48+
EXPOSE 8822
49+
50+
51+
52+
53+
54+

src/Pasoe/Docker/start.sh

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#!/bin/bash
2+
#
3+
# start script
4+
#
5+
PasoeName=HelloWorldPasoe
6+
Dlc=/psc/dlc
7+
Pasoe=/psc/wrk/${PasoeName}
8+
PasoeLogs=${Pasoe}/logs
9+
PasoeBin=${Pasoe}/bin
10+
PasoeAgentLog=${PasoeLogs}/${PasoeName}.agent.`date +%Y-%m-%d`.log
11+
TimeOut=60
12+
13+
if [ -r "${PasoeLogs}/*" ] ; then
14+
echo "# Cleaning logs in : ${PasoeLogs}"
15+
rm ${PasoeLogs}/*
16+
fi
17+
18+
# Start the appserver
19+
20+
${PasoeBin}/tcman.sh start -v
21+
echo "#########################################################"
22+
echo "# #"
23+
echo "# Starting Docker Container #"
24+
echo "# #"
25+
echo "#########################################################"
26+
echo "# Waiting until the Catalina starts #"
27+
echo "#########################################################"
28+
i=0
29+
until [ -f "${PasoeLogs}/catalina.out" ]
30+
do
31+
sleep 1
32+
printf "."
33+
((i=i+1))
34+
if [ ${i} -ge ${TimeOut} ] ; then
35+
echo "#########################################################"
36+
echo "# Error: Catalina was not able to start #"
37+
echo "#########################################################"
38+
cat ${PasoeLogs}/*
39+
ls -ltr ${PasoeLogs}/*
40+
bash
41+
exit 1
42+
fi
43+
done
44+
# Give the Catalina some time to log something useful
45+
sleep 3
46+
cat ${PasoeLogs}/catalina.out
47+
48+
echo "#########################################################"
49+
echo "# Waiting until the Pasoe agent starts #"
50+
echo "#########################################################"
51+
echo "Searching for file: ${PasoeAgentLog}"
52+
53+
i=0
54+
until [ -f "${PasoeAgentLog}" ] ; do
55+
sleep 1
56+
printf "."
57+
((i=i+1))
58+
if [ ${i} -ge ${TimeOut} ] ; then
59+
echo "#########################################################"
60+
echo "# Error: the Pasoe agent was not able to start #"
61+
echo "#########################################################"
62+
cat ${PasoeLogs}/*
63+
ls -ltr ${PasoeLogs}/*
64+
bash
65+
exit 1
66+
fi
67+
done
68+
69+
printf "\n"
70+
71+
if [ "x$1" != "xmenu" ] ; then
72+
first=true
73+
else
74+
first=false
75+
fi
76+
77+
until [ "${Answer}" = "x" ] ; do
78+
Answer="?"
79+
80+
if [ x${first} = xtrue ] ; then
81+
Answer=c
82+
first=false
83+
else
84+
echo "\n#########################################################"
85+
echo "# p - Escape to proenv #"
86+
echo "# x - Stop the Docker container #"
87+
echo "# c - Continue #"
88+
echo "# l - List Pasoe logs directory #"
89+
echo "# b - List agent logfile from the beginning #"
90+
echo "# a - List all logfiles in /logs #"
91+
read -rsn1 Answer
92+
fi
93+
94+
case "${Answer}" in
95+
"p") ${Dlc}/bin/proenv ;;
96+
"c") tail -f ${PasoeAgentLog} ;;
97+
"l") ls -ltr ${PasoeLogs} ;;
98+
"b") cat ${PasoeAgentLog} ;;
99+
"l") cat ${PasoeLogs}/* ;;
100+
"x") exit 0 ;;
101+
esac
102+
done
103+
104+

src/Pasoe/JDK/OpenJDK17.readme

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Please download an OpenJDK tar.gz file to place here.
2+
For instance from:
3+
https://builds.openlogic.com/downloadJDK/openlogic-openjdk/17.0.5+8/openlogic-openjdk-17.0.5+8-linux-x64.tar.gz
4+

src/Pasoe/Jenkinsfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pipeline {
2+
agent any
3+
4+
stages {
5+
stage('Build') {
6+
steps {
7+
withAnt(installation: 'DlcAnt') {
8+
bat "ant -f BuildScripts/Build.xml"
9+
}
10+
}
11+
}
12+
stage('Docker') {
13+
steps {
14+
dir('Work/Input/Docker')
15+
{
16+
echo "Building Docker Image"
17+
bat "docker build . --tag pug-pasoe:${BUILD_NUMBER}"
18+
}
19+
}
20+
}
21+
}
22+
}

src/Pasoe/License/progress.cfg.readme

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Here should be a valid progress.cfg license file
2+
authorizing the use of the PASOE.

src/Pasoe/OpenEdge/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Pug2022</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.openedge.pdt.text.progressBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>com.openedge.pdt.text.progressNature</nature>
21+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
22+
</natures>
23+
</projectDescription>

src/Pasoe/OpenEdge/.propath

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<propath version="12.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema/propath.xsd">
3+
<propathentry env="all" kind="src" path="@{ROOT}" platform="All"/>
4+
<propathentry env="all" kind="dir" path="@{WORK}" platform="All"/>
5+
<propathentry env="gui" kind="con" path="com.openedge.pdt.text.GUI_LIBRARIES" platform="All"/>
6+
<propathentry env="tty" kind="con" path="com.openedge.pdt.text.TTY_LIBRARIES" platform="All"/>
7+
<propathentry env="all" kind="con" path="com.openedge.pdt.text.DLC_PATHS" platform="All"/>
8+
</propath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<fixed facet="openedge.project"/>
4+
<installed facet="openedge.project" version="11"/>
5+
</faceted-project>

0 commit comments

Comments
 (0)