Introducing the Viable Blog
05 February 2020
I have started making the viable.blog, where I intend to write longer more substantial posts. I am making the Viable Blog from scratch sharing the source code, and simultaneously blogging about its developments and discoveries. The Viable Blog will have an emphasis on DevOps, Software Development and (once the platform is built) MVP experiments. Here is the first post of the Viable Blog.
Long term I am looking to turn 'www.geoffhayward.eu' into just my online portfolio & CV website. When it's time to decommission this blog, I will keep the content archived here.
Read : Introducing the Viable Blog
Serving Static Files With Bloomreach CMS
19 June 2019
Serving a static files with Bloomreach (formally known as Hippo CMS), such as BingVerify.xml, is not as simple as dropping it in the webapp folder. However, with a little extra configuration Bloomreach CMS will serve the file.
First add the static file in webapp. In my case example site/src/main/webapp/BingSiteAuth.xml
. Then update hts:default
in sitemap.ymal akin to the following.
/hst:hst/hst:configurations/hst:default/hst:sitemap:
/BingSiteAuth.xml:
hst:authenticated: false
hst:containerresource: true
jcr:primaryType: hst:sitemapitem
After rebuilding the project, the static file BingSiteAuth.xml will be served by Bloomreach CMS.
Read : Serving Static Files With Bloomreach CMS
Git: Set Upstream of a New Branch on First Push
29 April 2019
The first push of a new Git branch, when given as git push
will remind you to set the upstream.
$(git push 2>&1 | grep "git push")
Read : Git: Set Upstream of a New Branch on First Push
I'm Answering Questions for NHS Digital at The Search Conference
06 November 2018
I'm excited to announce that I will be answering SEO (search engine optimisation) questions on behalf of NHS Digital at The Search Conference in February 2019.
If you are interested in SEO from a Software Developer's point of view, I hope to see you there.
Read : I'm Answering Questions for NHS Digital at The Search Conference
Maven: Packaging Dockerfile's with variables
03 October 2018
This post is a note on using Maven's 'maven-antrun-plugin' to replace a variable version number in a Dockerfile with the Maven project's version.
The following code replaces this line ADD ./target/application-@{version}.jar application.jar
in a Dockerfile with something like ADD ./target/application-1.2.0-SNAPSHOT.jar application.jar
. The processed Dockerfile is then saved in the target folder alongside any other artefacts created by Maven.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy file="Dockerfile" todir="${project.build.directory}"/>
<replace file="${project.build.directory}/Dockerfile" >
<replacefilter token="@{version}" value="${project.version}" />
</replace>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Once the Dockerfile has been processed a tool such as the Maven 'maven-assembly-plugin' can then package the Dockerfile and other artefacts into a shippable form.
For completeness, here is an example configuration that creates a shippable ZIP ready for AWS's Elastic Beanstalk.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>make-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
And here is the corresponding example of the 'filesSets' element from an assembly.xml.
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
<outputDirectory>target</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>Dockerfile</include>
</includes>
<outputDirectory>.</outputDirectory>
</fileSet>
<fileSet>
<directory>${basedir}</directory>
<includes>
<-- other stuff from the base directory -->
</includes>
<outputDirectory>.</outputDirectory>
</fileSet>
</fileSets>
I hope this helps you.
Read : Maven: Packaging Dockerfile's with variables