Skip to content

Commit

Permalink
Use branching strategy instead of tags when deploy new core
Browse files Browse the repository at this point in the history
  • Loading branch information
mudlee committed Nov 23, 2020
1 parent f3c7155 commit 0a6b37b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ The end result is that your node will start syncing from 0.

### 2.6.31+p3

- Upgraded to 4.0.1 SSI (project Morpheus, previously called DAC)
- Added 1.0.0 DNS (project Coeus)
- Upgraded to 4.0.4 SSI (project Morpheus, previously called DAC)
- Added DNS (project Coeus)

### 2.6.31+p2

Expand Down
7 changes: 3 additions & 4 deletions ccontrol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,21 @@ main () {
cd $core > /dev/null 2>&1
git_check_core

local hydra_plugin_installed="$(cat $config/plugins.js | grep hydra-plugin)"
local hydra_plugin_installed="$(cat $config/plugins.js | grep '@internet-of-people/hydra-plugin')"

if [ ! -f "$config/app.js" ]; then
cp $core/packages/core/bin/config/$network/app.js $config/app.js
fi

local hydra_appjs_installed="$(cat $config/app.js | grep hydra-plugin)"
local hydra_appjs_installed="$(cat $config/app.js | grep '@internet-of-people/hydra-plugin')"

if [ "$up2date" = "yes" ] && [ ! -z "$hydra_plugin_installed" ] && [ ! -z "$hydra_appjs_installed" ]; then
echo -e "Already up-to-date."
exit 1
fi

git checkout .
git fetch --tags 2>&1
git checkout $network 2>&1
git checkout $branch 2>&1

if [ "$?" != "0" ]; then
rm yarn.lock > /dev/null 2>&1
Expand Down
8 changes: 3 additions & 5 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ pm2status () {
git_check_core () {

git fetch > /dev/null 2>&1
git tag -d $network
git fetch --tags > /dev/null 2>&1
loc=$(git rev-parse --short @)
rem=$(git rev-parse --short $network)
rem=$(git rev-parse --short origin/$branch)

if [ "$loc" = "$rem" ]; then
up2date="yes"
Expand All @@ -52,7 +50,7 @@ git_check () {

git fetch > /dev/null 2>&1
loc=$(git rev-parse --short @)
rem=$(git rev-parse --short @{u})
rem=$(git rev-parse --short origin/$branch)

if [ "$loc" = "$rem" ]; then
up2date="yes"
Expand Down Expand Up @@ -303,7 +301,7 @@ install_db () {

install_core () {

git clone $repo $core -b $network > /dev/null 2>&1
git clone $repo $core -b $branch > /dev/null 2>&1

if [ -d $HOME/.config ]; then
sudo chown -R $USER:$USER $HOME/.config > /dev/null 2>&1
Expand Down
2 changes: 2 additions & 0 deletions project.conf.devnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
#Network name
network="devnet"

branch="develop"

#P2P port
p2p_port="4702"
2 changes: 2 additions & 0 deletions project.conf.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
#Network name
network="mainnet"

branch="master"

#P2P port
p2p_port="4701"

0 comments on commit 0a6b37b

Please sign in to comment.