From 5546e36efe400b89ab77388e46cbb400b6736506 Mon Sep 17 00:00:00 2001 From: Dan Kirkwood Date: Wed, 21 Dec 2016 11:23:59 -0700 Subject: [PATCH 1/3] use mysql 5.5 for conversion --- traffic_ops/app/db/pg-migration/Dockerfile-mysql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-mysql b/traffic_ops/app/db/pg-migration/Dockerfile-mysql index a4bf51f0f0..36e782627d 100644 --- a/traffic_ops/app/db/pg-migration/Dockerfile-mysql +++ b/traffic_ops/app/db/pg-migration/Dockerfile-mysql @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM mysql:5.6 +FROM mysql:5.5 MAINTAINER Dan Kirkwood From 2d859f5e724fdb151c624381ddd5e42386cf3dcd Mon Sep 17 00:00:00 2001 From: Dan Kirkwood Date: Wed, 21 Dec 2016 11:25:07 -0700 Subject: [PATCH 2/3] conversion -- move env settings to separate files --- .../app/db/pg-migration/dataimport.env | 19 +++++++++++++++++++ .../app/db/pg-migration/dataimport.yml | 6 ++---- .../app/db/pg-migration/docker-compose.yml | 4 ---- .../app/db/pg-migration/postgres_host.yml | 6 ++---- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 traffic_ops/app/db/pg-migration/dataimport.env diff --git a/traffic_ops/app/db/pg-migration/dataimport.env b/traffic_ops/app/db/pg-migration/dataimport.env new file mode 100644 index 0000000000..b177869a30 --- /dev/null +++ b/traffic_ops/app/db/pg-migration/dataimport.env @@ -0,0 +1,19 @@ +#!/bin/bash -x +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +TO_SERVER=http://traffic_ops.example.com +TO_USER=to_user +TO_PASSWORD=twelve + diff --git a/traffic_ops/app/db/pg-migration/dataimport.yml b/traffic_ops/app/db/pg-migration/dataimport.yml index 1087efa26c..b949925110 100644 --- a/traffic_ops/app/db/pg-migration/dataimport.yml +++ b/traffic_ops/app/db/pg-migration/dataimport.yml @@ -20,7 +20,5 @@ services: context: . dockerfile: Dockerfile-traffic_ops-client restart: "no" - environment: - - TO_USER - - TO_PASSWORD - - TO_SERVER + env_file: + - dataimport.env diff --git a/traffic_ops/app/db/pg-migration/docker-compose.yml b/traffic_ops/app/db/pg-migration/docker-compose.yml index a9d9d859a7..7dc4f5b9d9 100644 --- a/traffic_ops/app/db/pg-migration/docker-compose.yml +++ b/traffic_ops/app/db/pg-migration/docker-compose.yml @@ -43,10 +43,6 @@ services: extends: service: postgres_host file: postgres_host.yml - environment: - - POSTGRES_DB=traffic_ops - - POSTGRES_PASSWORD=twelve - - POSTGRES_USER=traffic_ops depends_on: - mysql volumes: diff --git a/traffic_ops/app/db/pg-migration/postgres_host.yml b/traffic_ops/app/db/pg-migration/postgres_host.yml index f8e0439551..9e1100f9ac 100644 --- a/traffic_ops/app/db/pg-migration/postgres_host.yml +++ b/traffic_ops/app/db/pg-migration/postgres_host.yml @@ -18,9 +18,7 @@ services: build: context: .. dockerfile: pg-migration/Dockerfile-postgres - environment: - - POSTGRES_DB=traffic_ops - - POSTGRES_PASSWORD=twelve - - POSTGRES_USER=traffic_ops + env_file: + - postgres.env ports: - 5432 From e07827e3c89d7dfcdcd60481bbefa2e7395c341e Mon Sep 17 00:00:00 2001 From: Dan Kirkwood Date: Wed, 21 Dec 2016 19:23:51 +0000 Subject: [PATCH 3/3] remove blank lines from env files -- causes problems with docker-compose --- traffic_ops/app/db/pg-migration/dataimport.env | 2 -- traffic_ops/app/db/pg-migration/mysql.env | 2 -- traffic_ops/app/db/pg-migration/postgres.env | 2 -- 3 files changed, 6 deletions(-) diff --git a/traffic_ops/app/db/pg-migration/dataimport.env b/traffic_ops/app/db/pg-migration/dataimport.env index b177869a30..3364c52e9e 100644 --- a/traffic_ops/app/db/pg-migration/dataimport.env +++ b/traffic_ops/app/db/pg-migration/dataimport.env @@ -1,4 +1,3 @@ -#!/bin/bash -x # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - TO_SERVER=http://traffic_ops.example.com TO_USER=to_user TO_PASSWORD=twelve diff --git a/traffic_ops/app/db/pg-migration/mysql.env b/traffic_ops/app/db/pg-migration/mysql.env index ead4c1510c..15d3bead5c 100644 --- a/traffic_ops/app/db/pg-migration/mysql.env +++ b/traffic_ops/app/db/pg-migration/mysql.env @@ -1,4 +1,3 @@ -#!/bin/bash -x # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - MYSQL_DATABASE=traffic_ops_db MYSQL_HOST=mysql MYSQL_RANDOM_ROOT_PASSWORD=yes diff --git a/traffic_ops/app/db/pg-migration/postgres.env b/traffic_ops/app/db/pg-migration/postgres.env index db23c8fc0b..c08bc5b927 100644 --- a/traffic_ops/app/db/pg-migration/postgres.env +++ b/traffic_ops/app/db/pg-migration/postgres.env @@ -1,4 +1,3 @@ -#!/bin/bash -x # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - POSTGRES_HOST=postgres POSTGRES_DB=traffic_ops POSTGRES_PASSWORD=twelve