From ee483a103390cac515e9ba53f9ce3ab7b11a6b6c Mon Sep 17 00:00:00 2001 From: soekarmana Date: Sat, 16 Feb 2019 22:20:46 +0800 Subject: [PATCH] add new build scripts & drone ci script --- .drone.yml | 10 ++++++++++ build-image.sh | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .drone.yml create mode 100644 build-image.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b9bb7c3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +pipeline: + build-docker: + image: docker:18.06.1-ce + volumes: + - /var/run/docker.sock:/var/run/docker.sock + commands: + - chmod +x ./build-image.sh + - ./build-image.sh + when: +event: [push] \ No newline at end of file diff --git a/build-image.sh b/build-image.sh new file mode 100644 index 0000000..d34f19e --- /dev/null +++ b/build-image.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +set -o xtrace + +IMAGE_NAME=warmup_welcome + +# clean old images +OLD_IMAGES=$(docker images $IMAGE_NAME -q --no-trunc) +if [ -n "${OLD_IMAGES}" ]; then + docker rmi -f ${OLD_IMAGES}; +fi + +#Build Images +docker build . -t $IMAGE_NAME