From 975c74e305ca6f2935acbba1cc4540336a65acaa Mon Sep 17 00:00:00 2001 From: Luca Hagel Date: Sat, 27 Jan 2018 19:42:56 +0100 Subject: [PATCH] Add circleci config, run linter --- .circleci/config.yml | 94 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..9c4037cdc --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,94 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + - image: circleci/openjdk:8-jdk-browsers + environment: + # lang settings required for Meteor's Mongo + LANG: C.UTF-8 + LANGUAGE: C.UTF-8 + LC_ALL: C.UTF-8 + LC_NUMERIC: en_US.UTF-8 + METEOR_BIN_TMP_DIR: /home/circleci/build-temp/ + METEOR_BIN_TMP_FILE: meteor-bin-temp + + working_directory: ~/app + + steps: + - checkout + - restore_cache: + key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }} + - restore_cache: + key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }} + - restore_cache: + key: meteor-packages-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }} + - restore_cache: + key: npm-packages-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} + - run: + name: install build essentials + command: sudo apt-get install -y build-essential + - run: + name: restore cached meteor bin + command: | + if [ -e ~/build-temp/meteor-bin ] + then + echo "Cached Meteor bin found, restoring it" + sudo cp ~/build-temp/meteor-bin /usr/local/bin/meteor + else + echo "No cached Meteor bin found." + fi + - run: + name: install Meteor + command: | + # only install meteor if bin isn't found + command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | /bin/sh + - run: + name: check versions + command: | + echo "Meteor version:" + meteor --version + which meteor + echo "Meteor node version:" + meteor node -v + echo "Meteor npm version:" + meteor npm -v + echo "Java version:" + java -version + - run: + name: install yarn + command: meteor npm i -g yarn + - run: + name: install npm packages + command: meteor yarn + - run: + name: code linting + command: meteor yarn lint + - run: + name: copy meteor bin to build cache + command: | + mkdir -p ~/build-temp + cp /usr/local/bin/meteor ~/build-temp/meteor-bin + - save_cache: + key: build-temp-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }} + paths: + - ~/build-temp + - save_cache: + key: meteor-release-{{ checksum ".meteor/release" }}-{{ checksum ".circleci/config.yml" }} + paths: + - ~/.meteor + - save_cache: + key: meteor-packages-{{ checksum ".meteor/versions" }}-{{ checksum ".circleci/config.yml" }} + paths: + - .meteor/ + - save_cache: + key: npm-packages-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} + paths: + - ./node_modules/ + - ~/.npm/ + + +