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

Merge pull request #89 from skalenetwork/feature/SKALE-2202-versioning

Feature/skale 2202 versioning
parents 906be5e4 ef166af9
......@@ -25,6 +25,7 @@ jobs:
echo "Version $VERSION"
export RELEASE=true
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
......@@ -28,4 +28,5 @@ jobs:
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
bash ./scripts/build_image.sh DockerfileBase
bash ./scripts/publish_image.sh DockerfileBase
\ No newline at end of file
......@@ -3,6 +3,9 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Check that /dev/urandom exists
run: ls /dev/urandom
......@@ -13,7 +16,17 @@ jobs:
- uses: actions/checkout@v1
- name: submodule update
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}
- name: test
run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim
......@@ -22,14 +35,12 @@ jobs:
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)
export VERSION=${{env.VERSION}}
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
bash ./scripts/publish_image.sh DockerfileSimulation
- name: Create Release
if: contains(github.ref, 'develop') || contains(github.ref, 'beta') || contains(github.ref, 'master') || contains(github.ref, 'stable')
id: create_release
......
#!/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
......@@ -45,7 +45,7 @@ do
then
VERSION_NUMBER=4
fi
RESULT_VERSION="$CONTAINER:$VERSION-$LABEL.$VERSION_NUMBER"
RESULT_VERSION="$CONTAINER.$VERSION-$LABEL.$VERSION_NUMBER"
if ! [ $(git tag -l ?$RESULT_VERSION) ]
then
echo "$RESULT_VERSION"
......
......@@ -2,8 +2,7 @@
set -e
CONTAINER=$1
DOCKERFILE=$2
DOCKERFILE=$1
: "${VERSION?Need to set VERSION}"
: "${BRANCH?Need to set BRANCH}"
......@@ -11,20 +10,7 @@ DOCKERFILE=$2
NAME=sgx
REPO_NAME=skalenetwork/$NAME
IMAGE_NAME=$REPO_NAME:$VERSION
LATEST_IMAGE_NAME=$REPO_NAME-$CONTAINER:$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"
# Publish image
LATEST_IMAGE_NAME=$REPO_NAME:$BRANCH-latest
: "${DOCKER_USERNAME?Need to set DOCKER_USERNAME}"
: "${DOCKER_PASSWORD?Need to set DOCKER_PASSWORD}"
......
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