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
c52f1df5
Unverified
Commit
c52f1df5
authored
May 18, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2202 versioning
parent
2e6e8f91
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
145 additions
and
103 deletions
+145
-103
dockerimage.yml
.github/workflows/dockerimage.yml
+13
-3
dockerimagebase.yml
.github/workflows/dockerimagebase.yml
+13
-4
dockerimagesim.yml
.github/workflows/dockerimagesim.yml
+29
-6
build_and_publish.sh
scripts/build_and_publish.sh
+33
-0
calculate_version.sh
scripts/calculate_version.sh
+50
-0
docker_build.py
scripts/docker_build.py
+6
-13
docker_push.py
scripts/docker_push.py
+0
-69
docker_test.py
scripts/docker_test.py
+1
-8
No files found.
.github/workflows/dockerimage.yml
View file @
c52f1df5
...
...
@@ -12,8 +12,18 @@ jobs:
-
name
:
submodule update
run
:
git submodule update --init --recursive
-
name
:
build
run
:
python3 scripts/docker_build.py ${GITHUB_REF##*/} Dockerfile sgxwallet ${GITHUB_SHA}
-
name
:
push
run
:
python3 scripts/docker_push.py ${GITHUB_REF##*/} Dockerfile sgxwallet ${GITHUB_SHA}
run
:
python3 scripts/docker_build.py Dockerfile sgxwallet ${GITHUB_SHA}
-
name
:
deploy docker image
if
:
contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
run
:
|
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(cat SGXWALLET_VERSION)
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwallet Dockerfile
.github/workflows/dockerimagebase.yml
View file @
c52f1df5
...
...
@@ -15,7 +15,16 @@ jobs:
-
name
:
submodule update
run
:
git submodule update --init --recursive
-
name
:
Build the Docker image
run
:
docker build . --file DockerfileBase --tag skalenetwork/sgxwallet_base:latest
-
name
:
push docker image
run
:
docker push skalenetwork/sgxwallet_base:latest
run
:
docker build . --file DockerfileBase --tag skalenetwork/sgxwallet_base:latest
-
name
:
deploy docker image
if
:
contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
run
:
|
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(cat SGXWALLET_VERSION)
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwallet_base)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwallet_base DockerfileBase
\ No newline at end of file
.github/workflows/dockerimagesim.yml
View file @
c52f1df5
...
...
@@ -14,12 +14,35 @@ jobs:
-
name
:
submodule update
run
:
git submodule update --init --recursive
-
name
:
build
run
:
python3 scripts/docker_build.py
${GITHUB_REF##*/}
DockerfileSimulation sgxwalletsim ${GITHUB_SHA}
run
:
python3 scripts/docker_build.py DockerfileSimulation sgxwalletsim ${GITHUB_SHA}
-
name
:
test
run
:
python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim ${GITHUB_SHA}
-
name
:
push
run
:
python3 scripts/docker_push.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim ${GITHUB_SHA}
run
:
python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim
-
name
:
deploy docker image
if
:
contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
run
:
|
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(cat SGXWALLET_VERSION)
export VERSION=$(bash ./scripts/calculate_version.sh $BRANCH $VERSION sgxwalletsim)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh sgxwalletsim DockerfileSimulation
-
name
:
Create Release
if
:
contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
id
:
create_release
uses
:
actions/create-release@latest
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
# This token is provided by Actions, you do not need to create your own token
with
:
tag_name
:
${{ env.VERSION }}
release_name
:
Release ${{ env.VERSION }}
body
:
|
Changes in this Release
- First Change
- Second Change
draft
:
false
prerelease
:
true
scripts/build_and_publish.sh
0 → 100644
View file @
c52f1df5
#!/usr/bin/env bash
set
-e
CONTAINER
=
$1
DOCKERFILE
=
$2
:
"
${
VERSION
?Need to set VERSION
}
"
:
"
${
BRANCH
?Need to set BRANCH
}
"
NAME
=
schain
REPO_NAME
=
skalenetwork/
$NAME
IMAGE_NAME
=
$REPO_NAME
:
$CONTAINER
:
$VERSION
LATEST_IMAGE_NAME
=
$REPO_NAME
:
$CONTAINER
:
$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_PASSWORD
?Need to set DOCKER_PASSWORD
}
"
echo
"
$DOCKER_PASSWORD
"
| docker login
--username
$DOCKER_USERNAME
--password-stdin
docker push
$IMAGE_NAME
||
exit
$?
docker push
$LATEST_IMAGE_NAME
||
exit
$?
scripts/calculate_version.sh
0 → 100755
View file @
c52f1df5
#!/bin/bash
BRANCH
=
$1
VERSION
=
$2
CONTAINER
=
$3
if
[
-z
$BRANCH
]
then
echo
"A branch is not set."
exit
1
fi
if
[
-z
$VERSION
]
then
echo
"The base version is not set."
exit
1
fi
if
[
-z
$CONTAINER
]
then
echo
"The base container is not set."
exit
1
fi
git fetch
--tags
if
[
$BRANCH
=
"master"
]
then
echo
$VERSION
exit
0
fi
LABEL
=
"develop"
if
[
$BRANCH
=
"stable"
]
then
LABEL
=
"stable"
elif
[
$BRANCH
=
"beta"
]
then
LABEL
=
"beta"
fi
for
((
VERSION_NUMBER
=
0
;
;
VERSION_NUMBER++
))
do
RESULT_VERSION
=
"
$CONTAINER
:
$VERSION
-
$LABEL
.
$VERSION_NUMBER
"
if
!
[
$(
git tag
-l
?
$RESULT_VERSION
)
]
then
echo
$RESULT_VERSION
break
fi
done
scripts/docker_build.py
View file @
c52f1df5
...
...
@@ -50,24 +50,17 @@ import sys, os, subprocess, time
os
.
chdir
(
".."
)
topDir
=
os
.
getcwd
()
+
"/sgxwallet"
BRANCH
=
sys
.
argv
[
1
]
DOCKER_FILE_NAME
=
sys
.
argv
[
2
]
IMAGE_NAME
=
sys
.
argv
[
3
]
COMMIT_HASH
=
sys
.
argv
[
4
]
if
(
BRANCH
==
"develop"
):
TAG_POSTFIX
=
"latest"
else
:
TAG_POSTFIX
=
"latest_commit"
DOCKER_FILE_NAME
=
sys
.
argv
[
1
]
IMAGE_NAME
=
sys
.
argv
[
2
]
COMMIT_HASH
=
sys
.
argv
[
3
]
TAG_POSTFIX
=
"latest_commit"
FULL_IMAGE_TAG
=
"skalenetwork/"
+
IMAGE_NAME
+
":"
+
TAG_POSTFIX
COMMIT_HASH_TAG
=
"skalenetwork/"
+
IMAGE_NAME
+
":"
+
COMMIT_HASH
print
(
"Starting build
for branch "
+
BRANCH
,
flush
=
True
)
print
(
"Starting build
"
,
flush
=
True
)
assert
subprocess
.
call
([
"pwd"
])
==
0
assert
subprocess
.
call
([
"docker"
,
"build"
,
topDir
,
"--file"
,
topDir
+
"/"
+
DOCKER_FILE_NAME
,
"--tag"
,
FULL_IMAGE_TAG
])
==
0
if
(
BRANCH
==
"develop"
):
assert
subprocess
.
call
([
"docker"
,
"tag"
,
FULL_IMAGE_TAG
,
COMMIT_HASH_TAG
])
==
0
FULL_IMAGE_TAG
])
==
0
\ No newline at end of file
scripts/docker_push.py
deleted
100755 → 0
View file @
2e6e8f91
#!/usr/bin/env python
# ------------------------------------------------------------------------------
# Bash script to build cpp-ethereum within TravisCI.
#
# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
#
# ------------------------------------------------------------------------------
# This file is part of cpp-ethereum.
#
# cpp-ethereum is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cpp-ethereum is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2016 cpp-ethereum contributors.
# ------------------------------------------------------------------------------
#
# Copyright (C) 2019-Present SKALE Labs
#
# This file is part of sgxwallet.
#
# sgxwallet is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# sgxwallet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with sgxwallet. If not, see <https://www.gnu.org/licenses/>.
#
# @file docker_push.py
# @author Stan Kladko
# @date 2020
#
import
sys
,
os
,
subprocess
,
time
os
.
chdir
(
".."
)
topDir
=
os
.
getcwd
()
+
"/sgxwallet"
print
(
"Starting build push"
)
print
(
"Top directory is:"
+
topDir
)
SCRIPTS_DIR
=
topDir
+
"/scripts"
BRANCH
=
sys
.
argv
[
1
];
DOCKER_FILE_NAME
=
sys
.
argv
[
2
];
IMAGE_NAME
=
sys
.
argv
[
3
];
COMMIT_HASH
=
sys
.
argv
[
4
]
if
(
BRANCH
==
"develop"
)
:
TAG_POSTFIX
=
"latest"
;
else
:
TAG_POSTFIX
=
"latest_commit"
FULL_IMAGE_NAME
=
"skalenetwork/"
+
IMAGE_NAME
+
":"
+
TAG_POSTFIX
;
assert
subprocess
.
call
([
"docker"
,
"push"
,
"skalenetwork/"
+
IMAGE_NAME
])
==
0
;
scripts/docker_test.py
View file @
c52f1df5
...
...
@@ -24,21 +24,14 @@
import
sys
,
os
,
subprocess
,
socket
,
time
os
.
chdir
(
".."
)
topDir
=
os
.
getcwd
()
+
"/sgxwallet"
print
(
"Starting container test"
)
print
(
"Top directory is:"
+
topDir
)
SCRIPTS_DIR
=
topDir
+
"/scripts"
BRANCH
=
sys
.
argv
[
1
];
DOCKER_FILE_NAME
=
sys
.
argv
[
2
];
IMAGE_NAME
=
sys
.
argv
[
3
];
COMMIT_HASH
=
sys
.
argv
[
4
]
IMAGE_NAME
=
sys
.
argv
[
3
]
if
(
BRANCH
==
"develop"
)
:
TAG_POSTFIX
=
"latest"
;
...
...
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