Installer for Linux

You can also use the IONDV. Framework application installer for Linux, which requires node, mongodb and git installed. During the installation all other dependencies will be checked or installed, and the application itself will be built and launched.

Install in one command:

bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) -t git -q -i -m localhost:27017 app

Where the parameters for iondv-app localhost:27017``is MongoDB address and ``app is the name of the application. After launch open the link http://localhost:8888, back office account demo, password ion-demo.

The other way is to clone git clone https://github.com/iondv/iondv-app.git and install the application using the command bash iondv-app -m localhost:27017 app, where app is the name of the application.

You can also build the application in the docker-containers. In that case you only need the docker and the mongodb DBMS in the docker-container.

Environment requirements

The MongoDB DBMS should be running for the system to work. You can launch it in the docker-container using the command:

docker run --name mongodb -v mongodb_data:/data/db -p 27017:27017 -d mongo

System preparation is described below.

Install, build and run the application using a single command in the docker-container

The examples below assume that the DBMS is running in the container named mongodb.

Taking the simple application Nutrition-Tickets as an example. The command downloads the installer from the github repositor, which builds and runs the appliction in the docker-container in the current repository.

  • from the git repository

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) \   -t docker -q -i -l mongodb nutrition-tickets
    
  • from the zip archive file, for example, downloaded from github curl -L https://github.com/iondv/nutrition-tickets/archive/master.zip > ./nutrition-tickets.zip or created in the IONDV. Studio. Note, that you need to specify the module for data display in the``package.json``file of the created application in the attribute "ionModulesDependencies", usually it’s "registry".

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) \   -t docker -q -i -l mongodb ./nutrition-tickets.zip
    
  • from the folder, while the original application folder is not modified. Note, that the name of the folder must match the namespace of the application (if the folder is unzipped from the github archive, the branch code is usually added in the name, so you need to rename it)

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) \   -t docker -q -i -l mongodb ./nutrition-tickets
    

The default address of the built application is http://localhost:8888, login demo, password ion-demo.

Install, build and run the application on your local file system

The examples below assume that the DBMS is running locally and is available at localhost:27017.

Installation on the local file system allows to get the application, which is ready to be modified and refined by a developper tools, such as IDE, just open the application folder. The folder of the application is created in the launch folder or in the folder specified by the ``-p``parameter

  • from the git repository in the folder /workspace

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app)  -t git -p /workspace -m localhost:27017 https://github.com/iondv/nutrition-tickets.git
    
  • from the zip archive in the current folder, for example, downloaded from github curl -L https://github.com/iondv/nutrition-tickets/archive/master.zip > ./nutrition-tickets.zip or created in the IONDV. Studio. Note, that you need to specify the module for data display in the attribute "ionModulesDependencies" of the package.json file of the created app , it’s usually "registry" module

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) \ -t git -p /workspace -m localhost:27017 ./nutrition-tickets.zip
    
  • from the folder, while the original application folder is not modified. Note, that the name of the folder must match the namespace of the application (if the folder is unzipped from the github archive, the branch code is usually added in the name, so you need to rename it)

    bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app)    -t git -q -i -m localhost:27017 ./nutrition-tickets
    

Launch parameters

iondv-app [OPTION]... IONDV_APP_NAME|IONDV_APP_NAME@VERSION|GIT_URL|IONDV_APP_ZIP|IONDV_APP_PATH

Parameters Type of the application build
-t [value] git: cloning the repositories to the file system (git installed required) docker: building in docker-containers, no environment is required on the computer
-c [value] launch application as a cluster with the amount of installations [value]
-m [value] uri for mongodb, examples: mongodb:27017. localhost:27017 by default (when building in docker you’ll get the error of connecting to the DB(!). For docker use the parameter -l, or specify the external DBMS address
-r check and remove the folder with the application name in the build directory
-i data import when initializing the application
-a roles and user accounts import when initializing the application
-y setting all values to default (yes to all)
-q silent mode. Only basic information, warnings, and errors are displayed
-l [value] the name of the MongoDB container for linking to the built container (docker build type or the parameter -d when building with git), also forms the configuration with the value of mongo uri as [value]:27017
-p [value] path to the directory where the application name folder will be created and application build will be held
-s [value] the full path to the script that runs in the application folder after the build, but before the application is deployed. Can be used for additional processing of application files
-n [value] the parameter defining the launch, changing the application namespace to a new one, before the deployment
-h skipping switching to application dependency versions, installing the latest versions
-x exit without launching the application
Parameters fo the git method:  
-d prepare a docker container based on the compiled version. Also stop and delete a container, an image with that name
-k skip the environment check
Parameters for docker build method: save temporary versions of containers, it allows you to speed up subsequent builds. But caching is skipped if the ignore dependency versions flag is set
-v prepare a docker container based on the compiled version. Also stop and delete a container, an image with that name
Environment variables:  
IONDVUrlGitFramework URL of the framework repository, by default https://github.com/iondv/framework.git You can set the login and the password to your version in the private repository. For example: https://login:password@git.company-name.com/iondv/framework.git
IONDVUrlGitModules URL to modules, by default https://github.com/iondv
IONDVUrlGitApp URL to applications, is used if only the name of the application is specified for the building, by default https://github.com/iondv
IONDVUrlGitExtApp URL to extension applications, by default https://github.com/iondv

Preparing the environment

Installation of docker

It is recommended not to do it under root

  • Installing the latest version of docker for CentOS:

1. Обновляем систему sudo yum update

2. Устанавливаем необходимые библиотеки yum install -y yum-utils device-mapper-persistent-data lvm2

3. Регистрируем репозиторий yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

4. Установка последней версии yum -y install docker-ce docker-ce-cli containerd.io

5. Запускаем докер systemctl start docker

6. Для автоматического запуска докера systemctl enable docker

  • Install the latest docker version for Ubuntu:
  1. Add GDP key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  2. Check the key apt-key fingerprint 0EBFCD88

  3. Add the repository

    sudo add-apt-repository \   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"
    
  4. Update the repositories sudo apt-get update

  5. Install the latest version sudo apt-get install docker-ce docker-ce-cli containerd.io

Add the current user to the docker group:

sudo groupadd docker   sudo usermod -aG docker $USER

You can check docker run hello-world

Lunch Mongo in docker

Launch with mapping to the local port:

docker run --name mongodb -v mongodb_data:/data/db -p 27017:27017 -d mongo

Install node

To speed up the build, it’s recommended to download docker-image node:10 in advance, since it takes 900Mb.

docker pull node:10

Check it using the command docker images | grep node, the list of node local images will be displayed.