Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
docker
Commits
9669cc70
Commit
9669cc70
authored
Feb 06, 2019
by
thomas craipeau
Browse files
update install
parent
a3ff55dd
Pipeline
#3333
failed with stages
in 19 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
9669cc70
...
...
@@ -42,7 +42,7 @@ sudo chown -R ${USER:=$(/usr/bin/id -run)}:$USER code/log/
# Initial setup
*
0 Clone this repository
```
git clone https://git
hub.com
/pixelhumain/docker pixelhumain-docker
git clone https://git
lab.adullact.net
/pixelhumain/docker pixelhumain-docker
```
*
1 Create a folder
*code*
*code/data/db*
*code/log*
that will be the source directory inside pixelhumain-docker
```
...
...
@@ -50,7 +50,7 @@ mkdir -p code/data/db
mkdir -p code/log
```
*
2 Put your source file in the
*code*
directory:
-
see https://git
hub.com
/pixelhumain/pixelhumain/blob/master/README.md
-
see https://git
lab.adullact.net
/pixelhumain/pixelhumain/blob/master/README.md
-
use the docker image provided below
-
Your VCS / IDE / ...
*
3 Start the containers using:
...
...
@@ -71,6 +71,7 @@ docker-compose -f docker-compose.yml up
|-- citizenToolKit
|-- api
|-- network
|-- [...]
|-- pixelhumain
|-- ph
|-- [...]
...
...
docker-compose-no-build.yml
View file @
9669cc70
version
:
'
2'
services
:
mongo
:
image
:
mongo
image
:
mongo
:3.4
volumes
:
-
./code/data/db:/data/db
front
:
...
...
docker-compose.yml
View file @
9669cc70
version
:
'
2'
services
:
mongo
:
image
:
mongo
image
:
mongo
:3.4
volumes
:
-
./code/data/db:/data/db
ports
:
...
...
docker-install/install.sh
View file @
9669cc70
...
...
@@ -6,21 +6,40 @@ BASE_DIR="/code"
BASE_DIR_PH
=
"
${
BASE_DIR
}
/pixelhumain/ph"
MODULE_DIR
=
"/code/modules"
ph_uri
=
"https://git
hub.com
/pixelhumain/pixelhumain.git"
ph_uri
=
"https://git
lab.adullact.net
/pixelhumain/pixelhumain.git"
ph_dir
=
"
${
BASE_DIR
}
/pixelhumain"
cmnctr_uri
=
"https://git
hub.com
/pixelhumain/communecter.git"
cmnctr_uri
=
"https://git
lab.adullact.net
/pixelhumain/communecter.git"
cmnctr_dir
=
"communecter"
co2_uri
=
"https://git
hub.com
/pixelhumain/co2.git"
co2_uri
=
"https://git
lab.adullact.net
/pixelhumain/co2.git"
co2_dir
=
"co2"
api_uri
=
"https://git
hub.com
/pixelhumain/api.git"
api_uri
=
"https://git
lab.adullact.net
/pixelhumain/api.git"
api_dir
=
"api"
network_uri
=
"https://git
hub.com
/pixelhumain/network.git"
network_uri
=
"https://git
lab.adullact.net
/pixelhumain/network.git"
network_dir
=
"network"
ctzntkt_uri
=
"https://git
hub.com
/pixelhumain/citizenToolkit.git"
ctzntkt_uri
=
"https://git
lab.adullact.net
/pixelhumain/citizenToolkit.git"
ctzntkt_dir
=
"citizenToolKit"
modules
=
"cmnctr ctzntkt co2 network api"
dda_uri
=
"https://gitlab.adullact.net/pixelhumain/dda.git"
dda_dir
=
"dda"
news_uri
=
"https://gitlab.adullact.net/pixelhumain/news.git"
news_dir
=
"news"
graph_uri
=
"https://gitlab.adullact.net/pixelhumain/graph.git"
graph_dir
=
"graph"
interop_uri
=
"https://gitlab.adullact.net/pixelhumain/interop.git"
interop_dir
=
"interop"
eco_uri
=
"https://gitlab.adullact.net/pixelhumain/eco.git"
eco_dir
=
"eco"
chat_uri
=
"https://gitlab.adullact.net/pixelhumain/chat.git"
chat_dir
=
"chat"
survey_uri
=
"https://gitlab.adullact.net/pixelhumain/survey.git"
survey_dir
=
"survey"
map_uri
=
"https://gitlab.adullact.net/pixelhumain/map.git"
map_dir
=
"map"
onepage_uri
=
"https://gitlab.adullact.net/pixelhumain/onepage.git"
onepage_dir
=
"onepage"
modules
=
"cmnctr ctzntkt co2 network api dda news interop graph eco chat survey map onepage"
# Install pixelhumain
if
[
-d
"
${
ph_dir
}
"
]
...
...
@@ -62,6 +81,7 @@ if [ -f "${BASE_DIR_PH}/protected/config/dbconfig.php" ]
then
echo
"configuration mongodb déja présente :
$BASE_DIR_PH
/protected/config/dbconfig.php"
else
mv
${
BASE_DIR_PH
}
/protected/config/dbconfig.exemple.php
${
BASE_DIR_PH
}
/protected/config/protected/config/dbconfig.php
cat
>
"
${
BASE_DIR_PH
}
/protected/config/dbconfig.php"
<<
EOF
<?php
...
...
@@ -137,6 +157,46 @@ echo "Import cities data..."
mongoimport
--host
mongo
--db
pixelhumain
--collection
cities
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/cities.json"
--jsonArray
fi
#Test zones.json
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
]
;
then
rm
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
fi
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json.zip"
]
;
then
unzip
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json.zip"
-d
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/"
#delete cities and delete all index cities
mongo mongo/pixelhumain
<<
EOF
db.zones.dropIndexes();
db.zones.remove({});
EOF
echo
"Import zones data..."
#import zones
mongoimport
--host
mongo
--db
pixelhumain
--collection
zones
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
--jsonArray
fi
#Test translate.json
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
]
;
then
rm
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
fi
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json.zip"
]
;
then
unzip
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json.zip"
-d
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/"
#delete cities and delete all index cities
mongo mongo/pixelhumain
<<
EOF
db.translate.dropIndexes();
db.translate.remove({});
EOF
echo
"Import translate data..."
#import cities
mongoimport
--host
mongo
--db
pixelhumain
--collection
translate
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
--jsonArray
fi
#create index mongo bash script
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/createIndexMongoDocker.sh"
]
;
then
echo
"Create index mongo..."
;
...
...
docker-install/update.sh
View file @
9669cc70
...
...
@@ -4,21 +4,41 @@ BASE_DIR="/code"
BASE_DIR_PH
=
"
${
BASE_DIR
}
/pixelhumain/ph"
MODULE_DIR
=
"/code/modules"
ph_uri
=
"https://git
hub.com
/pixelhumain/pixelhumain.git"
ph_uri
=
"https://git
lab.adullact.net
/pixelhumain/pixelhumain.git"
ph_dir
=
"
${
BASE_DIR
}
/pixelhumain"
cmnctr_uri
=
"https://git
hub.com
/pixelhumain/communecter.git"
cmnctr_uri
=
"https://git
lab.adullact.net
/pixelhumain/communecter.git"
cmnctr_dir
=
"communecter"
co2_uri
=
"https://git
hub.com
/pixelhumain/co2.git"
co2_uri
=
"https://git
lab.adullact.net
/pixelhumain/co2.git"
co2_dir
=
"co2"
api_uri
=
"https://git
hub.com
/pixelhumain/api.git"
api_uri
=
"https://git
lab.adullact.net
/pixelhumain/api.git"
api_dir
=
"api"
network_uri
=
"https://git
hub.com
/pixelhumain/network.git"
network_uri
=
"https://git
lab.adullact.net
/pixelhumain/network.git"
network_dir
=
"network"
ctzntkt_uri
=
"https://git
hub.com
/pixelhumain/citizenToolkit.git"
ctzntkt_uri
=
"https://git
lab.adullact.net
/pixelhumain/citizenToolkit.git"
ctzntkt_dir
=
"citizenToolKit"
modules
=
"cmnctr ctzntkt co2 network api"
dda_uri
=
"https://gitlab.adullact.net/pixelhumain/dda.git"
dda_dir
=
"dda"
news_uri
=
"https://gitlab.adullact.net/pixelhumain/news.git"
news_dir
=
"news"
graph_uri
=
"https://gitlab.adullact.net/pixelhumain/graph.git"
graph_dir
=
"graph"
interop_uri
=
"https://gitlab.adullact.net/pixelhumain/interop.git"
interop_dir
=
"interop"
eco_uri
=
"https://gitlab.adullact.net/pixelhumain/eco.git"
eco_dir
=
"eco"
chat_uri
=
"https://gitlab.adullact.net/pixelhumain/chat.git"
chat_dir
=
"chat"
survey_uri
=
"https://gitlab.adullact.net/pixelhumain/survey.git"
survey_dir
=
"survey"
map_uri
=
"https://gitlab.adullact.net/pixelhumain/map.git"
map_dir
=
"map"
onepage_uri
=
"https://gitlab.adullact.net/pixelhumain/onepage.git"
onepage_dir
=
"onepage"
modules
=
"cmnctr ctzntkt co2 network api dda news interop graph eco chat survey map onepage"
# Update pixelhumain
echo
"Update modules..."
...
...
@@ -77,6 +97,46 @@ echo "Import cities data..."
mongoimport
--host
mongo
--db
pixelhumain
--collection
cities
"
${
MODULE_DIR
}
/
${
cmnctr_dir
}
/data/cities.json"
--jsonArray
fi
#Test zones.json
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
]
;
then
rm
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
fi
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json.zip"
]
;
then
unzip
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json.zip"
-d
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/"
#delete cities and delete all index cities
mongo mongo/pixelhumain
<<
EOF
db.zones.dropIndexes();
db.zones.remove({});
EOF
echo
"Import zones data..."
#import zones
mongoimport
--host
mongo
--db
pixelhumain
--collection
zones
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/zones.json"
--jsonArray
fi
#Test translate.json
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
]
;
then
rm
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
fi
if
[
-f
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json.zip"
]
;
then
unzip
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json.zip"
-d
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/"
#delete cities and delete all index cities
mongo mongo/pixelhumain
<<
EOF
db.translate.dropIndexes();
db.translate.remove({});
EOF
echo
"Import translate data..."
#import cities
mongoimport
--host
mongo
--db
pixelhumain
--collection
translate
"
${
MODULE_DIR
}
/
${
co2_dir
}
/data/translate.json"
--jsonArray
fi
#create index mongo bash script
if
[
-f
"
${
MODULE_DIR
}
/
${
cmnctr_dir
}
/data/createIndexMongoDocker.sh"
]
;
then
echo
"Create index mongo..."
;
...
...
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