diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a8774b1 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,48 @@ +version: 2 +jobs: + tensorflow-building-detection: + docker: + - image: docker:17.05.0-ce-git + steps: + - checkout + - setup_remote_docker + + - restore_cache: + keys: + - v1-{{ .Branch }} + paths: + - caches/tensorflowbd.tar + + - run: + name: Load docker image cache + command: | + docker load -i caches/tensorflowbd.tar || true + + - run: + name: Build application docker image + command: docker build --cache-from=tensorflowbd -t tensorflow-building-detection . + no_output_timeout: 60m + + - run: + name: Save docker image cache + command: | + mkdir -p caches + docker save -o caches/tensorflowbd.tar tensorflowbd + + - save_cache: + key: v1-{{ .Branch }}-{{ epoch }} + paths: + - caches/tensorflowbd.tar + + - deploy: + name: Push docker image + command: | + VERSION=$(grep -m1 version package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g') + docker tag tensorflow-building-detection rub21/tensorflow-building-detection:${VERSION} + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker push rub21/tensorflow-building-detection:${VERSION} +workflows: + version: 2 + build_and_push: + jobs: + - tensorflow-building-detection \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a8908f6 --- /dev/null +++ b/package.json @@ -0,0 +1,3 @@ +{ + "version": "0.0.1" +} \ No newline at end of file