Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
release_engineering
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanhua kuang
release_engineering
Commits
6e7d1fdb
Commit
6e7d1fdb
authored
Feb 29, 2020
by
zkuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix data migration error
parent
71082c9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
6 deletions
+91
-6
docker-compose.seeding.yml
docker-compose.seeding.yml
+27
-6
pipeline.sh
pipeline.sh
+64
-0
No files found.
docker-compose.seeding.yml
View file @
6e7d1fdb
...
...
@@ -2,7 +2,7 @@ version: "3.7"
services
:
carbinet_migrate
:
build
:
.
image
:
carbinet:latest
image
:
gzego/
carbinet:latest
container_name
:
carbinet_migrate
links
:
-
mysql:mysql
...
...
@@ -26,7 +26,7 @@ services:
carbinet_upgrade
:
build
:
.
image
:
carbinet:latest
image
:
gzego/
carbinet:latest
container_name
:
carbinet_upgrade
links
:
-
mysql:mysql
...
...
@@ -34,7 +34,6 @@ services:
depends_on
:
-
"
mysql"
-
"
redis"
-
"
carbinet_migrate"
environment
:
-
ALI_IOT_ACCESS_KEY_ID=LTAI4FsNmRpoK4wEmBP5xL2J
-
ALI_IOT_ACCESS_KEY_SECRET=Mb9n4bTp3u6aLYThBoDy9S26cX4npD
...
...
@@ -47,11 +46,11 @@ services:
-
ALI_IOT_AMQP_CLIENT_ID=carbinet
networks
:
-
ego
command
:
[
"
./wait-for-it.sh"
,
"
mysql:3306"
,
"
--"
,
"
flask"
,
"
db"
,
"
upgrade"
]
command
:
[
"
./wait-for-it.sh"
,
"
mysql:3306"
,
"
--"
,
"
sh"
,
"
-c"
,
"
flask
db
migrate
&&
flask
db
upgrade"
]
carbinet_seed
:
build
:
.
image
:
carbinet:latest
image
:
gzego/
carbinet:latest
container_name
:
carbinet_seed
links
:
-
mysql:mysql
...
...
@@ -92,9 +91,31 @@ services:
networks
:
-
ego
command
:
[
"
./wait-for-it.sh"
,
"
mysql:3306"
,
"
--"
,
"
python"
,
"
./manage.py"
,
"
migrate"
]
sso_seed
:
build
:
./sso
container_name
:
sso_seed
image
:
gzego/sso:latest
tty
:
true
stdin_open
:
true
links
:
-
mysql:mysql
depends_on
:
-
"
mysql"
environment
:
-
SECRET_KEY=1gboig1%1%ljuz_h0&8m%s84ybxz42z3w0pu50qi%mobo%poae
-
ALLOWED_HOSTS=["sso.gzego.com"]
-
DB_NAME=sso
-
DB_USERNAME=sso
-
DB_PASSWORD=123456
-
DB_HOST=mysql
-
DB_PORT=3306
-
CAS_SERVICES=["http://carbinet.gzego.com:8080/api/cas", "http://carbinet.gzego.com:8080/api/cas/logout"]
networks
:
-
ego
command
:
[
"
./wait-for-it.sh"
,
"
mysql:3306"
,
"
--"
,
"
python"
,
"
./manage.py"
,
"
createsuperuser"
]
carbinet_bash
:
build
:
.
image
:
carbinet:latest
image
:
gzego/
carbinet:latest
container_name
:
carbinet_migrate
links
:
-
mysql:mysql
...
...
pipeline.sh
0 → 100755
View file @
6e7d1fdb
build
()
{
echo
"building..."
if
[[
"
$(
docker images
-q
ego/carbinet:base 2> /dev/null
)
"
==
""
]]
;
then
docker build
-t
ego/carbinet:base
-f
./Dockerfile.base
.
fi
if
[
-d
"./sso/.git"
]
;
then
pushd
./sso
git pull origin master
popd
else
git clone
-b
master
--single-branch
--depth
=
1 http://git.gz-ego.com/zkuang/sso.git
fi
if
[
-d
"./ziti/.git"
]
;
then
pushd
./ziti
git pull origin cas
popd
else
git clone
-b
cas
--single-branch
--depth
=
1 http://git.gz-ego.com/iot/ziti.git
fi
rm
-rf
ziti/carbinet_service/migrations/versions/
*
pushd
./ziti/carbinet-admin-web/
yarn
&&
VUE_APP_BASE_API
=
/api yarn build:prod
cp
-fr
./dist/
*
../../www/carbinet/
popd
docker-compose build carbinet_production
docker-compose build sso_production
docker-compose build mysql
docker-compose build nginx
docker-compose build redis
}
migrate
()
{
echo
"migrating..."
docker-compose
-f
./docker-compose.yml
-f
./docker-compose.seeding.yml up carbinet_upgrade
docker-compose
-f
./docker-compose.yml
-f
./docker-compose.seeding.yml up sso_migrate
}
seed
()
{
echo
"seeding..."
docker-compose
-f
./docker-compose.yml
-f
./docker-compose.seeding.yml up carbinet_seed
docker-compose
-f
./docker-compose.yml
-f
./docker-compose.seeding.yml run sso_seed
}
if
[
"
$1
"
==
"build"
]
;
then
build
elif
[
"
$1
"
==
"migrate"
]
;
then
migrate
elif
[
"
$1
"
==
"seed"
]
;
then
seed
elif
[
"
$1
"
==
"deploy"
]
;
then
docker-compose up
-d
elif
[
"
$1
"
==
"all"
]
;
then
build
migrate
seed
docker-compose up
-d
fi
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment