Skip to content

Commit

Permalink
buildkite config
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalambek committed Mar 11, 2021
1 parent 77d22e0 commit c897039
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- label: publish docker
command: ./scripts/docker-release.sh
branches: "master | mhala-docker"
5 changes: 3 additions & 2 deletions Dockerfile.local → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bridge as bridge
FROM nearprotocol/bridge as bridge
FROM ubuntu:20.04 as wasm

ENV DEBIAN_FRONTEND noninteractive
Expand Down Expand Up @@ -29,6 +29,7 @@ RUN ./build.sh
FROM node:12
ENV NEAR_ENV local
RUN npm install -g near-cli
COPY --from=bridge /root/.near/localnet/node0/validator_key.json .
RUN mkdir ~/.near
COPY --from=bridge /root/.near/localnet/node0/validator_key.json ~/.near
COPY --from=wasm /root/res/linkdrop.wasm .
CMD ["near deploy --accountId node0 --wasmFile linkdrop.wasm --keyPath validator_key.json --nodeUrl $NODE_URL"]
26 changes: 26 additions & 0 deletions scripts/docker-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -eo pipefail

branch=${BUILDKITE_BRANCH//:/_}
branch=${branch//\//_}
commit=${BUILDKITE_COMMIT}

if [[ ${commit} == "HEAD" ]]; then
commit=$(git rev-parse HEAD)
fi

image_name="linkdrop"

docker build -t $image_name .

docker tag $image_name nearprotocol/${image_name}:${branch}-${commit}
docker tag $image_name nearprotocol/${image_name}:${branch}

set -x
docker push nearprotocol/${image_name}:${branch}-${commit}
docker push nearprotocol/${image_name}:${branch}
if [[ ${branch} == "master" ]];
then
docker tag $image_name nearprotocol/${image_name}:latest
docker push nearprotocol/${image_name}:latest
fi

0 comments on commit c897039

Please sign in to comment.