Skip to content

Commit

Permalink
[docker] refs skycoin#103 Add build of vscode docker image
Browse files Browse the repository at this point in the history
-  Add 'pylint' and 'flake8' to pre-installed pip packages
-  Add 'ms-python.python', 'njpwerner.autodocstring', 'shardulm94.trailing-spaces' and 'eamodio.gitlens' to pre-installed Visual Studio Code extensions
  • Loading branch information
stdevYuniers committed Jan 20, 2019
1 parent 7e67f06 commit e599d2c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
34 changes: 28 additions & 6 deletions docker/images/dev-cli/hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,46 @@
# IMAGE_NAME: the name and tag of the Docker repository being built.
# (This variable is a combination of DOCKER_REPO:CACHE_TAG.)
# PIP_PACKAGES: pip packages to install inside docker image.
# VS_EXTENSIONS: Visual Studio Code extensions to add on docker image,
# only if base image is not CLI purpose.

echo "Build hook running"

pwd
cd ../../../

# Build :develop tag
docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner" \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner virtualenv pylint flake8" \
-f $DOCKERFILE_PATH \
-t "$IMAGE_NAME" .

# Build :dind tag
if [ "$CACHE_TAG" -eq "develop" ]; then
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \
# Build :dind, :vscode and :vscode-dind tag
# Only build if docker tag is develop
if [ "$CACHE_TAG" == "develop" ]; then
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner" \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner virtualenv pylint flake8" \
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:dind" .

# Move to vscode folder to avoid file errors with vscode docker image
cd gopath/src/github.com/skycoin/skycoin/docker/images/dev-vscode/

docker build --build-arg IMAGE_FROM="$IMAGE_NAME" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner virtualenv pylint flake8" \
--build-arg VS_EXTENSIONS="ms-python.python njpwerner.autodocstring shardulm94.trailing-spaces eamodio.gitlens" \
-f Dockerfile \
-t "$DOCKER_REPO:vscode" .

docker build --build-arg IMAGE_FROM="$DOCKER_REPO:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg PIP_PACKAGES="setuptools wheel tox tox-pyenv tox-travis pytest pytest-runner virtualenv pylint flake8" \
--build-arg VS_EXTENSIONS="ms-python.python njpwerner.autodocstring shardulm94.trailing-spaces eamodio.gitlens" \
-f Dockerfile \
-t "$DOCKER_REPO:vscode-dind" .
fi
6 changes: 4 additions & 2 deletions docker/images/dev-cli/hooks/push
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

docker push $IMAGE_NAME

if [ "$CACHE_TAG" -eq "develop" ]; then
docker push $DOCKER_REPO:dind
if [ "$CACHE_TAG" == "develop" ]; then
docker push "$DOCKER_REPO:dind"
docker push "$DOCKER_REPO:vscode"
docker push "$DOCKER_REPO:vscode-dind"
fi

0 comments on commit e599d2c

Please sign in to comment.