Skip to content
Permalink
Browse files

Build using tools in a docker container - Add Dockerfile for builder …

…and..

  build.xml to pass in install4j license key
  use Virtual X11 frame buffer for running tests in container
  decrease document build verbosity
  • Loading branch information...
birchb1024 committed Apr 22, 2019
1 parent 882ef55 commit 94134ff31d85b0754806dd1c4aa27d32930a3bc6
Showing with 59 additions and 20 deletions.
  1. +1 −0 .gitignore
  2. +12 −16 build.xml
  3. +44 −0 docker/genyris-build.dockerfile
  4. +2 −2 examples/swing-table.g
  5. +0 −2 examples/web-api.g
@@ -43,3 +43,4 @@ out

doc/genyris.wiki

tools/*deb
@@ -1,5 +1,6 @@
<project name="Genyris" default="build-workspace" basedir=".">

<property environment="env"/>
<property name="build.compiler" value="javac1.6" />
<property name="needed.lib.dir" value="needed" />
<property name="junit.lib.dir" value="needed" />
@@ -168,7 +169,7 @@
</javac>
</target>

<target name="only-compile-docs" description="Creat PDF manual" depends="git-info">
<target name="only-compile-docs" description="Create PDF manual" depends="git-info">
<copy file="doc/reference/manual.lyx" tofile="dist/genyris-manual-${version}.lyx" verbose="true" overwrite="true">
<filterchain>
<replacetokens>
@@ -182,22 +183,13 @@
<include name="*jpg" />
</fileset>
</copy>
<exec executable="lyx" dir="dist" failonerror="true" os="Linux">
<exec executable="lyx" dir="dist" failonerror="true" output="dist/lyx.log" >
<arg value="-batch" />
<arg value="--export" />
<arg value="pdf" />
<arg value="genyris-manual-${version}.lyx" />
</exec>
<exec executable="C:\Program Files\LyX16\bin\lyx.exe" dir="dist" failonerror="true" os="Windows XP">
<arg value="--export" />
<arg value="pdf" />
<arg value="genyris-manual-${version}.lyx" />
</exec>
<exec executable="C:\Python27\python.exe" dir="dist" failonerror="true" os="Windows XP">
<arg value="C:\downloads\elyxer\elyxer-1.0.4\elyxer.py" />
<arg value="genyris-manual-${version}.lyx" />
<arg value="genyris-manual-${version}.html" />
</exec>
<exec executable="/usr/bin/elyxer" dir="dist" failonerror="true" os="Linux">
<exec executable="/usr/bin/elyxer" dir="dist" failonerror="true" output="dist/elyxer.log">
<arg value="genyris-manual-${version}.lyx" />
<arg value="genyris-manual-${version}.html" />
</exec>
@@ -277,7 +269,9 @@
<exec executable="bash" failonerror="true">
<env key="GENYRIS_HOME" value="${basedir}" />
<arg value="-c" />
<arg value="java -Xmx256M -classpath ${GENYRIS_HOME}/dist/\*:${GENYRIS_HOME}/dist/needed/\* org.genyris.interp.ClassicReadEvalPrintLoop test/acceptance/suite.g" />
<arg value="-u" />
<arg value="-x" />
<arg value="xvfb-run java -Xmx256M -classpath ${GENYRIS_HOME}/dist/\*:${GENYRIS_HOME}/dist/needed/\* org.genyris.interp.ClassicReadEvalPrintLoop test/acceptance/suite.g" />
</exec>
</target>

@@ -309,8 +303,10 @@
</copy>

<exec executable="bash" failonerror="true">
<arg value="-c" />
<arg value="install4jc --disable-bundling dist/genyris.install4j" />
<arg value="-c" />
<arg value="-x" />
<arg value="-u" />
<arg value="install4jc --disable-bundling --license=&quot;$INSTALL4J_LICENSE&quot; dist/genyris.install4j" />
</exec>
<checksum file="rel/genyris_windows-x64_${version.underscores}.zip" forceOverwrite="yes" />
<checksum file="rel/genyris_unix_${version.underscores}.tar.gz" forceOverwrite="yes" />
@@ -0,0 +1,44 @@
#
# Container for building, packaging Genyris code and documenation
#
# Build-the-builder:
#
# $ docker build -f docker/genyris-build.dockerfile --tag genyris-build .
#
# Use the builder:
#
# The Install4j license key must be in the environment variable INSTALL4J_LICENSE.
#
# Acquire the source code to be built into a 'genyris' directory...
#
# $ git clone git@github.com:birchb1024/genyris.git
#
# Now run the build in the current directory using the tools in the container. This
# runs as user id 1000 aka 'builder'.
#
# $ docker run --rm -it -v "${PWD}":/genyris -w /genyris --env INSTALL4J_LICENSE=${INSTALL4J_LICENSE} genyris-build
#
FROM debian:9-slim

# Add tools from the Debian package world..
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /usr/share/man/man1 # Needed by openjdk-8-jdk !
RUN apt-get -qq update && \
apt-get -qq install -y xvfb vim git openjdk-8-jdk ant lyx elyxer

# Add other, non-packaged tools..
ADD tools/install4j_linux_7_0_3.deb /install4j_linux_7_0_3.deb
RUN dpkg -i /install4j_linux_7_0_3.deb && \
install4jc --license='L-M7-GENYRIS#50040871010001-2rbsvr4yqnx2gc#738b6'

# Set up the non-root user
RUN groupadd --gid 1000 builder && useradd -m --uid 1000 --gid 1000 builder

RUN java -version && \
ant -version && \
git --version && \
install4jc --version

USER builder:builder
CMD ant

@@ -11,7 +11,7 @@ java:import 'javax.swing.ListSelectionModel' as ListSelectionModel
java:import 'javax.swing.DefaultListSelectionModel' as DefaultListSelectionModel

def getValueAt(row col)
print ("getValueAt: row %s col %s"(.format row col))
# print ("getValueAt: row %s col %s"(.format row col))
* (+ row 1) (+ col 1)

def getColumnCount() 12
@@ -49,4 +49,4 @@ def createAndShowGUI()
.setSize-java_awt_Dimension (Dimension(.new-int-int 200 200))
.pack
.setVisible-boolean true
createAndShowGUI
createAndShowGUI
@@ -9,8 +9,6 @@ var theJSON (response(.readAll))
print theJSON
print (theJSON(.fromJSON))!ip

exit

var response (left (web:get 'https://api.squiggle.com.au/?q=games;year=2018;complete=100'))
var decode (response(.readAll))
for game in ((decode(.fromJSON)).games)

0 comments on commit 94134ff

Please sign in to comment.
You can’t perform that action at this time.