Skip to content

Commit bf8a10f

Browse files
author
chencho
committed
Added two new scripts:
create-containers.sh - creates containers and images that can be launched with run-it reset-docerks.sh - removes all dockers containers and images Added support-scheduler to MODULES file Fixed minor bug in prepare-environment.sh Signed-off-by: chencho <[email protected]>
1 parent 308d2e2 commit bf8a10f

4 files changed

+85
-2
lines changed

MODULES

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
#
1717
# Author: chencho
1818

19-
export MODULES=(core-data-client core-domain core-exception core-test export-distro export-domain export-test support-domain support-logging-client export-client support-notifications-client core-data core-metadata-client )
19+
export MODULES=(core-data-client core-domain core-exception core-test export-distro export-domain export-test support-domain support-logging-client export-client support-notifications-client core-data core-metadata-client support-scheduler)
2020

create-containers.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 Cavium Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Author: chencho
18+
19+
set -e
20+
21+
DOCKERS=( docker-edgex-volume docker-core-consul docker-core-config-seed docker-edgex-mongo support-logging \
22+
support-notifications core-metadata core-data core-command support-scheduler export-client \
23+
export-distro support-rulesengine device-virtual )
24+
25+
26+
for m in ${DOCKERS[@]} ; do
27+
if [ -d $m ]; then
28+
echo "Updating git modules... "
29+
cd $m
30+
git pull
31+
cd ..
32+
else
33+
echo "Cloning $m"
34+
git clone https://github.com/edgexfoundry/$m
35+
fi
36+
if [ -f $m/docker-files/Dockerfile.aarch64 ] ; then
37+
echo "Creating docker image $m"
38+
cd $m
39+
docker build . -t edgexfoundry/docker-$m -f docker-files/Dockerfile.aarch64
40+
echo $m
41+
cd ..
42+
43+
elif [ -f $m/Dockerfile.aarch64 ] ; then
44+
echo "Creating docker image $m"
45+
cd $m
46+
docker build . -t edgexfoundry/$m -f Dockerfile.aarch64
47+
echo $m
48+
cd ..
49+
fi
50+
done
51+
52+
53+
echo "Done!"
54+

prepare-environment.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ echo "Done!"
7474

7575

7676
if [ $# -eq 0 ]; then
77-
source MODULES
77+
. ./MODULES
7878
start
7979
else
8080
installAllModules $@

reset-dockers.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 Cavium Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Author: chencho
18+
19+
# Down images in docker-compose
20+
docker-compose down
21+
22+
# Delete all containers
23+
if [[ $(docker ps -a -q) ]]; then
24+
docker rm $(docker ps -a -q)
25+
fi
26+
# Delete all images
27+
if [[ $(docker images -q) ]]; then
28+
docker rmi -f $(docker images -q)
29+
fi

0 commit comments

Comments
 (0)