From 911f2ca2837401de0d9621719c9ad3f81d4805d5 Mon Sep 17 00:00:00 2001 From: Hyokeun Jeon Date: Tue, 1 Sep 2020 17:35:09 +0900 Subject: [PATCH] Configure circleci workflow --- .circleci/config.yml | 63 ++++++++++++++++++++++++++++++++++++++++---- Dockerfile | 2 +- README.md | 12 ++++++++- 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13e1e0d..4305d0c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,64 @@ version: 2 + jobs: build: machine: true + working_directory: ~/workspace + steps: - checkout - #- setup_remote_docker: - #docker_layer_caching: true - - run: docker login -u $DOCKER_LOGIN_ID -p $DOCKER_LOGIN_PASSWORD - - run: docker build -t retzero/gbs_ubuntu16.04 . - - run: docker push retzero/gbs_ubuntu16.04 + + - run: + name: Build docker image + command: | + docker build -t tizen_gbs . + + - run: + name: Save docker image tarball + command: | + mkdir -p ~/saved_image + docker save -o ~/saved_image/tizen_gbs.tar tizen_gbs + + - persist_to_workspace: + root: ~/ + paths: + - saved_image + + release: + machine: true + working_directory: ~/workspace + + steps: + - attach_workspace: + at: ~/ + + - run: + name: Load docker image + command: | + docker load -i ~/saved_image/tizen_gbs.tar + docker tag tizen_gbs ${CIRCLE_USERNAME}/tizen_gbs:latest + docker tag tizen_gbs ${CIRCLE_USERNAME}/tizen_gbs:${CIRCLE_TAG:1} + + - run: + name: Push to docker hub + command: | + docker login -u $DOCKER_LOGIN_ID -p $DOCKER_LOGIN_PASSWORD + docker push ${CIRCLE_USERNAME}/tizen_gbs:latest + docker push ${CIRCLE_USERNAME}/tizen_gbs:${CIRCLE_TAG:1} + +workflows: + version: 2 + build-and-release: + jobs: + - build: + filters: + tags: + only: /.*/ + - release: + requires: + - build + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ diff --git a/Dockerfile b/Dockerfile index a40ca29..394637a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,5 @@ RUN apt-get update RUN apt-get install -y --force-yes wget gbs # Binfmt configuration -RUN sed -i "2a\\find /proc/sys/fs/binfmt_misc/ -name \"qemu-*\" -type f -exec sh -c \"echo -1 | tee {}\" \\\;" /usr/local/bin/dockerd-entrypoint.sh +RUN find /proc/sys/fs/binfmt_misc/ -name "qemu-*" -type f -exec sh -c "echo -1 | tee {}" \; diff --git a/README.md b/README.md index c7cd181..6141c0a 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# gbs_ubuntu16.04 \ No newline at end of file +# Tizen GBS image + +### Docker images + +Docker images are available on [Docker Hub](https://hub.docker.com/r/retzero/tizen_gbs/). + +You can launch a Tizen GBS container for trying it out with + +``` +$ docker run --name gbs -d retzero/tizen_gbs +```