Unverified Commit 38faedb1 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #46 from skalenetwork/SKALE-2085-update-docker

 SKALE-2085-update-docker build
parents d598cec7 afe0986b
name: Build, test and push sgxwallet container name: Build, test and push SGX container
on: [push] on: [push]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Login to docker - name: Login to docker
env: env:
...@@ -16,8 +11,8 @@ jobs: ...@@ -16,8 +11,8 @@ 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 the Docker image - name: build
run: docker build . --file Dockerfile --tag skalenetwork/sgxwallet:latest run: python3 scripts/docker_build.py ${GITHUB_REF##*/} Dockerfile sgxwallet
- name: push docker image - name: push
run: docker push skalenetwork/sgxwallet:latest run: python3 scripts/docker_push.py ${GITHUB_REF##*/} Dockerfile sgxwallet
...@@ -16,7 +16,7 @@ jobs: ...@@ -16,7 +16,7 @@ jobs:
- name: test - name: test
run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim
- name: push - name: push
run: python3 scripts/docker_test.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim run: python3 scripts/docker_push.py ${GITHUB_REF##*/} DockerfileSimulation sgxwalletsim
...@@ -56,12 +56,14 @@ if (BRANCH == "develop") : ...@@ -56,12 +56,14 @@ if (BRANCH == "develop") :
TAG_POSTFIX = "latest"; TAG_POSTFIX = "latest";
else : else :
TAG_POSTFIX = "latest_commit" TAG_POSTFIX = "latest_commit"
FULL_IMAGE_NAME = "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX;
print("Starting build for branch " + BRANCH, flush=True) print("Starting build for branch " + BRANCH, flush=True)
assert subprocess.call(["pwd"]) == 0; assert subprocess.call(["pwd"]) == 0;
assert subprocess.call(["docker", "build", topDir, "--file", topDir + "/" + DOCKER_FILE_NAME, "--tag", assert subprocess.call(["docker", "build", topDir, "--file", topDir + "/" + DOCKER_FILE_NAME, "--tag",
"skalenetwork/" + IMAGE_NAME + ":" + TAG_POSTFIX]) == 0; FULL_IMAGE_NAME]) == 0;
...@@ -61,10 +61,7 @@ if (BRANCH == "develop") : ...@@ -61,10 +61,7 @@ if (BRANCH == "develop") :
else : else :
TAG_POSTFIX = "latest_commit" TAG_POSTFIX = "latest_commit"
FULL_IMAGE_NAME = "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX;
assert subprocess.call(["docker", "push", FULL_IMAGE_NAME]) == 0;
#print(sys.argv[1]);
#print(sys.argv[2]);
assert subprocess.call(["docker", "push", "skalenetwork/" + IMAGE_NAME + ":" + TAG_POSTFIX]) == 0;
...@@ -22,7 +22,12 @@ if (BRANCH == "develop") : ...@@ -22,7 +22,12 @@ if (BRANCH == "develop") :
else : else :
TAG_POSTFIX = "latest_commit" TAG_POSTFIX = "latest_commit"
FULL_IMAGE_NAME = "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX;
print("Running tests for branch " + BRANCH); print("Running tests for branch " + BRANCH);
assert subprocess.call(["docker", "image", "inspect", FULL_IMAGE_NAME]) == 0;
assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data", assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data",
"-d", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX]) == 0 "-d", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX]) == 0
......
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