Skip to content

Commit

Permalink
Merge pull request #3941 from reactioncommerce/release-1.9.0
Browse files Browse the repository at this point in the history
Release 1.9.0
  • Loading branch information
spencern authored Mar 15, 2018
2 parents 766c97e + 2c05762 commit 2b0c180
Show file tree
Hide file tree
Showing 328 changed files with 8,978 additions and 7,250 deletions.
File renamed without changes.
28 changes: 0 additions & 28 deletions .circleci/build.sh

This file was deleted.

240 changes: 190 additions & 50 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,215 @@
version: 2

# The following stanza defines a map named defaults with a variable that may be
# inserted using the YAML merge (<<: *) key later in the file to save some
# typing. See http://yaml.org/type/merge.html for details.
defaults: &defaults
environment:
- DOCKER_REPOSITORY: "reactioncommerce/reaction"
- DOCKER_NAMESPACE: "reactioncommerce"
- DOCKER_NAME: "reaction"
- TOOL_NODE_FLAGS: "--max-old-space-size=4096"
working_directory: ~/reaction-app
docker:
- image: circleci/node:8-stretch

jobs:
build:
working_directory: /home/reaction

docker:
- image: node:8

environment:
- DOCKER_VERSION: 17.05.0-ce
- DOCKER_COMPOSE_VERSION: 1.15.0
- METEOR_ALLOW_SUPERUSER: true
- TOOL_NODE_FLAGS: "--max-old-space-size=4096"

<<: *defaults
steps:
- setup_remote_docker
- checkout

# install OS dependencies
- setup_remote_docker
- restore_cache:
name: Restoring Meteor cache
key: meteor

- run: .circleci/install.sh

- run:
name: Install Meteor
command: |
if [[ -f ~/.meteor/meteor ]]; then \
printf "\nMeteor already installed. Creating symlink.\n"
sudo ln -s ~/.meteor/meteor /usr/local/bin/meteor;
else
printf "\Installing Meteor\n"
curl https://install.meteor.com | /bin/sh
fi
- save_cache:
name: Saving Meteor to cache
key: meteor
paths:
- ~/.meteor

# install app dependencies

- run: meteor npm install

# run tests
- restore_cache:
name: Restoring Meteor dev_bundle cache
key: dev_bundle

# run reaction tests
- run: .circleci/tests.sh

- run:
name: Meteor NPM Install
command: meteor npm install
# Store node_modules dependency cache.
# Saved with package.json checksum and timestamped branch name keys.
- save_cache:
key: v1-node-modules-{{ checksum "package.json" }}
paths:
- node_modules
- save_cache:
name: Saving Meteor dev_bundle to cache
key: dev_bundle
key: v1-node-modules-{{ .Branch }}-{{ epoch }}
paths:
- /home/reaction/.meteor/local
- node_modules

docker-build:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: docker-cache
- run:
command: .circleci/build.sh
name: Discover Docker Tags
command: |
mkdir -p docker-cache
.circleci/bin/docker-tags "$CIRCLE_SHA1" "$CIRCLE_BRANCH" | sed 's/\//-/g' \
> docker-cache/docker-tags.txt
- run:
name: Docker build
command: |
docker build \
--build-arg TOOL_NODE_FLAGS="--max-old-space-size=4096" \
-t "$DOCKER_REPOSITORY:$CIRCLE_SHA1" .
mkdir -p docker-cache
docker save \
-o docker-cache/docker-image.tar \
"$DOCKER_REPOSITORY:$CIRCLE_SHA1"
no_output_timeout: 30m
- persist_to_workspace:
root: docker-cache
paths:
- docker-image.tar
- docker-tags.txt

docker-push:
<<: *defaults
steps:
- setup_remote_docker
- attach_workspace:
at: docker-cache
- run:
name: Load Docker Image
command: |
docker load < docker-cache/docker-image.tar
- run:
command: .reaction/jsdoc/build.sh
no_output_timeout: 2m
name: Tag Docker Image
command: |
cat docker-cache/docker-tags.txt \
| xargs -t -I % \
docker tag \
"$DOCKER_REPOSITORY:$CIRCLE_SHA1" \
"$DOCKER_REPOSITORY:%"
- run:
name: Docker Push
command: |
if [ -z "$CIRCLE_PR_USERNAME" ]; then \
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
docker push "$DOCKER_REPOSITORY:$CIRCLE_SHA1"
cat docker-cache/docker-tags.txt \
| xargs -t -I % \
docker push "$DOCKER_REPOSITORY:%"
else
echo "No deploy for forks"
fi
# deploy the docs if on master branch
- deploy:
name: Deploy to S3 if tests pass and branch is Master
deploy-docs:
<<: *defaults
steps:
- checkout
- run:
name: Install AWS CLI
command: sudo apt-get -y -qq install awscli
- run:
name: NPM Install JSDoc
command: sudo npm install -g jsdoc
- run:
name: Build JSDoc files
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
if [[ "${API_DOC_BUCKET}" && "${API_DOC_BUCKET_REGION}" ]]; then
aws s3 sync /tmp/reaction-docs ${API_DOC_BUCKET} --delete --region ${API_DOC_BUCKET_REGION}
else
echo "S3 bucket configuration not found for jsdocs"
echo "Set API_DOC_BUCKET and API_DOC_BUCKET_REGION to build and deploy jsdocs to S3"
fi
jsdoc . \
--verbose \
--configure .reaction/jsdoc/jsdoc.json \
--readme .reaction/jsdoc/templates/static/README.md
- run:
name: Deploy Doc files to S3
command: |
if [[ "${API_DOC_BUCKET}" && "${API_DOC_BUCKET_REGION}" ]]; then
aws s3 sync /tmp/reaction-docs ${API_DOC_BUCKET} --delete --region ${API_DOC_BUCKET_REGION}
else
echo "Not master branch so not deploying"
echo "S3 bucket configuration not found for jsdocs"
echo "Set API_DOC_BUCKET and API_DOC_BUCKET_REGION to build and deploy jsdocs to S3"
exit 1;
fi
- deploy:
name: Docker Image Deploment
command: .circleci/deploy.sh
eslint:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-node-modules-{{ checksum "package.json" }}
- v1-node-modules-{{ .Branch }}
- v1-node-modules-master
- run:
name: Run Lint
command: |
npm run lint
test:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restoring Meteor cache
key: meteor
- run:
name: Link Restored Meteor
command: sudo ln -s ~/.meteor/meteor /usr/local/bin/meteor
- restore_cache:
# Fall back to less specific caches
keys:
- v1-node-modules-{{ checksum "package.json" }}
- v1-node-modules-{{ .Branch }}
- v1-node-modules-master
- run:
name: Install Reaction CLI
command: sudo npm install -g reaction-cli
- run:
name: Reaction Test
command: .circleci/tests.sh

dockerfile-lint:
<<: *defaults
docker:
- image: hadolint/hadolint
steps:
- checkout
- setup_remote_docker
- run:
name: Dockerfile Lint
command: |
hadolint Dockerfile
workflows:
version: 2
build_and_test:
jobs:
- build
- dockerfile-lint
- test:
requires:
- build
- eslint:
requires:
- build
- docker-build:
context: reaction-build-read
- docker-push:
context: reaction-publish-docker
requires:
- docker-build
- deploy-docs:
requires:
- test
- docker-build
filters:
branches:
only: /^master$/
31 changes: 0 additions & 31 deletions .circleci/deploy.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .circleci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ reaction:
MONGO_URL: "mongodb://mongo:27017/reaction"

mongo:
image: mongo:latest
command: mongod --storageEngine=wiredTiger --bind_ip_all
image: mongo:3.4
command: mongod --storageEngine=wiredTiger
39 changes: 0 additions & 39 deletions .circleci/install.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .circleci/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# often avoided and the false positive doesn't fail the CircleCI build.
#
# This will update npm deps which takes a while
# cfs:tempstore: updating npm dependencies -- combined-stream...
# cfs:gridfs: updating npm dependencies -- mongodb, gridfs-stream...

set +e

Expand Down
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# things to ignore in lint

*.min.*
server/plugins.js
.reaction/jsdoc/templates/*
client/plugins.js
imports/plugins/custom/*
packages/*
.reaction/jsdoc/templates/*
server/plugins.js
3 changes: 3 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignored:
- DL3008 #Pin versions in apt get install. We'll opt for updates.
- DL3016 #Pin versions in npm install rule currently affects "meteor npm install". Versions are in package.json
Loading

0 comments on commit 2b0c180

Please sign in to comment.