Skip to content

Commit

Permalink
fix coverage, badge, docker release on in master branch (#2218)
Browse files Browse the repository at this point in the history
Equivalent coverage and docker image release from gitlab ci. Except release is a docker image release and will also add s3 release in future, since gcloud storage requires google login, which is inconvenient for used in scripts

Test Plans
--------------
coverage only in master, beta, stable branch and docker release only in master branch (For test purpose also this cov-release branch but will be removed). badge updated. docker release in beta/stable branch will be added but not ready now as tests in beta/stable is more strict
  • Loading branch information
nearprotocol-bulldozer[bot] authored Mar 5, 2020
1 parent 5b9b173 commit f605a11
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## NEAR Protocol - scalable and usable blockchain

![Build status](https://gitlab.com/near-protocol/nearcore/badges/master/pipeline.svg)
[![Build status](https://badge.buildkite.com/a81147cb62c585cc434459eedd1d25e521453120ead9ee6c64.svg)](https://buildkite.com/nearprotocol/nearcore)
[![codecov](https://codecov.io/gh/nearprotocol/nearcore/branch/master/graph/badge.svg)](https://codecov.io/gh/nearprotocol/nearcore)
[![dependency status](https://deps.rs/repo/github/nearprotocol/nearcore/status.svg)](https://deps.rs/repo/github/nearprotocol/nearcore)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/near)
Expand Down
28 changes: 10 additions & 18 deletions scripts/docker-release.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#!/bin/bash
function make_sure {
read -p "$1. Are you sure [y/n]? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
}
set -euo pipefail

branch=$(git rev-parse --abbrev-ref HEAD)
if [ "${branch}" != "master" ]; then
make_sure "Not in master branch"
fi

if [ -n "$(git status -s)" ]; then
make_sure "There's untracked files or uncommitted changes"
fi
branch=${BUILDKITE_BRANCH}
commit=${BUILDKITE_COMMIT}

make
docker tag nearcore nearprotocol/nearcore:latest
docker push nearprotocol/nearcore:latest
# Here we don't check master, beta and stable criteria, they have to be checked in buildkite pipeline
# before this script. And nearprotocol/nearcore:latest must be manually tagged from a verified stable.
docker tag nearcore nearprotocol/nearcore:${branch}-${commit}
docker tag nearcore nearprotocol/nearcore:${branch}
set -x
docker push nearprotocol/nearcore:${branch}-${commit}
docker push nearprotocol/nearcore:${branch}
12 changes: 11 additions & 1 deletion scripts/near-kcov-runtime.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
FROM amazonlinux:2 as builder

RUN yum update -y && yum install -y \
openssl-devel.x86_64 elfutils-libelf-devel libcurl-devel binutils-devel elfutils-devel zlib-devel git cmake3 ninja-build python3 \
openssl-devel.x86_64 elfutils-libelf-devel libcurl-devel binutils-devel elfutils-devel zlib-devel \
git gcc-c++ make ninja-build python3 tar wget \
&& yum clean all && rm -rf /var/cache/yum

RUN wget https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz && \
tar -xvzf cmake-3.10.0.tar.gz && \
cd cmake-3.10.0 && \
./bootstrap && \
make && \
make install && \
cd .. && \
rm -rf cmake*

RUN git clone https://github.com/SimonKagstrom/kcov.git

WORKDIR /kcov
Expand Down
4 changes: 2 additions & 2 deletions scripts/parallel_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def merge_coverage(i, to_merge, j):
break
subprocess.check_output(f'mkdir -p {coverage_dir(i+1)}', shell=True)

cov_to_merge = list(grouper(covs, 2 ))
cov_to_merge = list(grouper(covs, 2))
if cov_to_merge[-1][-1] is None:
# ensure the last to merge is not only one cov
cov_to_merge[-2] += (cov_to_merge[-1][0],)
Expand All @@ -103,7 +103,7 @@ def merge_coverage(i, to_merge, j):
j+=1
futures.append(executor.submit(merge_coverage, i, cov, j))

for _ in as_completed(futures):
for f in as_completed(futures):
pass

i+=1
Expand Down
16 changes: 0 additions & 16 deletions scripts/upload_release.sh

This file was deleted.

0 comments on commit f605a11

Please sign in to comment.