Easily installing new Oxygen publishing engines in linux
Posted: Tue Jan 05, 2021 6:36 pm
Hi everyone,
We use the Oxygen publishing engine in a linux environment to create our final production-ready PDFs. I thought I'd share the linux script that I use to download and configure the publishing engine:
This script does the following:
Here's what the working directory looks like before the script is run:
Here's what it looks like the script is run:
You can use this script to install multiple build versions, then manually adjust the no-build-number filesystem link to point to whichever version you like.
We use the Oxygen publishing engine in a linux environment to create our final production-ready PDFs. I thought I'd share the linux script that I use to download and configure the publishing engine:
Code: Select all
#!/bin/bash
rm -rf oxygen-publishing-engine-3.x
OXY=`realpath oxygen-publishing-engine-3.x`
REPO=/u/doc/git/dita-git-repo
# external named URLs do not resolve in our internal network environment
wget http://89.36.26.124/InstData/PublishingEngine/oxygen-publishing-engine-3.x.zip
# uncompress the publishing engine
unzip -q ./oxygen-publishing-engine-*.zip
rm ./oxygen-publishing-engine-*.zip
# install the license key
cp ./licensekey.txt ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry
# install our company plugins
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN1 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN2 ${OXY}/plugins/
ln -s ${REPO}/prj/dita_plugins/com.my.PLUGIN3 ${OXY}/plugins/
${OXY}/bin/dita --install
# install the Windows fonts
rm -rf ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/fonts
ln -s `realpath ./fonts` ${OXY}/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/fonts
# rename by build number, then make a filesystem link
BUILD=`grep -P -o '(?<=build )(\d+)' oxygen-publishing-engine-3.x/DITA-OT.README_OXYGEN.txt`
rm -rf ./oxygen-publishing-engine-3.x-${BUILD}
mv ./oxygen-publishing-engine-3.x ./oxygen-publishing-engine-3.x-${BUILD}
ln -s ./oxygen-publishing-engine-3.x-${BUILD} ./oxygen-publishing-engine-3.x
- Downloads and decompresses the current version of the publishing engine.
- Installs the "licensekey.txt" file located in the current directory.
- Creates filesystem links to DITA-OT plugins stored in a Git repo directory.
- Creates a filesystem link to an additional fonts directory.
- Renames publishing engine directory by its build number, then creates a filesystem link to it without the build number.
Here's what the working directory looks like before the script is run:
Code: Select all
% ls -l
total 161516
4 drwxrwxrwx 2 doc src 4096 Jan 5 04:37 fonts/
4 -rw-rw-rw- 1 doc src 295 Jan 5 04:37 licensekey.txt
4 -rwxrwxrwx 1 doc src 2263 Jan 5 05:10 update.sh*
Code: Select all
% ls -l
total 161516
4 drwxrwxrwx 2 doc src 4096 Jan 5 04:37 fonts/
4 -rw-rw-rw- 1 doc src 295 Jan 5 04:37 licensekey.txt
0 lrwxrwxrwx 1 doc src 41 Jan 5 05:11 oxygen-publishing-engine-3.x -> ./oxygen-publishing-engine-3.x-2020121802/
4 drwxr-xr-x 7 doc src 4096 Dec 18 04:25 oxygen-publishing-engine-3.x-2020121802/
4 -rwxrwxrwx 1 doc src 2263 Jan 5 05:10 update.sh*