[add] deploy script
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
secrets/**
|
||||||
|
!secrets/settings_pattern.json
|
||||||
@@ -8,24 +8,30 @@ No clearnet for i2p, only yggdrasil!
|
|||||||
At startup, the script searches YGGDRASIL public peers and chooses several best of them.
|
At startup, the script searches YGGDRASIL public peers and chooses several best of them.
|
||||||
Then it generates YGGDRASIL *PublicKey* and *PrivateKey* unless the keys not set in environment variables.
|
Then it generates YGGDRASIL *PublicKey* and *PrivateKey* unless the keys not set in environment variables.
|
||||||
|
|
||||||
|
## Preparations
|
||||||
|
|
||||||
|
Before building and deploying i2pd_yggdrasil docker image, you need to run the script
|
||||||
|
|
||||||
|
> bash support/requirements.sh
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
You can build docker image by simply run script *make_i2pd_yggdrasil_docker_image.sh*.
|
You can build docker image by simply run script *make_i2pd_yggdrasil_docker_image.sh*.
|
||||||
|
|
||||||
> bash make_i2pd_yggdrasil_docker_image.sh
|
> bash support/make_docker_image.sh
|
||||||
|
|
||||||
Feel free to modify it with your own building arguments.
|
Feel free to modify it with your own building arguments.
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
To run docker container just run script *run_i2pd_yggdrasil_docker_image.sh*
|
To run docker container just use docker-compose like this
|
||||||
|
|
||||||
> bash run_i2pd_yggdrasil_docker_image.sh
|
> docker-compose -f src/docker-compose.yml up -d
|
||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
To deploy built image to your host just execute this from command line
|
To deploy built image to your host use script
|
||||||
|
|
||||||
> docker save i2pd_yggdrasil:latest | bzip2 | pv | ssh user@host docker load
|
> bash support/docker_deploy.sh
|
||||||
|
|
||||||
> scp run_i2pd_yggdrasil_docker_image.sh user@host:.
|
Note, this script takes parameters from *secrets/settings.json*, look *secrets/settings_pattern.json* for example.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"deploy" :
|
||||||
|
{
|
||||||
|
"host" : "0.0.0.0",
|
||||||
|
"user" : "root",
|
||||||
|
"path" : "/opt"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,4 +21,4 @@ services:
|
|||||||
- "10765:10765"
|
- "10765:10765"
|
||||||
- "10654:10654"
|
- "10654:10654"
|
||||||
- "9001:9001"
|
- "9001:9001"
|
||||||
|
restart: always
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "Deploy i2pd yggdrasil"
|
||||||
|
host=$(cat secrets/settings.json | jq -r .deploy.host)
|
||||||
|
user=$(cat secrets/settings.json | jq -r .deploy.user)
|
||||||
|
path=$(cat secrets/settings.json | jq -r .deploy.path)
|
||||||
|
echo " stop docker container"
|
||||||
|
ssh -l ${user} ${host} "cd ${path} ; docker-compose down"
|
||||||
|
echo " upload docker images"
|
||||||
|
ssh ${user}@${host} "mkdir -p ${path}"
|
||||||
|
docker save i2pd_yggdrasil:latest | bzip2 | pv | ssh ${user}@${host} docker load
|
||||||
|
echo " upload docker compose"
|
||||||
|
scp src/docker-compose.yml ${user}@${host}:${path}
|
||||||
|
echo " start docker container"
|
||||||
|
ssh -l ${user} ${host} "cd ${path} ; docker-compose up -d"
|
||||||
|
echo " all done"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
sudo apt install pv jq
|
||||||
Reference in New Issue
Block a user