From 71af7a68b3e5b42556b6d2468b72c2be4a3d0a8c Mon Sep 17 00:00:00 2001 From: Andrey Beletsky Date: Tue, 26 Mar 2019 00:04:31 +0700 Subject: [PATCH] Improve build config file and publishing script --- Dockerfile | 4 ++-- Makefile | 13 +++++++++---- conf/daemon_settings.yml | 1 + scripts/get_release.sh | 2 +- scripts/publish.sh | 7 ++++--- start.sh | 5 +++++ 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d20e005..cc1a5eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 EXPOSE 5279 VOLUME /storage -RUN apt-get update && apt-get -y install unzip ca-certificates +RUN apt-get update && apt-get -y install ca-certificates RUN mkdir /daemon WORKDIR /daemon COPY lbrynet ./ @@ -10,7 +10,7 @@ COPY conf/test_daemon_settings.yml ./ ENV LBRY_DATA_DIR /storage/data ENV LBRY_LBRYUM_WALLET_DIR /storage/lbryum ENV LBRY_DOWNLOAD_DIRECTORY /storage/download -ENV LBRY_API_HOST 0.0.0.0 +ENV LBRY_API 0.0.0.0:5279 COPY start.sh ./start.sh RUN chmod a+x start.sh CMD ["./start.sh"] diff --git a/Makefile b/Makefile index 33d0194..6b5995a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,15 @@ -.PHONY: get_release +all: + make get_release + make image + make publish + make clean + get_release: scripts/get_release.sh -.PHONY: build -build: - docker build -t sayplastic/lbrynet:$(VERSION) . +.PHONY: image +image: + docker build -t lbryweb/lbrynet:$(VERSION) -t lbryweb/lbrynet:latest . .PHONY: publish publish: diff --git a/conf/daemon_settings.yml b/conf/daemon_settings.yml index e5c0753..40fa368 100644 --- a/conf/daemon_settings.yml +++ b/conf/daemon_settings.yml @@ -1 +1,2 @@ use_upnp: False +delete_blobs_on_remove: True diff --git a/scripts/get_release.sh b/scripts/get_release.sh index d9ef78b..0e2ce24 100755 --- a/scripts/get_release.sh +++ b/scripts/get_release.sh @@ -8,6 +8,6 @@ URL=$( ) echo "Getting the latest release from $URL..." -curl -sOL $URL +curl -OL $URL unzip lbrynet-linux.zip rm lbrynet-linux.zip diff --git a/scripts/publish.sh b/scripts/publish.sh index fe672de..2500bac 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -4,10 +4,10 @@ set +x set -e WAIT=5 -BASE_IMAGE_NAME=sayplastic/lbrynet +BASE_IMAGE_NAME=lbryweb/lbrynet if [ -z ${VERSION+x} ]; then - echo "Please provide sayplastic/lbrynet version as \$VERSION variable." + echo "Please provide ${BASE_IMAGE_NAME} version as \$VERSION variable." exit 1 fi @@ -25,4 +25,5 @@ echo "Container launched successfully, stopping it" docker kill $ID echo "Pushing to Docker Hub..." -docker push sayplastic/lbrynet:$VERSION +docker push lbryweb/lbrynet:$VERSION +docker push lbryweb/lbrynet:latest diff --git a/start.sh b/start.sh index 2271bc7..76162c1 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,10 @@ #!/bin/sh +set -o xtrace + +if [ ! -d "$LBRY_DATA_DIR" ]; then + mkdir $LBRY_DATA_DIR +fi if [ ! -d "$LBRY_LBRYUM_WALLET_DIR" ]; then mkdir $LBRY_LBRYUM_WALLET_DIR fi