Commit 8b825300 authored by TonyFord's avatar TonyFord
Browse files

add deployment step init

parent a702fd99
stages:
- build
- init
- start
- create_wallet
- load_wallet
......@@ -17,7 +18,7 @@ build:
refs:
- master
variables:
- $CMD =~ /build/
- $CMD =~ /^build$/
before_script:
- export RUNNER_UID=`id -u`
- export RUNNER_GID=`id -g`
......@@ -31,6 +32,35 @@ build:
after_script:
- docker-compose down
init:
stage: init
tags:
- FairCoin.Co
only:
refs:
- master
variables:
- $CMD =~ /^build$|^init$/
before_script:
- export RUNNER_UID=`id -u`
- export RUNNER_GID=`id -g`
script:
- docker-compose exec -T faircoin ./stop_faircoin_services.sh && sleep 10
- docker-compose stop
- docker-compose up -d --remove-orphans faircoin
- docker-compose exec -T faircoin rm -f /home/faircoin/.faircoin2/faircoin.conf
- docker-compose exec -T faircoin cp /home/faircoin/_init/.faircoin2/faircoin.conf /home/faircoin/.faircoin2/
- docker-compose exec -T faircoin rm -f /home/faircoin/.faircoin2/fairchains.conf
- docker-compose exec -T faircoin cp /home/faircoin/_init/.faircoin2/fairchains.conf /home/faircoin/.faircoin2/
- docker-compose exec -T faircoin rm -f /home/faircoin/.faircoin2/FairCoinChain.electrumx.json
- docker-compose exec -T faircoin cp /home/faircoin/_init/.faircoin2/FairCoinChain.electrumx.json /home/faircoin/.faircoin2/
- docker-compose exec -T faircoin rm -f /home/faircoin/.faircoin2/FairCoinChain.json
- docker-compose exec -T faircoin cp /home/faircoin/_init/.faircoin2/FairCoinChain.json /home/faircoin/.faircoin2/
- docker-compose exec -T faircoin rm -f /home/faircoin/.electrumfair/config
- docker-compose exec -T faircoin cp /home/faircoin/_init/.electrumfair/config /home/faircoin/.electrumfair/
after_script:
- docker-compose down
start:
stage: start
tags:
......@@ -39,7 +69,7 @@ start:
refs:
- master
variables:
- $CMD =~ /^build$|^start$/
- $CMD =~ /^build$|^init$|^start$/
before_script:
- export RUNNER_UID=`id -u`
- export RUNNER_GID=`id -g`
......
......@@ -24,6 +24,7 @@ Enter variable name **CMD**
Container commands:
~~~
build
init # initialize configuration
start # start container ( changes of scripts )
stop # stop container
uninstall # remove container
......
......@@ -16,7 +16,7 @@ services:
faircoin:
build:
context: ./faircoin/faircoin
context: ./services/faircoin
args:
RUNNER_UID: ${RUNNER_UID:-1000}
RUNNER_GID: ${RUNNER_GID:-1000}
......@@ -25,12 +25,14 @@ services:
command: ./start_faircoin_services.sh
user: "${RUNNER_UID:-1000}:${RUNNER_GID:-1000}"
volumes:
- ./services/_init/.faircoin2:/home/faircoin/_init/.faircoin2
- ./services/_init/.electrumfair:/home/faircoin/_init/.electrumfair
- faircoin2:/home/faircoin/.faircoin2
- electrumfair:/home/faircoin/.electrumfair
electrumfairchainsx:
build:
context: ./faircoin/electrumfairchainsx
context: ./services/electrumfairchainsx
args:
RUNNER_UID: "${RUNNER_UID}"
RUNNER_GID: "${RUNNER_GID}"
......@@ -38,14 +40,12 @@ services:
- faircoin
container_name: faircoin-electrumfairchainsx
restart: always
command: ./efcx_server
command: sleep inf
user: "${RUNNER_UID:-1000}:${RUNNER_GID:-1000}"
volumes:
- ./services/_init/.faircoin2:/home/faircoin/_init/.faircoin2
- faircoin2:/home/faircoin/.faircoin2
- fairchains:/home/faircoin/.fairchains
volumes:
faircoin2:
fairchains:
electrumfair:
......@@ -46,14 +46,8 @@ RUN useradd --create-home --shell /bin/bash faircoin --uid $RUNNER_UID --gid $RU
RUN mkdir -p $FAIRCHAINS_PATH
RUN chown -R faircoin:faircoin $FAIRCHAINS_PATH
COPY .faircoin2/fairchains.conf ${FAIRCHAINS_PATH}fairchains.conf
RUN chown faircoin:faircoin ${FAIRCHAINS_PATH}fairchains.conf
COPY .faircoin2/FairCoinChain.electrumx.json ${FAIRCHAINS_PATH}FairCoinChain.electrumx.json
RUN chown faircoin:faircoin ${FAIRCHAINS_PATH}FairCoinChain.electrumx.json
COPY .faircoin2/FairCoinChain.json ${FAIRCHAINS_PATH}FairCoinChain.json
RUN chown faircoin:faircoin ${FAIRCHAINS_PATH}FairCoinChain.json
RUN mkdir -p /home/faircoin/_init/.faircoin2
RUN chown -R faircoin:faircoin /home/faircoin/_init/.faircoin2
USER faircoin
#################################################################################faircoin##
......
......@@ -49,16 +49,20 @@ ARG RUNNER_UID
RUN groupadd -g $RUNNER_GID faircoin
RUN useradd --create-home --shell /bin/bash faircoin --uid $RUNNER_UID --gid $RUNNER_GID
RUN mkdir -p /home/faircoin/.faircoin2
RUN chown -R faircoin:faircoin /home/faircoin/.faircoin2
RUN mkdir -p /home/faircoin/.electrumfair
RUN chown -R faircoin:faircoin /home/faircoin/.electrumfair
RUN mkdir -p /home/faircoin/.faircoin2
RUN mkdir -p /home/faircoin/_init/.faircoin2
RUN chown -R faircoin:faircoin /home/faircoin/_init/.faircoin2
COPY .faircoin2/faircoin.conf /home/faircoin/.faircoin2/faircoin.conf
RUN chown -R faircoin:faircoin /home/faircoin/.faircoin2
RUN mkdir -p /home/faircoin/_init/.electrumfairchainsx
RUN chown -R faircoin:faircoin /home/faircoin/_init/.electrumfair
COPY .electrumfair/config /home/faircoin/.electrumfair/config
RUN chown faircoin:faircoin /home/faircoin/.electrumfair/config
COPY ./servers.json /home/faircoin/servers.json
RUN chown faircoin:faircoin /home/faircoin/servers.json
COPY ./start_faircoin_services.sh /home/faircoin/start_faircoin_services.sh
RUN chown faircoin:faircoin /home/faircoin/start_faircoin_services.sh
......
#!/bin/bash
if [ ! -d ./electrumfair/packages ]; then ./electrumfair/contrib/make_packages; fi
rm ./electrumfair/electrumfair/servers.json
cp ./.electrumfair/servers.json ./electrumfair/electrumfair/
cp ./servers.json ./electrumfair/electrumfair/
./electrumfair/run_electrumfair daemon start
./faircoind
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment