0
votes

I'd like to integrate a PlayFramework application into IBM Bluemix Delivery Pipeline service. When I create a new Job in a build stage I have a list of supported Builder Types:

Builder Types

Play Application uses SBT for build, but it's not in the list. If I use "Shell Script" option and invoke some sbt command the job obviously fails with error message "sbt: command not found".

Is there any way to get sbt installed on the environment where the build is executed?

1
Are you sure that you are using the Delivery Pipeline service and not the Continuous Delivery service? The Delivery Pipeline service reached the End of Support as of July 5, 2017. See: ibm.com/blogs/bluemix/2017/04/delivery-pipeline-retirement Please use the Continuous Delivery service as its replacement. See: console.bluemix.net/catalog/services/continuous-deliveryWilliam 'Bill' Wentworth
Well, it is called Delivery Pipeline on the Bluemix console. I've created a Toolchain and added a service called Delivery Pipeline sitting in the "Deliver" stage of the Pipeline. On the other hand, it exactly looks the same as on the screenshots here: ibm.com/blogs/bluemix/2016/11/…. On the screenshots it is also called Delivery Pipeline, but the article is about "Bluemix Continuous Delivery". The second sentence declares that "it includes several components that you’re likely familiar with, including Delivery Pipeline". So DP. is part of CD.?Levente Holló
Anyway...whatever it is called, I can find only one service on Bluemix console for this and it seems it doesn't support SBT.Levente Holló

1 Answers

1
votes

First, a bit of background around what happens when you run a pipeline job using Continuous Delivery. Everything you put in the custom script field of a job configuration will get executed on a fresh container. This container is stood up at job execution time using a base image provided by IBM. Anything not included in said base image won't be available in your pipeline job, at least not out of the box.

Now, since said base image doesn't include SBT, you must download it and add it to your PATH manually. Below is a script you can use to do that.

#!/bin/bash
wget --output-document=/tmp/sbt.tgz https://github.com/sbt/sbt/releases/download/v1.0.0/sbt-1.0.0.tgz
tar -xvf /tmp/sbt.tgz --directory=/tmp
export PATH="/tmp/sbt/bin:$PATH"
chmod +x /tmp/sbt
// Run sbt commands below here

NOTE: I'm not familiar with SBT and how its configured, but you will probably need to play around with the Java runtimes on the container to support the scala version you are having SBT use. Java7 and 8 are included, with 7 being the default. To switch to Java8 you can include the following in your job script:

#!/bin/bash
export JAVA_HOME=$JAVA8_HOME
export PATH="$JAVA_HOME/bin/:$PATH"
java -version # Verify that we are using java8 runtime