Skip to content

Instantly share code, notes, and snippets.

@hkarakose
Created August 23, 2017 07:50
Show Gist options
  • Save hkarakose/8182238c12ae62a7ba9b47fc4a8019ec to your computer and use it in GitHub Desktop.
Save hkarakose/8182238c12ae62a7ba9b47fc4a8019ec to your computer and use it in GitHub Desktop.
Gitlab CI script which starts a maven image and links it to a mysql service
image: maven:3-jdk-8
services:
# mysql hostname is 'mysql'. You should configure your db configuration so that it connects to 'mysql' host.
- mysql:latest
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: REPLACE_WITH_YOUR_DB_NAME
MYSQL_ROOT_PASSWORD: REPLACE_WITH_YOUR_ROOT_PASSWORD
build:
script: "mvn clean install -B"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment