Skip to content

Commit 8742d79

Browse files
Merge pull request #85 from delphi-hub/feature/deploy_script
Deployment script for Linux added
2 parents f74dc5d + 0d12887 commit 8742d79

File tree

2 files changed

+65
-5
lines changed

2 files changed

+65
-5
lines changed

Delphi_install.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
####DELPHI INSTALLATION#####
4+
#########################
5+
6+
LOGFILE=$HOME/`date "+%F_%T"`\_$SUDO_USER.log
7+
sudo touch $LOGFILE
8+
sudo chown $SUDO_USER $LOGFILE
9+
10+
echo " Starting installation of Delphi Application"
11+
echo " Logs can be found at: $LOGFILE"
12+
13+
14+
sudo -u $SUDO_USER bash -c "git clone --progress https://github.com/delphi-hub/delphi.git --recurse-submodules>> $LOGFILE"
15+
echo " **Cloning of Delphi Repositories completed**"
16+
17+
18+
#######Docker Setup######
19+
#########################
20+
# Testing purposes:
21+
# sudo apt-get purge docker-ce
22+
# sudo rm -rf /var/lib/docker
23+
# sudo rm -rf /etc/docker
24+
# sudo groupdel docker
25+
26+
27+
## Installing Images and Creating Volumes
28+
29+
echo " Building Delphi Images. This step might take several minutes"
30+
sudo -u $SUDO_USER bash -c "sbt docker:publishLocal &>> $LOGFILE"
31+
echo " Delphi-Registry Image built"
32+
sudo -u $SUDO_USER bash -c "(cd ./delphi/delphi-webapi;sbt docker:publishLocal) &>> $LOGFILE"
33+
echo " Delphi-WebApi Image built"
34+
sudo -u $SUDO_USER bash -c "(cd ./delphi/delphi-webapp;sbt docker:publishLocal) &>> $LOGFILE"
35+
echo " Delphi-WebApp Image built"
36+
sudo -u $SUDO_USER bash -c "(cd ./delphi/delphi-crawler;sbt docker:publishLocal) &>> $LOGFILE"
37+
echo " Delphi-Crawler Image built"
38+
sudo -u $SUDO_USER bash -c "(cd ./delphi/delphi-management;sbt docker:publishLocal) &>> $LOGFILE"
39+
echo " Delphi-Management Image built"
40+
bash -c "docker images >> $LOGFILE"
41+
42+
43+
echo " **Docker Images for all the components built successfully**"
44+
45+
46+
#########Finished########
47+
#########################
48+
49+
echo " For more information regarding the application, please have a look at the Readme file found at: https://github.com/delphi-hub/delphi-registry/blob/master/README.md"
50+
51+
52+

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,24 @@ The Delphi registry is a server that provides access to all information and oper
2020
## Requirements
2121
In order to compile or execute the instance registry, you must have the latest version of the *Scala Build Tool* (SBT) installed. You can get it [here](https://www.scala-sbt.org/).
2222

23-
The Delphi registry requires a docker host to deploy containers to. The following images must be registered at the docker registry:
23+
The Delphi registry requires a docker host to deploy containers. The following images must be registered at the docker registry:
2424
* The Delphi Crawler ( ```delphi-crawler:1.0.0-SNAPSHOT``` )
2525
* The Delphi WebApi ( ```delphi-webapi:1.0.0-SNAPSHOT``` )
2626
* The Delphi WebApp ( ```delphi-webapp:1.0.0-SNAPSHOT``` )
2727

28-
To obtain these images, checkout the respective repositories ([here](https://github.com/delphi-hub/delphi-crawler), [here](https://github.com/delphi-hub/delphi-webapi) and [here](https://github.com/delphi-hub/delphi-webapp)) and execute the command
28+
For Windows users, to obtain these images, checkout the respective repositories ([here](https://github.com/delphi-hub/delphi-crawler), [here](https://github.com/delphi-hub/delphi-webapi) and [here](https://github.com/delphi-hub/delphi-webapp)) and execute the command
2929

3030
```
3131
sbt docker:publishLocal
3232
```
33-
inside their root directory. This will build the docker images and register them directly at the local docker registry.
33+
inside their root directory. This will build the docker images and register them directly at the local docker registry. <br />
34+
35+
For Linux users, checkout Delphi Registry repository and execute the command
36+
37+
```
38+
sudo bash ./Delphi_install.sh
39+
```
40+
inside the registry's root directory. This installation script will create the required repositories, build the docker images, and register them directly at the local docker registry.
3441
The registry requires an initial instance of ElasticSearch to be running.
3542

3643
## Authorization
@@ -111,8 +118,8 @@ There are two ways of running the registry application. You can either run the a
111118
### Run the registry directly
112119
If you want to execute the registry directly on your local machine, simply go to the root folder of the repository and execute ```sbt run```. The application will stream all logging output to the terminal. You can terminate any time by pressing *RETURN*.
113120
### Run the registry in Docker
114-
For building a docker image containing the registry, go to the root folder of the repository and execute ```sbt docker:publishLocal```. This will build the application, create a docker image named ```delphi-registry:1.0.0-SNAPSHOT```, and register the image at your local docker registry.
115-
121+
For Windows users, to build a docker image containing the registry, go to the root folder of the repository and execute ```sbt docker:publishLocal```. This will build the application, create a docker image named ```delphi-registry:1.0.0-SNAPSHOT```, and register the image at your local docker registry.<br />
122+
For Linux users, the installation script mentioned in **Requirements** section will create docker image for registry named ```delphi-registry:1.0.0-SNAPSHOT```, and registers the image at your local docker registry.
116123

117124
## Contributing
118125

@@ -134,3 +141,4 @@ chat for a more interactive experience.
134141
The Delphi registry is open source and available under Apache 2 License.
135142

136143
[![GitHub license](https://img.shields.io/github/license/delphi-hub/delphi-registry.svg)](https://github.com/delphi-hub/delphi-registry/blob/master/LICENSE)
144+

0 commit comments

Comments
 (0)