From 48de3655ce18eb5cb4411c12b30aaa255e1730d5 Mon Sep 17 00:00:00 2001 From: Barry Steyn Date: Sun, 19 Nov 2017 21:16:33 -0800 Subject: [PATCH 1/4] removed devops folder --- devops/coin-cli/README.md | 30 -------------- .../packer/builders/docker/coin-cli.build | 1 - .../packer/builders/docker/coin-cli.run | 9 ----- .../docker/provisioners/shell/build.sh | 10 ----- .../docker/provisioners/shell/dependencies.sh | 8 ---- .../packer/builders/docker/template.json | 39 ------------------- 6 files changed, 97 deletions(-) delete mode 100644 devops/coin-cli/README.md delete mode 100644 devops/coin-cli/packer/builders/docker/coin-cli.build delete mode 100644 devops/coin-cli/packer/builders/docker/coin-cli.run delete mode 100644 devops/coin-cli/packer/builders/docker/provisioners/shell/build.sh delete mode 100644 devops/coin-cli/packer/builders/docker/provisioners/shell/dependencies.sh delete mode 100644 devops/coin-cli/packer/builders/docker/template.json diff --git a/devops/coin-cli/README.md b/devops/coin-cli/README.md deleted file mode 100644 index 294d0db..0000000 --- a/devops/coin-cli/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Numismatic coin-cli docker environment -Build and run a numismatic coin-cli from an already configured environment - -**Dependencies:** - - Packer - ``` - curl -O https://releases.hashicorp.com/packer/1.1.0/packer_1.1.0_linux_amd64.zip - unzip packer_1.1.0_linux_amd64.zip -d /usr/local/bin - ``` - - Docker (see https://docs.docker.com/engine/installation/) - -**Build:** - - `cd ./devops/coin-cli/packer/builders/docker` - - `. ./coin-cli.build` - -**Run:** - - `cd ./devops/coin-cli/packer/builders/docker` - - `. ./coin-cli.run` - - Each of the following commands, when executed in the same shell as the - command above, mounts the current working directory into a Docker container - and runs the following process: - - `dcoin`: numismatic coin-cli with the numismatic environment configured - - `coinbash`: A Bash shell with the numismatic environment configured - - `coinpy`: A Python shell with the numismatic environment configured - -**Tips:** - - In order to have the commands in the section above persistently available: - - `cat ./coin-cli.run >> ~/.bash_aliases` - - or `cp ./coin-cli.run ~/.oh-my-zsh/custom/coin-cli.zsh` - (if you use oh-my-zsh) diff --git a/devops/coin-cli/packer/builders/docker/coin-cli.build b/devops/coin-cli/packer/builders/docker/coin-cli.build deleted file mode 100644 index bad7be2..0000000 --- a/devops/coin-cli/packer/builders/docker/coin-cli.build +++ /dev/null @@ -1 +0,0 @@ -packer build template.json diff --git a/devops/coin-cli/packer/builders/docker/coin-cli.run b/devops/coin-cli/packer/builders/docker/coin-cli.run deleted file mode 100644 index 21b99b8..0000000 --- a/devops/coin-cli/packer/builders/docker/coin-cli.run +++ /dev/null @@ -1,9 +0,0 @@ -dcoin() { - docker run --net=host -v $PWD:/tmp/working -w=/tmp/working --rm -it numismatic/coin:latest /home/user/numismatic/venv/bin/coin $@ -} -coinbash() { - docker run --net=host -v $PWD:/tmp/working -w=/tmp/working --rm -it numismatic/coin:latest /bin/bash -} -coinpy() { - docker run --net=host -v $PWD:/tmp/working -w=/tmp/working --rm -it numismatic/coin:latest /home/user/numismatic/venv/bin/python -} \ No newline at end of file diff --git a/devops/coin-cli/packer/builders/docker/provisioners/shell/build.sh b/devops/coin-cli/packer/builders/docker/provisioners/shell/build.sh deleted file mode 100644 index 8877db1..0000000 --- a/devops/coin-cli/packer/builders/docker/provisioners/shell/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/ash -ex -cd /home/user -git clone https://github.com/snth/numismatic.git -cd ./numismatic -python3.6 -m venv venv -source ./venv/bin/activate -pip install -U pip -pip install wheel -pip install -e . -chown user:user -R /home/user diff --git a/devops/coin-cli/packer/builders/docker/provisioners/shell/dependencies.sh b/devops/coin-cli/packer/builders/docker/provisioners/shell/dependencies.sh deleted file mode 100644 index 0093b56..0000000 --- a/devops/coin-cli/packer/builders/docker/provisioners/shell/dependencies.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/ash -ex -apk update; apk upgrade; apk add \ - bash \ - bash-completion \ - git \ - python3-dev -addgroup user -adduser -S user diff --git a/devops/coin-cli/packer/builders/docker/template.json b/devops/coin-cli/packer/builders/docker/template.json deleted file mode 100644 index beb69f4..0000000 --- a/devops/coin-cli/packer/builders/docker/template.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "builders": [ - { - "type": "docker", - "image": "alpine", - "commit": "true", - "changes": [ - "USER user" - ], - "run_command": [ - "--net=host", - "-d", - "-i", - "-t", - "{{.Image}}", - "/bin/ash" - ] - } - ], - "provisioners": [ - { - "type": "shell", - "script": "{{template_dir}}/provisioners/shell/dependencies.sh" - }, - { - "type": "shell", - "script": "{{template_dir}}/provisioners/shell/build.sh" - } - ], - "post-processors": [ - [ - { - "type": "docker-tag", - "repository": "numismatic/coin", - "tag": "latest" - } - ] - ] -} \ No newline at end of file From f116fb5aaa5409bc378ca8440191db2268f0449a Mon Sep 17 00:00:00 2001 From: Barry Steyn Date: Sun, 3 Dec 2017 16:53:29 -0800 Subject: [PATCH 2/4] Dockerfile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c4a495 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.6-alpine +WORKDIR /usr/src/app +COPY ./ /usr/src/app +RUN pip install -e . +WORKDIR numismatic +CMD coin list From 2a6c01b137ed7d5920676163664356fa2dcaa8cd Mon Sep 17 00:00:00 2001 From: Barry Steyn Date: Mon, 4 Dec 2017 07:39:20 -0800 Subject: [PATCH 3/4] Ignoring vscode .editorconfig --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7cc2b7e..3a5d1f1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dist/ *.idea/ venv/ venv-numismatic/ +.editorconfig From be6442829ac27a1fc78f15d1bb41cb59ecf54f21 Mon Sep 17 00:00:00 2001 From: Barry Steyn Date: Mon, 4 Dec 2017 07:41:20 -0800 Subject: [PATCH 4/4] Docker file CMD calling coin --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2c4a495..a1abd75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,4 @@ WORKDIR /usr/src/app COPY ./ /usr/src/app RUN pip install -e . WORKDIR numismatic -CMD coin list +CMD coin