Unverified Commit 58649813 authored by Oleh Nikolaiev's avatar Oleh Nikolaiev Committed by GitHub

Merge branch 'develop' into feature/SKALE-2572-api-call-version

parents 754982bd d1ce9e78
...@@ -19,11 +19,13 @@ jobs: ...@@ -19,11 +19,13 @@ jobs:
export BRANCH=${GITHUB_REF##*/} export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH" echo "Branch $BRANCH"
export VERSION=$(cat VERSION) export VERSION=$(cat VERSION)
echo "Version $VERSION"
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet) export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet)
echo "::set-env name=VERSION::$VERSION" echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION" echo "Version $VERSION"
export RELEASE=true export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE" echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwallet Dockerfile bash ./scripts/build_image.sh Dockerfile
bash ./scripts/publish_image.sh Dockerfile
...@@ -22,9 +22,11 @@ jobs: ...@@ -22,9 +22,11 @@ jobs:
export BRANCH=${GITHUB_REF##*/} export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH" echo "Branch $BRANCH"
export VERSION=$(cat VERSION) export VERSION=$(cat VERSION)
echo "Version $VERSION"
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet_base) export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet_base)
echo "::set-env name=VERSION::$VERSION" echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION" echo "Version $VERSION"
export RELEASE=true export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE" echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwallet_base DockerfileBase bash ./scripts/build_image.sh DockerfileBase
\ No newline at end of file bash ./scripts/publish_image.sh DockerfileBase
\ No newline at end of file
...@@ -3,6 +3,9 @@ on: [push] ...@@ -3,6 +3,9 @@ on: [push]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps: steps:
- name: Check that /dev/urandom exists - name: Check that /dev/urandom exists
run: ls /dev/urandom run: ls /dev/urandom
...@@ -13,7 +16,17 @@ jobs: ...@@ -13,7 +16,17 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: submodule update - name: submodule update
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: build - name: build container for release
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(cat VERSION)
echo "Version $VERSION"
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwalletsim)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
bash ./scripts/build_image.sh DockerfileSimulation
- name: build container for testing
run: python3 scripts/docker_build.py DockerfileSimulation sgxwalletsim ${GITHUB_SHA} run: python3 scripts/docker_build.py DockerfileSimulation sgxwalletsim ${GITHUB_SHA}
- name: test - name: test
run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim
...@@ -22,13 +35,12 @@ jobs: ...@@ -22,13 +35,12 @@ jobs:
run : | run : |
export BRANCH=${GITHUB_REF##*/} export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH" echo "Branch $BRANCH"
export VERSION=$(cat VERSION) export VERSION=${{env.VERSION}}
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwalletsim)
echo "::set-env name=VERSION::$VERSION" echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION" echo "Version $VERSION"
export RELEASE=true export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE" echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwalletsim DockerfileSimulation bash ./scripts/publish_image.sh DockerfileSimulation
- name: Create Release - name: Create Release
if: contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable') if: contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
id: create_release id: create_release
......
...@@ -38,21 +38,12 @@ fi ...@@ -38,21 +38,12 @@ fi
if [[ "$1" == "-t" ]]; then if [[ "$1" == "-t" ]]; then
echo "Test run requested" echo "Test run requested"
#./testw [bls-key-encrypt] ./testw [bls-key-encrypt]
./testw [bls-key-encrypt-decrypt]
./testw [dkg-encr-sshares] ./testw [dkg-encr-sshares]
./testw [dkg-verify] ./testw [dkg-verify]
./testw [ecdsa]
./testw [test]
./testw [get-pub-ecdsa-key]
./testw [bls-dkg]
./testw [api]
./testw [get-server-status] ./testw [get-server-status]
./testw [many-threads]
./testw [ecsa-api]
./testw [dkg-api] ./testw [dkg-api]
./testw [is-poly ./testw [dkg-poly-exists]
#./testw [bls-sign]
./testw [aes-encrypt-decrypt] ./testw [aes-encrypt-decrypt]
./testw [get-server-version] ./testw [get-server-version]
else else
......
#!/usr/bin/env bash
set -e
DOCKERFILE=$1
: "${VERSION?Need to set VERSION}"
: "${BRANCH?Need to set BRANCH}"
NAME=sgx
REPO_NAME=skalenetwork/$NAME
IMAGE_NAME=$REPO_NAME:$VERSION
LATEST_IMAGE_NAME=$REPO_NAME:$BRANCH-latest
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Build image
echo "Building $IMAGE_NAME..."
docker build -f "${DIR}"/../"${DOCKERFILE}" -t "${IMAGE_NAME}" . || exit $?
docker tag "${IMAGE_NAME}" "${LATEST_IMAGE_NAME}"
echo "========================================================================================="
echo "Built $IMAGE_NAME"
\ No newline at end of file
...@@ -41,11 +41,11 @@ fi ...@@ -41,11 +41,11 @@ fi
for (( VERSION_NUMBER=0; ; VERSION_NUMBER++ )) for (( VERSION_NUMBER=0; ; VERSION_NUMBER++ ))
do do
if [ "$VERSION" = "1.49" ] && [ "$VERSION_NUMBER" < "4" ] if [ "$VERSION" = "1.49" ] && [ "$VERSION_NUMBER" -le 4 ]
then then
VERSION_NUMBER=4 VERSION_NUMBER=4
fi fi
RESULT_VERSION="$CONTAINER:$VERSION-$LABEL.$VERSION_NUMBER" RESULT_VERSION="$CONTAINER.$VERSION-$LABEL.$VERSION_NUMBER"
if ! [ $(git tag -l ?$RESULT_VERSION) ] if ! [ $(git tag -l ?$RESULT_VERSION) ]
then then
echo "$RESULT_VERSION" echo "$RESULT_VERSION"
......
...@@ -2,27 +2,15 @@ ...@@ -2,27 +2,15 @@
set -e set -e
CONTAINER=$1 DOCKERFILE=$1
DOCKERFILE=$2
: "${VERSION?Need to set VERSION}" : "${VERSION?Need to set VERSION}"
: "${BRANCH?Need to set BRANCH}" : "${BRANCH?Need to set BRANCH}"
NAME=sgx NAME=sgx
REPO_NAME=skalenetwork/$NAME REPO_NAME=skalenetwork/$NAME
IMAGE_NAME=$REPO_NAME:$CONTAINER:$VERSION IMAGE_NAME=$REPO_NAME:$VERSION
LATEST_IMAGE_NAME=$REPO_NAME:$CONTAINER:$BRANCH-latest LATEST_IMAGE_NAME=$REPO_NAME:$BRANCH-latest
# Build image
echo "Building $IMAGE_NAME..."
docker build -t "$IMAGE_NAME" --file "$DOCKERFILE" || exit $?
docker tag "$IMAGE_NAME" "$LATEST_IMAGE_NAME"
echo "========================================================================================="
echo "Built $IMAGE_NAME"
# Publish image
: "${DOCKER_USERNAME?Need to set DOCKER_USERNAME}" : "${DOCKER_USERNAME?Need to set DOCKER_USERNAME}"
: "${DOCKER_PASSWORD?Need to set DOCKER_PASSWORD}" : "${DOCKER_PASSWORD?Need to set DOCKER_PASSWORD}"
......
...@@ -882,11 +882,11 @@ TEST_CASE_METHOD(TestFixture, "PolyExists test", "[dkg-poly-exists]") { ...@@ -882,11 +882,11 @@ TEST_CASE_METHOD(TestFixture, "PolyExists test", "[dkg-poly-exists]") {
Json::Value polyExists = c.isPolyExists(polyName); Json::Value polyExists = c.isPolyExists(polyName);
REQUIRE(polyExists["exists"].asBool()); REQUIRE(polyExists["IsExist"].asBool());
Json::Value polyDoesNotExist = c.isPolyExists("Vasya"); Json::Value polyDoesNotExist = c.isPolyExists("Vasya");
REQUIRE(!polyDoesNotExist["exists"].asBool()); REQUIRE(!polyDoesNotExist["IsExist"].asBool());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment