Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
58649813
Unverified
Commit
58649813
authored
May 19, 2020
by
Oleh Nikolaiev
Committed by
GitHub
May 19, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/SKALE-2572-api-call-version
parents
754982bd
d1ce9e78
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
21 deletions
+73
-21
dockerimage.yml
.github/workflows/dockerimage.yml
+3
-1
dockerimagebase.yml
.github/workflows/dockerimagebase.yml
+3
-1
dockerimagesim.yml
.github/workflows/dockerimagesim.yml
+16
-4
start.sh
docker/start.sh
+2
-11
build_image.sh
scripts/build_image.sh
+24
-0
calculate_version.sh
scripts/calculate_version.sh
+2
-2
publish_image.sh
scripts/publish_image.sh
+21
-0
testw.cpp
testw.cpp
+2
-2
No files found.
.github/workflows/dockerimage.yml
View file @
58649813
...
@@ -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
.github/workflows/dockerimagebase.yml
View file @
58649813
...
@@ -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
.github/workflows/dockerimagesim.yml
View file @
58649813
...
@@ -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
...
...
docker/start.sh
View file @
58649813
...
@@ -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
...
...
scripts/build_image.sh
0 → 100644
View file @
58649813
#!/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
scripts/calculate_version.sh
View file @
58649813
...
@@ -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
"
...
...
scripts/
build_and_publish
.sh
→
scripts/
publish_image
.sh
100644 → 100755
View file @
58649813
...
@@ -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
}
"
...
...
testw.cpp
View file @
58649813
...
@@ -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
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment