Commit ec45b020 authored by TonyFord's avatar TonyFord
Browse files

deployment improvements

parent 7a330221
# Pull base image.
FROM ubuntu:18.04@sha256:5f4bdc3467537cbbe563e80db2c3ec95d548a9145d64453b06939c4592d67b6d
FROM ubuntu:18.04
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
......@@ -95,4 +95,11 @@ RUN mv ./faircoin-cli /home/faircoin/faircoin-cli
WORKDIR /home/faircoin
RUN git clone https://github.com/faircoin/electrumfair.git
USER root
WORKDIR /home/faircoin
COPY ./entrypoint.sh ./entrypoint.sh
RUN chown faircoin:faircoin ./entrypoint.sh
USER faircoin
WORKDIR /home/faircoin
ENTRYPOINT ["./entrypoint.sh"]
#!/usr/bin/env bash
# stop faircoind before container stops
stop_faircoind() {
./faircoin-cli stop > ./shutdown.log
./electrumfair/run_electrumfair daemon stop
}
trap 'stop_faircoind' SIGINT
trap 'stop_faircoind' SIGKILL
trap 'stop_faircoind' SIGTERM
if [ "${AUTOSTART}" == "1" ]
then
./faircoind -disablewallet -daemon
if [ ! -d ./electrumfair/packages ]; then ./electrumfair/contrib/make_packages; fi
rm ./electrumfair/electrumfair/servers.json
cp ./servers.json ./electrumfair/electrumfair/
./electrumfair/run_electrumfair daemon start
fi
while true; do :; done
#!/bin/bash
if [ ! -d ./electrumfair/packages ]; then ./electrumfair/contrib/make_packages; fi
rm ./electrumfair/electrumfair/servers.json
cp ./servers.json ./electrumfair/electrumfair/
./electrumfair/run_electrumfair daemon start
./faircoind -daemon
#!/bin/bash
./electrumfair/run_electrumfair daemon stop
./faircoin-cli stop
# Pull base image.
FROM php:7
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
#####################################################################################root##
### install nano commandline editor [optional] ( to edit faircoin.conf later if necessary )
RUN apt-get update -q && \
apt-get install -qy \
nano \
net-tools \
procps
#####################################################################################root##
### system cleanup ########################################################################
RUN rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean
#!/bin/bash
export RUNNER_UID=`id -u`
export RUNNER_GID=`id -g`
CI_PROJECT_NAME=${PWD##*/}
F=`ls -p ./env | grep -v /`
for f in $F
do
v=`echo -n ${!f}`
if [ "${!f}" != "" ]
then
echo "${f}=${!f}" > ./env/${f}
fi
done
if [[ -d "./env_file" ]]
then
F=`ls -p ./env_file | grep -v /`
for f in $F
do
echo ${f}=./env_file/${f} > ./env/${f}
done
fi
# link to gitlab-runner env files if exists ####
if [[ -d "../${CI_PROJECT_NAME}.tmp" ]]
then
F=`ls -p ../${CI_PROJECT_NAME}.tmp | grep -v /`
for f in $F
do
echo ${f}=${PWD}/../${CI_PROJECT_NAME}.tmp/${f} > ./env/${f}
done
fi
# export env vars
export `cat ./env/*`
# set executable to console and deployment commands
chmod +x console/electrumfairchainsx
chmod +x console/electrumx
chmod +x console/faircoin
chmod +x console/php-server
chmod +x console/help
chmod +x console/status
chmod +x console/ps
chmod +x console/create_wallet
chmod +x console/restore_wallet
chmod +x console/load_wallet
chmod +x console/close_wallet
chmod +x console/walletinfo
chmod +x deploy/help
chmod +x deploy/build
chmod +x deploy/start
chmod +x deploy/new_ssl
chmod +x deploy/stop
chmod +x deploy/install
chmod +x deploy/uninstall
chmod +x deploy/remove
#!/bin/bash
export RUNNER_UID=`id -u`
export RUNNER_GID=`id -g`
export LH_PORT_jsonrpc=4003
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