Version: 0.0.2
Last Updated: Unknown
Node scaffold for CircleCi. Acts as if you will be using surge for staging and AWS S3 for production.
# key name circleci: # building for node - node: surgeUrl: dok-surge-test-url bucketName: dok-bucket-example
1version: 22jobs:3 build:4 docker:5 - image: circleci/node:8.9.46 working_directory: ~/repo7 steps:8 - checkout9 - restore_cache:10 keys:11 - v-dependencies-{{ checksum "package.json" }}12 - v-dependencies-13 - run:14 name: Install dependencies15 command: yarn install16 - save_cache:17 paths:18 - node_modules19 key: v-dependencies-{{ checksum "package.json" }}20 - run:21 name: Install expo-cli22 working_directory: ~/repo23 command: |24 sudo npm i -g expo-cli25 - run:26 name: Deploy if tests pass27 working_directory: ~/repo28 command: |29 if [ $CIRCLE_BRANCH == 'develop' ]; then30 echo "Success!"31 elif [ $CIRCLE_BRANCH == 'master' ]; then32 expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD33 expo publish34 fi
1#!/usr/bin/env node23const fs = require('fs-extra');4const ejs = require('ejs');5const dir = __dirname;6const path = process.cwd();7const appDir = path;89/**10 * Build out the Circle CI file11 * using the circleci.ejs template12 * file.13 *14 * @param {*} data15 */16const buildCircleCi = (data) => {17 ejs18 .renderFile(`${dir}/circleci.ejs`, data, {}, function (err, str) {19 // str => Rendered HTML string20 if (err) {21 console.log(err);22 throw err;23 }2425 fs.outputFileSync(`${appDir}/.circleci/config.yml`, str);26 console.log('\t- CircleCI config file generated');27 });28};2930/**31 * Bridge the CircleCi file32 *33 * @example34 * lift up up.yml35 *36 * @param {*} data37 */38module.exports = function (data) {39 console.log('Bridging CircleCi');40 try {41 // map the correct types across42 buildCircleCi(data);43 } catch (err) {44 console.error(err);45 }46};
1yarn add fs-extra ejs --dev