forked from vmware-tanzu-learning/pal-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrateDatabase.yml
More file actions
29 lines (25 loc) · 875 Bytes
/
migrateDatabase.yml
File metadata and controls
29 lines (25 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
platform: linux
image_resource:
type: docker-image
source:
repository: openjdk
tag: '8-jdk'
inputs:
- name: pal-tracker
# - name: version
#outputs:
# - name: build-output
run:
path: bash
args:
- -exc
- |
cd pal-tracker
curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar -zx
chmod +x cf
curl -L "https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/5.0.5/flyway-commandline-5.0.5-linux-x64.tar.gz" | tar -zx
chmod +x flyway-5.0.5/flyway
./cf login -a $CF_API_URL -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
./cf ssh -N -L 63306:$MYSQL_IP:3306 pal-tracker &
sleep 10
./flyway-5.0.5/flyway -url="jdbc:mysql://127.0.0.1:63306/$DATABASE_NAME" -locations=filesystem:databases/tracker -user=$DATABASE_USERNAME -password=$DATABASE_PASSWORD clean migrate