enable Jenkins
This commit is contained in:
16
Jenkinsfile
vendored
Normal file
16
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'contrib/docker/moreBuilder/Dockerfile.ubase'
|
||||
}
|
||||
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'blackmored -daemon'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
65
contrib/docker/moreBuilder/Dockerfile.ubase
Executable file
65
contrib/docker/moreBuilder/Dockerfile.ubase
Executable file
@@ -0,0 +1,65 @@
|
||||
FROM ubuntu
|
||||
ENV BRANCH=master
|
||||
ENV TZ=America/Los_Angeles
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && apt-get install -yqq \
|
||||
git \
|
||||
make \
|
||||
file \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
libevent-dev \
|
||||
build-essential \
|
||||
autotools-dev \
|
||||
pkg-config \
|
||||
bsdmainutils \
|
||||
python3 \
|
||||
libevent-dev \
|
||||
libboost-all-dev \
|
||||
libminiupnpc-dev \
|
||||
libzmq3-dev \
|
||||
libssl-dev \
|
||||
gperf \
|
||||
wget \
|
||||
jq \
|
||||
bc
|
||||
|
||||
#
|
||||
# Build Blackcoin More
|
||||
#
|
||||
|
||||
RUN git clone -b $BRANCH https://github.com/CoinBlack/blackcoin-more.git
|
||||
RUN (wget http://distfiles.gentoo.org/distfiles/db-6.2.38.tar.gz && \
|
||||
tar -xvf db-6.2.38.tar.gz && \
|
||||
cd db-6.2.38/build_unix && \
|
||||
mkdir -p build && \
|
||||
BDB_PREFIX=$(pwd)/build && \
|
||||
../dist/configure --disable-shared -disable-replication --enable-cxx --with-pic --prefix=$BDB_PREFIX --with-gui=no --enable-glibc-back-compat --enable-reduce-exports --disable-tests --disable-bench --disable-gui-tests --disable-man && \
|
||||
make install && \
|
||||
cd ../.. && \
|
||||
cd blackcoin-more/ && ./autogen.sh && \
|
||||
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --disable-tests --disable-bench --enable-reduce-exports && \
|
||||
make -j4 && \
|
||||
cd src/ && \
|
||||
strip blackmore*)
|
||||
|
||||
#
|
||||
# Prepare for minimal package
|
||||
#
|
||||
|
||||
RUN cp /blackcoin-more/src/blackmored /usr/local/bin/ && \
|
||||
cp /blackcoin-more/src/blackmore-cli /usr/local/bin/ && \
|
||||
cp /blackcoin-more/contrib/blk /usr/local/bin/
|
||||
|
||||
WORKDIR /parts
|
||||
|
||||
RUN cp --parents /usr/local/bin/blk ./ && \
|
||||
cp --parents /usr/local/bin/blackmored ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmored | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp --parents /usr/local/bin/blackmore-cli ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmore-cli | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp /usr/bin/bc --parents ./ && \
|
||||
for i in `ldd /usr/bin/bc | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp /usr/bin/jq --parents ./ && \
|
||||
for i in `ldd /usr/bin/jq | grep -v linux-vdso.so.1 | grep -v libjq.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done
|
||||
32
contrib/docker/moreBuilder/Dockerfile.ubuntu
Executable file
32
contrib/docker/moreBuilder/Dockerfile.ubuntu
Executable file
@@ -0,0 +1,32 @@
|
||||
FROM blackcoinnl/blackmore-ubase-x86_64:master as build
|
||||
|
||||
RUN echo "Building Ubuntu Package"
|
||||
|
||||
#
|
||||
# Collect dependencies
|
||||
#
|
||||
|
||||
FROM ubuntu
|
||||
ENV TZ=America/Los_Angeles
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && \
|
||||
apt-get -yqq upgrade && \
|
||||
apt-get -yqq install \
|
||||
libboost-all-dev \
|
||||
libzmq3-dev \
|
||||
libminiupnpc-dev
|
||||
|
||||
#
|
||||
# Copy the binaries from the build to our new container
|
||||
#
|
||||
COPY --from=build /blackcoin-more/src/blackmored /usr/local/bin
|
||||
COPY --from=build /blackcoin-more/src/blackmore-cli /usr/local/bin
|
||||
COPY --from=build /usr/bin/bc /usr/bin
|
||||
COPY --from=build /usr/bin/jq /usr/bin
|
||||
|
||||
|
||||
#
|
||||
# Expose the port for the RPC interface
|
||||
#
|
||||
|
||||
EXPOSE 15714/tcp
|
||||
10
contrib/docker/moreBuilder/README.md
Executable file
10
contrib/docker/moreBuilder/README.md
Executable file
@@ -0,0 +1,10 @@
|
||||
## To Build
|
||||
|
||||
#### Log in to [Docker Hub](https://hub.docker.com).
|
||||
|
||||
`docker login`
|
||||
|
||||
#### Build
|
||||
|
||||
`moreBuilder/build.sh`
|
||||
|
||||
91
contrib/docker/moreBuilder/build.sh
Executable file
91
contrib/docker/moreBuilder/build.sh
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE_DIR=$(dirname $(realpath $0 ))
|
||||
moreBuilder=${BASE_DIR}/moreBuilder
|
||||
SYSTYPE=`lscpu | head -1 | tr -s ' ' | cut -d ' ' -f2`
|
||||
|
||||
# DockerHub Account
|
||||
|
||||
defaultDockerHub=blackcoinnl
|
||||
read -p "What is your DockerHub Account Name? (default $defaultDockerHub): " DockerHub
|
||||
DockerHub=${DockerHub:-${defaultDockerHub}}
|
||||
if [ $DockerHub != $defaultDockerHub ]; then
|
||||
sed -i "s/defaultDockerHub=blackcoinnl/defaultDockerHub=$DockerHub/" $0
|
||||
fi
|
||||
|
||||
# Git Account
|
||||
|
||||
defaultHubLab=github
|
||||
read -p "Github or Gitlab? (default $defaultHubLab): " HubLab
|
||||
HubLab=${HubLab:-${defaultHubLab}}
|
||||
if [ $HubLab != $defaultHubLab ]; then
|
||||
sed -i "s|defaultHubLab=github|defaultGit=$HubLab|" $0
|
||||
sed -i "s|github|$HubLab|" ${BASE_DIR}/Dockerfile.ubase
|
||||
fi
|
||||
|
||||
defaultGit=CoinBlack
|
||||
read -p "What is your Git account? (default $defaultGit): " Git
|
||||
Git=${Git:-${defaultGit}}
|
||||
if [ $Git != $defaultGit ]; then
|
||||
sed -i "s|defaultGit=CoinBlack|defaultGit=$Git|" $0
|
||||
sed -i "s|CoinBlack|$Git|" ${BASE_DIR}/Dockerfile.ubase
|
||||
fi
|
||||
|
||||
# Git Branch
|
||||
|
||||
read -p "What branch/version? (default $defaultBranch): " BRANCH
|
||||
defaultBranch=master
|
||||
BRANCH=${BRANCH:-${defaultBranch}}
|
||||
if [ $BRANCH != $defaultBranch ]; then
|
||||
sed -i "s|defaultBranch=master|defaultBranch=$BRANCH|" $0
|
||||
sed -i "s|ENV BRANCH=v2.13.2.7|ENV BRANCH=$BRANCH|" ${BASE_DIR}/Dockerfile.ubase
|
||||
fi
|
||||
|
||||
# change branch for multi-stage build
|
||||
defaultUbase=blackcoinnl/blackmore-ubase-x86_64:master
|
||||
ubase="${DockerHub}/blackmore-ubase-$SYSTYPE:$BRANCH"
|
||||
if [ $defaultUbase != $ubase ]; then
|
||||
sed -i "s|FROM $defaultUbase as build|FROM $ubase as build|" ${BASE_DIR}/Dockerfile.ubuntu
|
||||
sed -i "s|defaultUbase=blackcoinnl/blackmore-ubase-x86_64:master|defaultUbase=$ubase|" $0
|
||||
fi
|
||||
|
||||
# timezone
|
||||
defaultTimezone=America/Los_Angeles
|
||||
read -p "What is your timezone? (default $defaultTimezone): " timezone
|
||||
timezone=${timezone:-${defaultTimezone}}
|
||||
if [ $timezone != $defaultTimezone ]; then
|
||||
sed -i "s|defaultTimezone=America/Los_Angeles|defaultTimezone=$timezone|" $0
|
||||
sed -i "s|defaultTimezone=America/Los_Angeles|$timezone|" ${BASE_DIR}/Dockerfile.ubase
|
||||
sed -i "s|defaultTimezone=America/Los_Angeles|$timezone|" ${BASE_DIR}/Dockerfile.ubuntu
|
||||
fi
|
||||
|
||||
|
||||
echo "DockerHub Account: ${DockerHub}"
|
||||
echo "Git Account: $Git"
|
||||
echo $BRANCH
|
||||
echo $SYSTYPE
|
||||
echo $timezone
|
||||
|
||||
|
||||
|
||||
|
||||
minimal="${DockerHub}/blackcoin-more-minimal-$SYSTYPE:$BRANCH"
|
||||
ubuntu="${DockerHub}/blackcoin-more-ubuntu-$SYSTYPE:$BRANCH"
|
||||
ubase="${DockerHub}/blackmore-ubase-$SYSTYPE:$BRANCH"
|
||||
|
||||
# build
|
||||
|
||||
docker build -t $ubase - --network=host < ${BASE_DIR}/Dockerfile.ubase
|
||||
|
||||
docker run -itd --network=host --name ubase $ubase bash
|
||||
|
||||
docker cp ubase:/parts $moreBuilder
|
||||
cd $moreBuilder
|
||||
tar -C parts -c . | docker import - $minimal
|
||||
|
||||
docker container rm -f ubase
|
||||
|
||||
# push to docker hub
|
||||
|
||||
docker image push $minimal
|
||||
docker image push $ubuntu
|
||||
@@ -1,22 +0,0 @@
|
||||
[Unit]
|
||||
Description=Bitcoin's distributed currency daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
||||
Type=forking
|
||||
PIDFile=/var/lib/bitcoind/bitcoind.pid
|
||||
ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \
|
||||
-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet
|
||||
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStartSec=2s
|
||||
StartLimitInterval=120s
|
||||
StartLimitBurst=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
31
contrib/init/blackmored.service
Normal file
31
contrib/init/blackmored.service
Normal file
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=Blackmore daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=export MALLOC_ARENA_MAX=1 && /usr/local/bin/blackmored -daemon -conf=/var/lib/.blackmore/blackmore.conf -datadir=/var/lib/.blackmore
|
||||
>>>>>>> 5fbf64be585767e86ad48dbd1dfb02141a8f23ab
|
||||
ExecStop=/usr/local/bin/blackmored stop
|
||||
User=blackmore
|
||||
Group=blackmore
|
||||
Restart=on-failure
|
||||
|
||||
# Because it's a daemon process
|
||||
Type=forking
|
||||
|
||||
PIDFile=/var/lib/.bitmored/blackmored.pid
|
||||
|
||||
ProtectHome=true
|
||||
ProtectSystem=full
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
MemoryDenyWriteExecute=true
|
||||
NoNewPrivileges=true
|
||||
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStartSec=2s
|
||||
StartLimitInterval=120s
|
||||
StartLimitBurst=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user