Skip to content

Commit

Permalink
updating iofog-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
baghbidi committed Nov 21, 2018
1 parent 1217a9c commit ffa5ca7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Expand Up @@ -15,6 +15,8 @@ services:
links:
- iofog-connector
container_name: iofog-controller
environment:
- NODE_ENV=development
network_mode: bridge
iofog-agent:
build: ./iofog-agent
Expand Down
2 changes: 1 addition & 1 deletion iofog-agent/Dockerfile
Expand Up @@ -11,7 +11,7 @@ RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true
RUN apt-get install -y oracle-java8-installer
RUN apt-get update -qq
RUN curl -s https://packagecloud.io/install/repositories/iofog/iofog-agent/script.deb.sh | sudo bash
RUN sudo apt-get install iofog-agent=1.0.0
RUN sudo apt-get install iofog-agent
RUN touch /first_run.tmp

COPY start.sh /start.sh
Expand Down
6 changes: 4 additions & 2 deletions iofog-agent/start.sh
Expand Up @@ -34,12 +34,14 @@ if [ -f /first_run.tmp ]; then
done

uuid=""
echo "Waiting for ioFog Controller..."
while true; do
item=$(curl --request POST \
item=$(curl --request GET \
--url $CONTROLLER_HOST/iofog-list \
--header "Authorization: $token" \
--header 'Content-Type: application/json')
uuid=$(echo $item | jq -r '.[] | select(.name == "ioFog Node") | .uuid')
echo $item
uuid=$(echo $item | jq -r '.fogs[] | select(.name == "ioFog Node") | .uuid')

if [ ! -z "$uuid" ]; then
break
Expand Down
2 changes: 1 addition & 1 deletion iofog-connector/Dockerfile
Expand Up @@ -10,7 +10,7 @@ RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true
RUN apt-get install -y oracle-java8-installer
RUN apt-get update -qq
RUN curl -s https://packagecloud.io/install/repositories/iofog/iofog-connector/script.deb.sh | sudo bash
RUN sudo apt-get install iofog-connector=1.0.0
RUN sudo apt-get install iofog-connector
RUN touch /first_run.tmp

COPY . /
Expand Down
4 changes: 1 addition & 3 deletions iofog-controller/Dockerfile
@@ -1,9 +1,7 @@
FROM node:alpine

RUN apk add curl jq python bash
RUN npm i -g iofogcontroller@0.9.5 --unsafe-perm
RUN cd /usr/local/lib/node_modules/iofogcontroller && \
sh ./src/sequelize/rebuild_dev_db.sh
RUN npm i -g iofogcontroller --unsafe-perm

RUN touch /first_run.tmp

Expand Down
6 changes: 5 additions & 1 deletion iofog-controller/start.sh
@@ -1,10 +1,14 @@
#!/usr/bin/env sh

cd /src
export NODE_ENV=development

CONTROLLER_HOST="http://localhost:51121/api/v3"

cd /usr/local/lib/node_modules/iofogcontroller/src/sequelize
if [ ! -f ./dev_database.sqlite ]; then
sh ./rebuild_dev_db.sh
fi

iofog-controller start
if [ -f /first_run.tmp ]; then
iofog-controller user add -f John -l Doe -e user@domain.com -p "#Bugs4Fun"
Expand Down

0 comments on commit ffa5ca7

Please sign in to comment.