Permalink
Browse files

Add mysql while testing

  • Loading branch information...
making committed Dec 2, 2017
1 parent e164171 commit bf51d2836bcfd79ed9dd4090ce74454c5b309c2b
Showing with 49 additions and 18 deletions.
  1. +38 −18 ci/pipeline.yml
  2. +11 −0 docker-compose.yml
View
@@ -41,11 +41,11 @@ resources:
# - name: cf-master
# type: cf
# source:
# api: ((cf-api))
# username: ((cf-username))
# password: ((cf-password))
# organization: ((cf-org))
# space: blog
# api: ((pws-api))
# username: ((pws-username))
# password: ((pws-password))
# organization: ((pws-org))
# space: production
# skip_cert_check: true
# - name: cf-develop
# type: cf
@@ -79,6 +79,11 @@ resources:
type: slack-notification
source:
url: ((slack-webhook-url))
- name: mysql
type: docker-image
source:
repository: mariadb
tag: 10.0.30
jobs:
### Dev
- name: unit-test-develop
@@ -87,6 +92,9 @@ jobs:
- get: repo
resource: repo-develop
trigger: true
- get: mysql
params:
save: true
- task: mvn-test
privileged: true
params:
@@ -96,21 +104,33 @@ jobs:
image_resource:
type: docker-image
source:
repository: maven
repository: making/dcind-jdk
inputs:
- name: repo
- name: mysql
caches:
- path: repo/m2
run:
path: bash
path: sh
args:
- -c
- |
set -e
source /docker-lib.sh
start_docker
docker load -i mysql/image
docker tag "$(cat mysql/image-id)" "$(cat mysql/repository):$(cat mysql/tag)"
docker images
cd repo
rm -rf ~/.m2
ln -fs $(pwd)/m2 ~/.m2
docker-compose up -d
sleep 3
mvn test
docker-compose down
on_failure:
put: slack-alert
params:
@@ -204,7 +224,7 @@ jobs:
- name: repo
- name: nexus
outputs:
- name: updated
- name: updated
run:
path: bash
args:
@@ -227,7 +247,6 @@ jobs:
put: slack-alert
params:
<<: *SLACK_SUCCESS
### Prod
- name: merge-develop-to-master
plan:
@@ -253,7 +272,7 @@ jobs:
- name: repo-src
- name: repo-dest
outputs:
- name: merged
- name: merged
run:
path: bash
args:
@@ -270,7 +289,7 @@ jobs:
on_failure:
put: slack-alert
params:
<<: *SLACK_FAILURE
<<: *SLACK_FAILURE
- put: repo-master
params:
repository: merged
@@ -286,6 +305,9 @@ jobs:
trigger: true
passed:
- merge-develop-to-master
- get: mysql
params:
save: true
- task: mvn-test
privileged: true
params:
@@ -295,7 +317,7 @@ jobs:
on_failure:
put: slack-alert
params:
<<: *SLACK_FAILURE
<<: *SLACK_FAILURE
- name: tag-master
plan:
- aggregate:
@@ -320,7 +342,7 @@ jobs:
outputs:
- name: output
caches:
- path: repo/m2
- path: repo/m2
run:
path: bash
args:
@@ -344,15 +366,15 @@ jobs:
on_failure:
put: slack-alert
params:
<<: *SLACK_FAILURE
<<: *SLACK_FAILURE
- put: repo-master
params:
repository: output
tag: repo-version/number
on_failure:
put: slack-alert
params:
<<: *SLACK_FAILURE
<<: *SLACK_FAILURE
- name: upload-to-nexus-releases
plan:
- get: repo
@@ -366,7 +388,7 @@ jobs:
on_failure:
put: slack-alert
params:
<<: *SLACK_FAILURE
<<: *SLACK_FAILURE
- put: nexus
params:
file: build/*.jar
@@ -393,8 +415,6 @@ jobs:
# environment_variables:
# SECURITY_USER_NAME: ((ops-username))
# SECURITY_USER_PASSWORD: ((ops-password))
# SECURITY_OAUTH2_CLIENT_CLIENT_ID: ((github-oauth-client-id))
# SECURITY_OAUTH2_CLIENT_CLIENT_SECRET: ((github-oauth-client-secret))
# on_failure:
# put: slack-alert
# params:
View
@@ -0,0 +1,11 @@
version: "2"
services:
db:
image: mariadb:10.0.30
container_name: mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: blog_test
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

0 comments on commit bf51d28

Please sign in to comment.