mirror of
https://github.com/michelleDeko/scalelite-run.git
synced 2026-02-05 07:40:55 +01:00
Added auto-start
updated scalite-run.service fixed auto-deployer.service
This commit is contained in:
17
README.md
17
README.md
@@ -266,20 +266,29 @@ sudo .scripts/deploy.sh
|
|||||||
|
|
||||||
<a name="rolling-out-updates-automatic"/>
|
<a name="rolling-out-updates-automatic"/>
|
||||||
|
|
||||||
##### 4.2.2. Automatic updates and auto-start
|
##### 4.2.2. Automatic updates
|
||||||
|
|
||||||
Use the scripts provided.
|
Use the scripts provided.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo ln -s /home/ubuntu/scalelite-run/scripts/deploy.sh /usr/local/bin/scalelite-deploy
|
sudo ln -s <YOUR ROOT>/scalelite-run/scripts/deploy.sh /usr/local/bin/scalelite-deploy
|
||||||
sudo cp /home/ubuntu/scalelite-run/scripts/scalelite-auto-deployer.service /etc/systemd/system/scalelite-auto-deployer.service
|
sudo cp <YOUR ROOT>/scalelite-run/scripts/scalelite-auto-deployer.service /etc/systemd/system/scalelite-auto-deployer.service
|
||||||
sudo cp /home/ubuntu/scalelite-run/scripts/scalelite-auto-deployer.timer /etc/systemd/system/scalelite-auto-deployer.timer
|
sudo cp <YOUR ROOT>/scalelite-run/scripts/scalelite-auto-deployer.timer /etc/systemd/system/scalelite-auto-deployer.timer
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable scalelite-auto-deployer.service
|
sudo systemctl enable scalelite-auto-deployer.service
|
||||||
sudo systemctl enable scalelite-auto-deployer.timer
|
sudo systemctl enable scalelite-auto-deployer.timer
|
||||||
sudo systemctl start scalelite-auto-deployer.timer
|
sudo systemctl start scalelite-auto-deployer.timer
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<a name="starting-automatic"/>
|
||||||
|
|
||||||
|
##### 4.2.3. Automatic start
|
||||||
|
|
||||||
|
Use the scripts provided.
|
||||||
|
|
||||||
|
```
|
||||||
|
```
|
||||||
|
|
||||||
<a name="distributed-deployment"/>
|
<a name="distributed-deployment"/>
|
||||||
|
|
||||||
## II. Distributed Deployment
|
## II. Distributed Deployment
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
STATUS="Status: Downloaded newer image for blindsidenetwks/scalelite:latest"
|
STATUS="Status: Downloaded newer image for blindsidenetwks/scalelite:latest"
|
||||||
|
|
||||||
new_status=$(sudo docker pull blindsidenetwks/scalelite:latest | grep Status:)
|
new_status=$(sudo docker pull blindsidenetwks/scalelite:latest | grep Status:)
|
||||||
@@ -8,10 +9,10 @@ echo $new_status
|
|||||||
|
|
||||||
if [ "$STATUS" == "$new_status" ]
|
if [ "$STATUS" == "$new_status" ]
|
||||||
then
|
then
|
||||||
cd /home/ubuntu/scalelite-run
|
cd $DIR/..
|
||||||
sudo docker-compose down
|
docker-compose down
|
||||||
sudo docker rmi $(sudo docker images -f dangling=true -q)
|
docker rmi $(docker images -f dangling=true -q)
|
||||||
sudo docker-compose up -d
|
docker-compose up -d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
Description=ScaleLite Auto Deployer
|
Description=ScaleLite Auto Deployer
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/bin/bash /usr/local/bin/scalelite-deploy
|
ExecStart=/bin/bash /opt/scalelite-run/scripts/deploy.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
Alias=scalelite.service
|
Alias=scalelite-auto-deployer
|
||||||
|
|||||||
18
scripts/scalelite-run.service
Normal file
18
scripts/scalelite-run.service
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=ScaleLite Run
|
||||||
|
After=network.target
|
||||||
|
After=systemd-user-sessions.service
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/bash /opt/scalelite-run/scripts/start.sh
|
||||||
|
ExecStop=/bin/bash /opt/scalelite-run/scripts/stop.sh
|
||||||
|
TimeoutSec=30
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=30
|
||||||
|
StartLimitInterval=350
|
||||||
|
StartLimitBurst=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
Alias=scalelite-run
|
||||||
6
scripts/start.sh
Executable file
6
scripts/start.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
|
cd $DIR/..
|
||||||
|
docker-compose up -d
|
||||||
6
scripts/stop.sh
Executable file
6
scripts/stop.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
|
cd $DIR/..
|
||||||
|
docker-compose down
|
||||||
Reference in New Issue
Block a user