Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MySQL Support #18

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bamboo-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MAINTAINER H. Wüthrich "[email protected]"
CMD ["/sbin/my_init"]

# Environment
ENV BAMBOO_VERSION 5.7.2
ENV BAMBOO_VERSION 5.10.1.1
ENV BAMBOO_HOME /home/bamboo

# Expose web and agent ports
Expand All @@ -24,8 +24,8 @@ RUN apt-get update && apt-get upgrade -y # 28.01.2015

# Install Java OpenJDK 7 and VCS tools
RUN apt-get install -yq python-software-properties && add-apt-repository ppa:webupd8team/java -y && apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install -yq oracle-java7-installer git subversion
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install -yq oracle-java8-installer git subversion

# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
14 changes: 14 additions & 0 deletions bamboo-server/bamboo-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ else
echo "-> Extracting to $BAMBOO_DIR ..."
tar xzf /tmp/atlassian-bamboo.tar.gz -C /opt
rm -f /tmp/atlassian-bamboo.tar.gz


echo "Add MySQL Connector"

if [ -z $MYSQL_CONNECTOR_VERSION ]; then
echo "MYSQL_CONNECTOR_VERSION not set. Setting to 5.1.38"
MYSQL_CONNECTOR_VERSION=5.1.38
fi

wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-$MYSQL_CONNECTOR_VERSION.tar.gz -O /tmp/mysql-connector.tar.gz
tar xzf /tmp/mysql-connector.tar.gz -C /tmp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracting into /tmp is poor practice, I'd recommend creating a temporary directory (MYSQL_TMP_DIR=mktemp -d) and extracting into that. It has benefits, as shown in my next comment...

mv /tmp/mysql-connector-java-$MYSQL_CONNECTOR_VERSION/mysql-connector-java-$MYSQL_CONNECTOR_VERSION-bin.jar $BAMBOO_DIR/lib/
rm -Rf /tmp/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too greedy and may have unintended side effects. It can be avoided with a wrapping temporary directory.


echo "-> Installation completed"
fi

Expand Down