build: relocate *net deployment logic to their own directories

This commit is contained in:
Kittywhiskers Van Gogh 2021-12-21 12:40:24 +05:30
parent 06b595b6ee
commit 1c188bcd47
9 changed files with 34 additions and 29 deletions

View File

@ -52,7 +52,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ./docker
file: ./docker/Dockerfile.GitHubActions
file: ./contrib/containers/deploy/Dockerfile.GitHubActions
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

View File

@ -52,7 +52,7 @@ builddocker: &builddocker
stage: build docker
script:
# no need to run tests again here
- if [ "$DOCKER_BUILD" = "true" ]; then $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh && $DOCKER_RUN_IN_BUILDER ./ci/dash/build_src.sh && BUILD_DIR=build-ci/dashcore-$BUILD_TARGET ./docker/build-docker.sh; fi
- if [ "$DOCKER_BUILD" = "true" ]; then $DOCKER_RUN_IN_BUILDER ./ci/dash/build_depends.sh && $DOCKER_RUN_IN_BUILDER ./ci/dash/build_src.sh && BUILD_DIR=build-ci/dashcore-$BUILD_TARGET ./ci/dash/build-docker.sh; fi
- MAKEJOBS=-j3
- RUN_UNIT_TESTS=true
@ -190,7 +190,7 @@ after_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
after_success:
- if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./docker/push-docker.sh; fi
- if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./ci/dash/push-docker.sh; fi
- stage: lint
name: 'lint'
env:

27
ci/dash/build-docker.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
export LC_ALL=C
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"/../.. || exit
DOCKER_IMAGE=${DOCKER_IMAGE:-dashpay/dashd-develop}
DOCKER_TAG=${DOCKER_TAG:-latest}
DOCKER_RELATIVE_PATH=contrib/containers/deploy
BUILD_DIR=${BUILD_DIR:-.}
if [ -d $DOCKER_RELATIVE_PATH/bin ]; then
rm $DOCKER_RELATIVE_PATH/bin/*
fi
mkdir $DOCKER_RELATIVE_PATH/bin
cp "$BUILD_DIR"/src/dashd $DOCKER_RELATIVE_PATH/bin/
cp "$BUILD_DIR"/src/dash-cli $DOCKER_RELATIVE_PATH/bin/
cp "$BUILD_DIR"/src/dash-tx $DOCKER_RELATIVE_PATH/bin/
strip $DOCKER_RELATIVE_PATH/bin/dashd
strip $DOCKER_RELATIVE_PATH/bin/dash-cli
strip $DOCKER_RELATIVE_PATH/bin/dash-tx
docker build --pull -t "$DOCKER_IMAGE":"$DOCKER_TAG" -f $DOCKER_RELATIVE_PATH/Dockerfile docker

View File

@ -3,7 +3,7 @@
export LC_ALL=C
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. || exit
cd "$DIR"/../.. || exit
DOCKER_IMAGE=${DOCKER_IMAGE:-dashpay/dashd-develop}
DOCKER_TAG=${DOCKER_TAG:-latest}
@ -14,6 +14,6 @@ else
DOCKER_IMAGE_WITH_REPO=$DOCKER_IMAGE
fi
docker tag $DOCKER_IMAGE:$DOCKER_TAG $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG
docker push $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG
docker rmi $DOCKER_IMAGE_WITH_REPO:$DOCKER_TAG
docker tag "$DOCKER_IMAGE":"$DOCKER_TAG" "$DOCKER_IMAGE_WITH_REPO":"$DOCKER_TAG"
docker push "$DOCKER_IMAGE_WITH_REPO":"$DOCKER_TAG"
docker rmi "$DOCKER_IMAGE_WITH_REPO":"$DOCKER_TAG"

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
export LC_ALL=C
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. || exit
DOCKER_IMAGE=${DOCKER_IMAGE:-dashpay/dashd-develop}
DOCKER_TAG=${DOCKER_TAG:-latest}
BUILD_DIR=${BUILD_DIR:-.}
rm docker/bin/*
mkdir docker/bin
cp $BUILD_DIR/src/dashd docker/bin/
cp $BUILD_DIR/src/dash-cli docker/bin/
cp $BUILD_DIR/src/dash-tx docker/bin/
strip docker/bin/dashd
strip docker/bin/dash-cli
strip docker/bin/dash-tx
docker build --pull -t $DOCKER_IMAGE:$DOCKER_TAG -f docker/Dockerfile docker