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
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions bamboo-server/bamboo-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ 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"

Choose a reason for hiding this comment

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

Not everyone will want to use MySQL and need this connector. I'd add a BAMBOO_DB env var in the Dockerfile, defaulting to embedded but also supporting mysql and postgresql. You could then check that and see if it's appropriate to download a particular driver.

MYSQL_CONNECTOR_VERSION="5.1.38"
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 /opt/atlassian-bamboo-5.1/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