Skip to content

Commit

Permalink
Add all driver to generate flexible images.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjmerono committed Feb 25, 2017
1 parent a3765e2 commit 3d88086
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can build many different sakai images ready to run at any moment. You just h
* REPO_NAME=sakai
* REPO_REVISION=branch,hash_value,...
* TOMCAT_IMAGE=tomcat:8.0.41-jre8,... // Choose tomcat docker image you want to use
* SAKAI_DB_DRIVER=mariadb,mysql,oracle //Choose the database driver you want to use in your environment
* SAKAI_DB_DRIVER=mariadb,mysql,oracle,all //Choose the database driver you want to add in the image (all will let you use the image with any database later)
* BINARY_RELEASE=11.3,... // Choose a release and don't build the code just test binary releases (fast)
* DB_IMAGE=mysql,mariadb,sakaiproject/oracle // Choose the database docker image
* DB_VERSION=5.6.27,5.5.54,oracle-xe-11g,oracle-12c
Expand All @@ -51,15 +51,18 @@ You can build many different sakai images ready to run at any moment. You just h

The first thing you can do is trying a Sakai binary release, without building from code, just downloading from [Sakai](https://www.sakaiproject.org/download-sakai)

* Steps to run Sakai 11.3 with mysql:
* Steps to build Sakai 11.3 for any database:
* REPO_OWNER=sakaiproject
* REPO_NAME=sakai
* SAKAI_TAG=11.3
* TOMCAT_IMAGE=tomcat:8.0.41-jre8
* SAKAI_DB_DRIVER=mysql
* BINARY_RELEASE=11.3
* DB_IMAGE=mysql
* DB_VERSION=5.6.27
* SKIP_LAUNCH=true
* SAKAI_DB_DRIVER=all
* Use _mysql_ to avoid add oracle credentials.
* MASTER_PASSWORD=...
* ORACLE_USER=...
* ORACLE_PASS=...

Build the image and test Sakai 11.3.

Expand Down Expand Up @@ -135,4 +138,5 @@ For example you can test some property in a previous 11.3 sakai build.
* PROPERTIES_FILE=local.properties - To add properties in this file
* SAKAI_TAG=11.3_experimental - Any name you want to use to tag the new image
* SKIP_LAUNCH=true - Do not run the image, just build it.

* You can create multiple pipelines to build different Sakai images.
* Create pipeline and set environment variables
5 changes: 3 additions & 2 deletions codefresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ steps:
condition:
all:
existsMasterPassword: 'includes("${{MASTER_PASSWORD}}", "$") == false'
oracleDatabase: '"${{SAKAI_DB_DRIVER}}" == "oracle"'
oracleDatabase: '"${{SAKAI_DB_DRIVER}}" == "oracle" || "${{SAKAI_DB_DRIVER}}" == "all"'
notSakaiExperimental: 'includes("${{SAKAI_BASE_TAG}}", "$") == true'

build_wait:
Expand Down Expand Up @@ -158,7 +158,7 @@ steps:
condition:
all:
noSkipOracleBuild: '"${{SKIP_ORACLE_BUILD}}" != "true"'
oracleDatabase: '"${{SAKAI_DB_DRIVER}}" == "oracle"'
oracleDatabase: '("${{SAKAI_DB_DRIVER}}" == "oracle" || "${{SAKAI_DB_DRIVER}}" == "all") && (includes("${{DB_VERSION}}","oracle") == true)'

build_image:
title: Building Docker Sakai Image
Expand All @@ -178,6 +178,7 @@ steps:
- base_image: '${{SAKAI_BASE_TAG}}'
- experimental: '${{EXPERIMENTAL_PROPS}}'
- properties: '${{PROPERTIES_FILE}}'
- driver: '${{SAKAI_DB_DRIVER}}'

launch_sakai_composition:
title: Launch Sakai Server Composition
Expand Down
59 changes: 59 additions & 0 deletions wait/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,64 @@
</plugins>
</build>
</profile>
<profile>
<id>all</id>
<repositories>
<repository>
<id>maven.oracle.com</id>
<name>oracle-maven-repo</name>
<url>https://maven.oracle.com</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>1.5.8</version>
<type>jar</type>
<outputDirectory>target</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
<type>jar</type>
<outputDirectory>target</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
<type>jar</type>
<outputDirectory>target</outputDirectory>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 3d88086

Please sign in to comment.