From f2647c710a6d5b772c5b11055450fbfe2a719d7a Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Fri, 8 Mar 2019 23:01:55 -0700 Subject: [PATCH 1/6] add README --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d663290 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# firebase-deploy + +[CircleCI](https://circleci.com) [Orb](https://circleci.com/docs/2.0/orb-intro/#section=configuration) for deploying to [Firebase](https://firebase.google.com/) From 609169b9065b59862994c10ab5f4f9dc6294e64b Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Fri, 8 Mar 2019 23:03:31 -0700 Subject: [PATCH 2/6] clean up .gitignore --- .gitignore | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/.gitignore b/.gitignore index 71206ec..fce206f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ # Logs logs *.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* # Runtime data pids @@ -11,52 +8,8 @@ pids *.seed *.pid.lock -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - # Dependency directories -node_modules/ -jspm_packages/ firebase-deploy/ -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - # dotenv environment variables file .env - -# next.js build output -.next From f204bd5057394034e8bf0d74febc81d9837ec0f1 Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Fri, 8 Mar 2019 23:08:24 -0700 Subject: [PATCH 3/6] add alias parameter --- firebase-deploy.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/firebase-deploy.yml b/firebase-deploy.yml index 3fe96e4..49161ef 100644 --- a/firebase-deploy.yml +++ b/firebase-deploy.yml @@ -1,16 +1,20 @@ version: 2.1 -description: Orb for firebase deploy. +description: Orb for deploying to Firebase. commands: deploy: - description: Deploy to firebase + description: Deploy to Firebase parameters: token: type: string description: Firebase Deploy Token + alias: + type: string + default: "default" + description: Firebase project alias to deploy to steps: - run: name: Install Firebase Tools command: npm install --prefix=./firebase-deploy firebase-tools - run: name: Deploy to Firebase - command: ./firebase-deploy/node_modules/.bin/firebase deploy --token=<< parameters.token >> + command: ./firebase-deploy/node_modules/.bin/firebase deploy --token=<< parameters.token >> -P << parameters.alias >> From a1083e594e0bf71b72c17a7fbb0377ef6559686f Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Sat, 9 Mar 2019 00:08:57 -0700 Subject: [PATCH 4/6] add examples --- README.md | 52 +++++++++++++++++++++++++++ firebase-deploy.yml | 88 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) diff --git a/README.md b/README.md index d663290..f10ba45 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,55 @@ # firebase-deploy [CircleCI](https://circleci.com) [Orb](https://circleci.com/docs/2.0/orb-intro/#section=configuration) for deploying to [Firebase](https://firebase.google.com/) + +## Usage + +Example `.circleci/config.yaml` + +```yaml +version: 2.1 +orbs: + firebase-deploy: azdevs/firebase-deploy@1.0.0 +jobs: + build: + docker: + - image: circleci/node:lts + steps: + - checkout + - restore_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + - run: yarn install + - save_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - run: yarn build + - persist_to_workspace: + root: /tmp/workspace + paths: + - dist + - firebase.json + - .firebaserc + - firestore.rules + - firestore.indexes.json + deploy-staging: + docker: + - image: circleci/node:lts + steps: + - attach_workspace + at: /tmp/workspace + - firebase-deploy/deploy: + token: $FIREBASE_DEPLOY_TOKEN + alias: staging # name of an alias from your .firebaserc +workflows: + version: 2 + build-and-deploy-staging: + jobs: + - build + - deploy-staging: + requires: + - build + filters: + branches: + ignore: master +``` diff --git a/firebase-deploy.yml b/firebase-deploy.yml index 49161ef..84f5bca 100644 --- a/firebase-deploy.yml +++ b/firebase-deploy.yml @@ -18,3 +18,91 @@ commands: - run: name: Deploy to Firebase command: ./firebase-deploy/node_modules/.bin/firebase deploy --token=<< parameters.token >> -P << parameters.alias >> +examples: + default: + description: Deploying to your "default" Firebase project alias + usage: + version: 2.1 + orbs: + firebase-deploy: azdevs/firebase-deploy@1.0.0 + jobs: + build: + docker: + - image: circleci/node:lts + steps: + - checkout + - restore_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + - run: yarn install + - save_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - run: yarn build + - persist_to_workspace: + root: /tmp/workspace + paths: + - dist + - firebase.json + - .firebaserc + - firestore.rules + - firestore.indexes.json + deploy: + docker: + - image: circleci/node:lts + steps: + - attach_workspace + at: /tmp/workspace + - firebase-deploy/deploy: + token: $FIREBASE_DEPLOY_TOKEN + workflows: + build-and-deploy: + jobs: + - build + - deploy: + requires: + - build + alias: + description: Deploying to a custom Firebase project alias + usage: + version: 2.1 + orbs: + firebase-deploy: azdevs/firebase-deploy@1.0.0 + jobs: + build: + docker: + - image: circleci/node:lts + steps: + - checkout + - restore_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + - run: yarn install + - save_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - run: yarn build + - persist_to_workspace: + root: /tmp/workspace + paths: + - dist + - firebase.json + - .firebaserc + - firestore.rules + - firestore.indexes.json + deploy: + docker: + - image: circleci/node:lts + steps: + - attach_workspace + at: /tmp/workspace + - firebase-deploy/deploy: + token: $FIREBASE_DEPLOY_TOKEN + alias: staging # name of an alias from your .firebaserc + workflows: + build-and-deploy: + jobs: + - build + - deploy: + requires: + - build From fdfc2d957a16ff2a358299d1b2d13f737c931898 Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Sat, 9 Mar 2019 00:23:46 -0700 Subject: [PATCH 5/6] fix examples --- README.md | 44 +++++++++++++++++++++---------------------- firebase-deploy.yml | 46 ++++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index f10ba45..6dd792e 100644 --- a/README.md +++ b/README.md @@ -11,32 +11,32 @@ version: 2.1 orbs: firebase-deploy: azdevs/firebase-deploy@1.0.0 jobs: - build: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - key: v1-yarn-{{ checksum "yarn.lock" }} - - run: yarn install - - save_cache: - key: v1-yarn-{{ checksum "yarn.lock" }} - paths: - - ./node_modules - - run: yarn build - - persist_to_workspace: - root: /tmp/workspace - paths: - - dist - - firebase.json - - .firebaserc - - firestore.rules - - firestore.indexes.json + build: + docker: + - image: circleci/node:lts + steps: + - checkout + - restore_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + - run: yarn install + - save_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - run: yarn build + - persist_to_workspace: + root: /tmp/workspace + paths: + - dist + - firebase.json + - .firebaserc + - firestore.rules + - firestore.indexes.json deploy-staging: docker: - image: circleci/node:lts steps: - - attach_workspace + - attach_workspace: at: /tmp/workspace - firebase-deploy/deploy: token: $FIREBASE_DEPLOY_TOKEN diff --git a/firebase-deploy.yml b/firebase-deploy.yml index 84f5bca..bbb8bb3 100644 --- a/firebase-deploy.yml +++ b/firebase-deploy.yml @@ -51,7 +51,7 @@ examples: docker: - image: circleci/node:lts steps: - - attach_workspace + - attach_workspace: at: /tmp/workspace - firebase-deploy/deploy: token: $FIREBASE_DEPLOY_TOKEN @@ -69,32 +69,32 @@ examples: orbs: firebase-deploy: azdevs/firebase-deploy@1.0.0 jobs: - build: - docker: - - image: circleci/node:lts - steps: - - checkout - - restore_cache: - key: v1-yarn-{{ checksum "yarn.lock" }} - - run: yarn install - - save_cache: - key: v1-yarn-{{ checksum "yarn.lock" }} - paths: - - ./node_modules - - run: yarn build - - persist_to_workspace: - root: /tmp/workspace - paths: - - dist - - firebase.json - - .firebaserc - - firestore.rules - - firestore.indexes.json + build: + docker: + - image: circleci/node:lts + steps: + - checkout + - restore_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + - run: yarn install + - save_cache: + key: v1-yarn-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - run: yarn build + - persist_to_workspace: + root: /tmp/workspace + paths: + - dist + - firebase.json + - .firebaserc + - firestore.rules + - firestore.indexes.json deploy: docker: - image: circleci/node:lts steps: - - attach_workspace + - attach_workspace: at: /tmp/workspace - firebase-deploy/deploy: token: $FIREBASE_DEPLOY_TOKEN From cbcbbdc6ff9407edad25a2fc0ae0e866bb361484 Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Sat, 9 Mar 2019 00:27:24 -0700 Subject: [PATCH 6/6] add Orb docs link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6dd792e..065614c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ## Usage +[Read the docs](https://circleci.com/orbs/registry/orb/azdevs/firebase-deploy) + Example `.circleci/config.yaml` ```yaml