From 3893f5cfb43e6aa1495b233f6c4373a6dab7b79c Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Mon, 5 Nov 2018 10:48:42 +0100 Subject: [PATCH 1/5] chore(cookbook): circleCi --- docs/cookbook/web/deployment/circle-ci.md | 92 +++++++++++++++++------ 1 file changed, 71 insertions(+), 21 deletions(-) diff --git a/docs/cookbook/web/deployment/circle-ci.md b/docs/cookbook/web/deployment/circle-ci.md index 198604cf..ef59737b 100644 --- a/docs/cookbook/web/deployment/circle-ci.md +++ b/docs/cookbook/web/deployment/circle-ci.md @@ -3,11 +3,35 @@ * Preparation time: **3 minutes** * Requirements: - Initiated Syncano project + - Understand Syncano hosting - CircleCI account (https://circleci.com/) +### Problem to solve + +You want to configure circleCi for Syncano project + +### Solution + ### Create CircleCI configuration file -First step is to go to you Syncano project folder and create CircleCI config file: +First you should create syncano.yaml in your project folder + +```yaml +hosting: + website: + src: ../.build/website + config: + browser_router: true + +``` + +If you create hosting from cli this file above will be created automatically + +```sh +npx s hosting add +``` + +Next step is to go to your Syncano project folder and create CircleCI config file: ```sh cd ~/my_syncano_project/ @@ -17,25 +41,51 @@ touch circle.yml Now edit `circle.yml` file: ```yaml -machine: - node: - version: 7 - environment: - PATH: "${PATH}:${HOME}/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" - -dependencies: - override: - - npm install @syncano/cli - -test: - override: - - exit 0 - -deployment: - production: - branch: master - commands: - - npx s deploy +version: 2 + +jobs: + install: + docker: + - image: circleci/node:9.10.0 + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package-lock.json" }} + - v1-dependencies- + - run: + name: Installing Dependencies + command: npm i + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package-lock.json" }} + - persist_to_workspace: + root: . + paths: + - node_modules + upload-website: + docker: + - image: circleci/node:9.10.0 + working_directory: ~/repo + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Uploading website and setting CNAME + command: | + npx syncano-cli hosting sync website + npx syncano-cli hosting config website -b true # --cname YOUR_CNAME +workflows: + version: 2 + build-test-deploy: + jobs: + - install + - upload-website: + requires: + - install ``` Now add this file to your repository: @@ -46,4 +96,4 @@ git commit -m "CircleCi config file" git push ``` -Next step is to log in to CircleCI dashboard got to the `Projects` tab and add a project using `Add project` button. +Next step is to log in to CircleCI dashboard and go to the `Projects` tab and add a project using `Add project` button. From 7bd348fcb7fbc18d5a395af7248433fa7369990c Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Mon, 5 Nov 2018 11:04:15 +0100 Subject: [PATCH 2/5] chore(cookbook): amendments --- docs/cookbook/web/deployment/circle-ci.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/cookbook/web/deployment/circle-ci.md b/docs/cookbook/web/deployment/circle-ci.md index ef59737b..231dc9c7 100644 --- a/docs/cookbook/web/deployment/circle-ci.md +++ b/docs/cookbook/web/deployment/circle-ci.md @@ -3,18 +3,18 @@ * Preparation time: **3 minutes** * Requirements: - Initiated Syncano project - - Understand Syncano hosting - - CircleCI account (https://circleci.com/) + - [Understand Syncano hosting](https://0-docs.syncano.io/#/project/hosting) + - [CircleCI account](https://circleci.com/) ### Problem to solve -You want to configure circleCi for Syncano project +You want to configure circleCi for Syncano project. ### Solution ### Create CircleCI configuration file -First you should create syncano.yaml in your project folder +First you should create syncano.yaml in your project folder: ```yaml hosting: @@ -25,7 +25,7 @@ hosting: ``` -If you create hosting from cli this file above will be created automatically +If you will create hosting from cli this file above will be created automatically. ```sh npx s hosting add From 6314155e4520d0a00a858f374de942af33cc527a Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Tue, 6 Nov 2018 10:40:15 +0100 Subject: [PATCH 3/5] chore(cookbook): amendments --- docs/cookbook/web/deployment/circle-ci.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cookbook/web/deployment/circle-ci.md b/docs/cookbook/web/deployment/circle-ci.md index 231dc9c7..2bb348bf 100644 --- a/docs/cookbook/web/deployment/circle-ci.md +++ b/docs/cookbook/web/deployment/circle-ci.md @@ -8,15 +8,15 @@ ### Problem to solve -You want to configure circleCi for Syncano project. +You want to configure CircleCi for Syncano project. ### Solution ### Create CircleCI configuration file -First you should create syncano.yaml in your project folder: +First you should create syncano.yml in your project folder: -```yaml +```yml hosting: website: src: ../.build/website @@ -40,7 +40,7 @@ touch circle.yml Now edit `circle.yml` file: -```yaml +```yml version: 2 jobs: From 601cf9aa09da32d2e408e70c9ab18e7e1d896c24 Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Tue, 6 Nov 2018 17:00:57 +0100 Subject: [PATCH 4/5] chore(): update --- docs/cookbook/web/deployment/circle-ci.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cookbook/web/deployment/circle-ci.md b/docs/cookbook/web/deployment/circle-ci.md index 2bb348bf..6fc573e7 100644 --- a/docs/cookbook/web/deployment/circle-ci.md +++ b/docs/cookbook/web/deployment/circle-ci.md @@ -16,7 +16,7 @@ You want to configure CircleCi for Syncano project. First you should create syncano.yml in your project folder: -```yml +```yaml hosting: website: src: ../.build/website @@ -40,7 +40,7 @@ touch circle.yml Now edit `circle.yml` file: -```yml +```yaml version: 2 jobs: From 71ad30cbb2ed300aae7afd8c77f05eb70d1843db Mon Sep 17 00:00:00 2001 From: Jan Rochalski Date: Mon, 19 Nov 2018 18:15:28 +0100 Subject: [PATCH 5/5] chore(cookbook): amendments --- docs/cookbook/web/deployment/circle-ci.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/cookbook/web/deployment/circle-ci.md b/docs/cookbook/web/deployment/circle-ci.md index 6fc573e7..cb44270f 100644 --- a/docs/cookbook/web/deployment/circle-ci.md +++ b/docs/cookbook/web/deployment/circle-ci.md @@ -46,28 +46,27 @@ version: 2 jobs: install: docker: - - image: circleci/node:9.10.0 + - image: circleci/node working_directory: ~/repo steps: - checkout - restore_cache: keys: - - v1-dependencies-{{ checksum "package-lock.json" }} - - v1-dependencies- + - v1-dependencies-{{ checksum "package.json" }} - run: name: Installing Dependencies command: npm i - save_cache: paths: - node_modules - key: v1-dependencies-{{ checksum "package-lock.json" }} + key: v1-dependencies-{{ checksum "package.json" }} - persist_to_workspace: root: . paths: - node_modules upload-website: docker: - - image: circleci/node:9.10.0 + - image: circleci/node working_directory: ~/repo steps: - checkout @@ -76,8 +75,8 @@ jobs: - run: name: Uploading website and setting CNAME command: | - npx syncano-cli hosting sync website - npx syncano-cli hosting config website -b true # --cname YOUR_CNAME + npx s hosting sync website + npx s hosting config website -b true # --cname YOUR_CNAME workflows: version: 2 build-test-deploy: