From 5e376da7773fac15531ed828a86c2b669a6d527f Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Wed, 22 Jul 2020 07:49:53 -0500 Subject: [PATCH 1/4] feat: add a stacks-blockchain:stretch docker image --- Dockerfile.stretch | 19 +++++++++++++++++++ circle.yml | 34 ++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 Dockerfile.stretch diff --git a/Dockerfile.stretch b/Dockerfile.stretch new file mode 100644 index 000000000..6d295b654 --- /dev/null +++ b/Dockerfile.stretch @@ -0,0 +1,19 @@ +FROM rust:stretch as build + +WORKDIR /src + +COPY . . + +RUN mkdir /out + +RUN cd testnet/stacks-node && cargo build --features "monitoring_prom" --release +RUN cd testnet/bitcoin-neon-controller && cargo build --release + +RUN cp target/release/stacks-node /out +RUN cp target/release/bitcoin-neon-controller /out + +FROM debian:stretch-slim + +COPY --from=build /out/ /bin/ + +CMD ["stacks-node", "argon"] diff --git a/circle.yml b/circle.yml index 90b209abb..690b55fba 100644 --- a/circle.yml +++ b/circle.yml @@ -77,6 +77,22 @@ jobs: root: . paths: - ./image.tar + build-docker-stretch: + executor: docker-publisher + steps: + - checkout + - setup_remote_docker + - run: + name: build docker image + no_output_timeout: 30m + command: docker build . -f Dockerfile.stretch -t $IMAGE_NAME:stretch + - run: + name: save image to workspace + command: docker save -o image-stretch.tar $IMAGE_NAME:stretch + - persist_to_workspace: + root: . + paths: + - ./image-stretch.tar push-docker-tags: executor: docker-publisher steps: @@ -86,6 +102,9 @@ jobs: - run: name: load docker image command: docker load -i /tmp/workspace/image.tar + - run: + name: load docker image + command: docker load -i /tmp/workspace/image-stretch.tar - run: name: push docker image command: | @@ -94,9 +113,9 @@ jobs: docker tag $IMAGE_NAME:latest $IMAGE_NAME:master docker push $IMAGE_NAME:latest docker push $IMAGE_NAME:master - elif [ "${CIRCLE_BRANCH}" = "feature/docker-deploy" ]; then - docker tag $IMAGE_NAME:latest $IMAGE_NAME:test-deploy - docker push $IMAGE_NAME:test-deploy + docker push $IMAGE_NAME:stretch + elif [ "${CIRCLE_BRANCH}" = "feat/docker-stretch" ]; then + docker push $IMAGE_NAME:stretch fi workflows: version: 2 @@ -104,9 +123,8 @@ workflows: jobs: - unit_tests - test_demo - - build-docker: - requires: - - unit_tests + - build-docker + - build-docker-stretch - all_tests: filters: branches: @@ -114,13 +132,13 @@ workflows: - master - /.*net.*/ - /.*marf.*/ - - feature/ignore-slow-serial-tests - push-docker-tags: requires: - unit_tests - build-docker + - build-docker-stretch filters: branches: only: - master - - feature/docker-deploy + - feat/docker-stretch From e8e2c67c155c6cc1e864c95385254c51b25e32a0 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Wed, 22 Jul 2020 10:55:01 -0500 Subject: [PATCH 2/4] add netcat --- Dockerfile.stretch | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.stretch b/Dockerfile.stretch index 6d295b654..232afe296 100644 --- a/Dockerfile.stretch +++ b/Dockerfile.stretch @@ -14,6 +14,7 @@ RUN cp target/release/bitcoin-neon-controller /out FROM debian:stretch-slim +RUN apt update && apt install netcat COPY --from=build /out/ /bin/ CMD ["stacks-node", "argon"] From 0454eb067979ecc03f0299344d86955866c579e8 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Fri, 24 Jul 2020 12:34:32 -0500 Subject: [PATCH 3/4] oops, better netcat install --- Dockerfile.stretch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.stretch b/Dockerfile.stretch index 232afe296..3901b023a 100644 --- a/Dockerfile.stretch +++ b/Dockerfile.stretch @@ -14,7 +14,7 @@ RUN cp target/release/bitcoin-neon-controller /out FROM debian:stretch-slim -RUN apt update && apt install netcat +RUN apt update && apt install -y netcat COPY --from=build /out/ /bin/ CMD ["stacks-node", "argon"] From dd83d1ab793d20e9513a74e98bc45aaa416a6413 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Fri, 24 Jul 2020 14:29:28 -0500 Subject: [PATCH 4/4] fix: github workflow only upload artifacts on push --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e49e84067..10a369ab3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,9 @@ jobs: run: build-scripts/build-dist.sh - name: Upload artifact + # Only upload the artifacts if we're actually pushed to master + if: ${{ github.event_name == 'push' }} uses: actions/upload-artifact@v2 with: name: ${{ matrix.platform }} - path: dist/ \ No newline at end of file + path: dist/