Skip to content

Commit

Permalink
Merge pull request #145 from ethereum/dev
Browse files Browse the repository at this point in the history
`dev`->`master`
  • Loading branch information
CarlBeek authored Nov 3, 2020
2 parents 3f4a79a + 179ede1 commit 9310de0
Show file tree
Hide file tree
Showing 25 changed files with 851 additions and 216 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ jobs:
- run:
name: Build with build.spec
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
mkdir ${BUILD_FILE_NAME};
Expand All @@ -130,6 +131,7 @@ jobs:
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256
- store_artifacts:
path: /tmp/artifacts
build-windows:
Expand All @@ -144,6 +146,7 @@ jobs:
- run:
name: Build with build.spec
command: |
$PYTHONHASHSEED = 42
$CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7)
$BUILD_FILE_NAME = "eth2deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
mkdir $BUILD_FILE_NAME
Expand All @@ -159,6 +162,8 @@ jobs:
Compress-Archive -Path $BUILD_FILE_NAME_PATH -DestinationPath $ZIP_FILE_NAME
mkdir \tmp\artifacts
copy $ZIP_FILE_NAME \tmp\artifacts\
$CHECKSUM_FILE_NAME_PASH = "\tmp\artifacts\" + $BUILD_FILE_NAME + ".sha256"
certUtil -hashfile $ZIP_FILE_NAME SHA256 | findstr /i /v "SHA256" | findstr /i /v "CertUtil" > $CHECKSUM_FILE_NAME_PASH
- store_artifacts:
path: /tmp/artifacts
build-macos:
Expand All @@ -175,6 +180,7 @@ jobs:
- run:
name: Build with build.spec
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
mkdir ${BUILD_FILE_NAME};
Expand All @@ -187,6 +193,7 @@ jobs:
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
shasum -a 256 ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256
- store_artifacts:
path: /tmp/artifacts

Expand Down
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Prevent your local modules and debug logs from being
# copied onto your Docker image and possibly overwriting
# modules installed within your image
.git
__pycache__
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ venv/
*.mypy_cache
*.egg-info
*.egg
__pycache__
__pycache__
.DS_Store
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.7-alpine

WORKDIR /app

COPY requirements.txt setup.py ./

COPY eth2deposit ./eth2deposit

RUN apk add --update gcc libc-dev linux-headers

RUN pip3 install -r requirements.txt

RUN python3 setup.py install

ARG cli_command

ENTRYPOINT [ "python3", "./eth2deposit/deposit.py" ]

CMD [ $cli_command ]
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3.8
DOCKER_IMAGE="ethereum/eth2.0-deposit-cli:latest"

help:
@echo "clean - remove build and Python file artifacts"
Expand Down Expand Up @@ -40,12 +41,20 @@ venv_lint: venv_build_test
$(VENV_ACTIVATE) && flake8 --config=flake8.ini ./eth2deposit ./tests && mypy --config-file mypy.ini -p eth2deposit

venv_deposit: venv_build
$(VENV_ACTIVATE) && python ./eth2deposit/deposit.py
$(VENV_ACTIVATE) && python ./eth2deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS))

build_macos: venv_build
${VENV_NAME}/bin/python -m pip install -r ./build_configs/macos/requirements.txt
$(VENV_ACTIVATE) && pyinstaller ./build_configs/macos/build.spec
export PYTHONHASHSEED=42; \
$(VENV_ACTIVATE) && pyinstaller ./build_configs/macos/build.spec;

build_linux: venv_build
${VENV_NAME}/bin/python -m pip install -r ./build_configs/linux/requirements.txt
export PYTHONHASHSEED=42; \
$(VENV_ACTIVATE) && pyinstaller ./build_configs/linux/build.spec

build_docker:
@docker build --pull -t $(DOCKER_IMAGE) .

run_docker:
@docker run -it --rm $(DOCKER_IMAGE) $(filter-out $@,$(MAKECMDGOALS))
Loading

0 comments on commit 9310de0

Please sign in to comment.