Skip to content

Commit

Permalink
[WIP] Meteor 1.5 (#2371)
Browse files Browse the repository at this point in the history
* Meteor 1.5

- include Buffer polyfill
- replaces abernix:standard-minifier-js with standard-minifier-js
- properly pins job-collections to 1.4.0

* Updated to 1.5.0 base image

* Pin react-meteor-data to 0.2.9

* Remove unused vars

Cherry pick
b36709c19
e47b25049f90643739df4bcf5210d64

* update to reactioncommerce/base:v2.0.0

* transliteration 1.6.2 (#2389)

- Related to #2090 and #2091
- Reduces minified footprint by315k
- updates client import

* Meteor1.5 and docker updates (#2390)

* fix error handling in CI deploy script

* fix CI build script

* add docker-compose.yml for CircleCI

* install Docker Compose in CI

* set docker/docker-compose versions in CI env

* fix missing curl issue in CI test

* Updated 1.5 packages
  • Loading branch information
Aaron Judd authored and jshimko committed Jun 7, 2017
1 parent 5b446c7 commit 9cfe6e8
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 69 deletions.
12 changes: 8 additions & 4 deletions .circleci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ set -e
DOCKER_NAMESPACE=${DOCKER_NAMESPACE:-"reactioncommerce/reaction"}

# if we're not on a deployment branch or a Docker related PR branch, skip the Docker build/test
if [[ -z "$CIRCLE_TAG" && "$CIRCLE_BRANCH" != "development" && "$CIRCLE_BRANCH" != *"docker"* ]]; then
if [[ "$CIRCLE_BRANCH" != "master" && "$CIRCLE_BRANCH" != "development" && "$CIRCLE_BRANCH" != *"docker"* ]]; then
echo "Not running a deployment branch. Skipping the Docker build test."
exit 0
fi

# build new image
reaction build $DOCKER_NAMESPACE:latest
docker build -t reactioncommerce/reaction:latest .

# run the container and wait for it to boot
docker run --name reaction -p 3000:3000 -d $DOCKER_NAMESPACE:latest
docker-compose -f .circleci/docker-compose.yml up -d
sleep 30

# use curl to ensure the app returns 200's
docker exec reaction curl --retry 10 --retry-delay 10 -v http://localhost:3000
docker exec reaction bash -c "apt-get update && apt-get install -y curl && \
curl --retry 10 --retry-delay 10 -v http://localhost:3000"

# now change the image tag to the configured name
docker tag reactioncommerce/reaction:latest $DOCKER_NAMESPACE:latest
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
- image: node:7

environment:
- DOCKER_VERSION: 17.03.1-ce
- DOCKER_COMPOSE_VERSION: 1.13.0
- METEOR_ALLOW_SUPERUSER: true

steps:
Expand Down
6 changes: 4 additions & 2 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

set -e

## Required environment variables in your CircleCI dashboard
# (used to push to Docker Hub)
#
Expand All @@ -25,6 +23,8 @@ fi

## Development
if [[ "$CIRCLE_BRANCH" == "development" ]]; then
set -e

DOCKER_NAMESPACE=${DOCKER_NAMESPACE:-"reactioncommerce/reaction"}
DOCKER_NAMESPACE_DEV=${DOCKER_NAMESPACE_DEV:-"reactioncommerce/prequel"}

Expand All @@ -43,6 +43,8 @@ if [[ "$CIRCLE_BRANCH" == "master" ]]; then
VERSION=$(git describe --tags | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$")

if [[ "$VERSION" ]]; then
set -e

DOCKER_NAMESPACE=${DOCKER_NAMESPACE:-"reactioncommerce/reaction"}

docker tag $DOCKER_NAMESPACE:latest $DOCKER_NAMESPACE:$VERSION
Expand Down
17 changes: 17 additions & 0 deletions .circleci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Usage:
# docker-compose up -d

reaction:
container_name: reaction
image: reactioncommerce/reaction:latest
links:
- mongo
ports:
- "3000:3000"
environment:
ROOT_URL: "http://localhost"
MONGO_URL: "mongodb://mongo:27017/reaction"

mongo:
image: mongo:latest
command: mongod --storageEngine=wiredTiger
5 changes: 4 additions & 1 deletion .circleci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ localedef -i en_GB -f UTF-8 en_US.UTF-8


# install Docker client
DOCKER_VERSION="17.03.1-ce"
curl -L -o /tmp/docker-$DOCKER_VERSION.tgz https://get.docker.com/builds/Linux/x86_64/docker-$DOCKER_VERSION.tgz
tar -xz -C /tmp -f /tmp/docker-$DOCKER_VERSION.tgz
mv /tmp/docker/* /usr/bin
docker -v


# install Docker Compose
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose


# install Meteor if it's not already
if [[ -f ~/.meteor/meteor ]]; then
Expand Down
1 change: 1 addition & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ notices-for-facebook-graph-api-2
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package
33 changes: 16 additions & 17 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
# Core Meteor Packages
###

meteor-base@1.0.4 # Packages every Meteor app needs to have
meteor-base@1.1.0 # Packages every Meteor app needs to have
[email protected] # Packages for a great mobile UX
[email protected] # Compile .html files into Meteor Blaze views
[email protected] # ECMAScript 5 compatibility for older browsers.
ecmascript@0.7.3 # Enable ECMAScript2015+ syntax in app code
ecmascript@0.8.0 # Enable ECMAScript2015+ syntax in app code
[email protected] # ensure meteor method argument validation
[email protected] # security-related policies enforced by newer browsers
juliancwirko:postcss # CSS post-processing plugin (replaces standard-minifier-css)
abernix:standard-minifier-js # a minifier plugin used for Meteor apps by default
standard-minifier-js # a minifier plugin used for Meteor apps by default
[email protected] # ReactiveDict whose contents are preserved across Hot Code Push
[email protected] # Meteor transparent reactive programming library
[email protected].17
[email protected].18
[email protected]
[email protected]
[email protected].8
[email protected].9
[email protected]
[email protected]
[email protected]
Expand All @@ -34,17 +34,19 @@ [email protected]
amplify
mdg:validated-method
[email protected]
dynamic-import

# Meteor Auth Packages
accounts-base@1.2.17
accounts-base@1.3.0
[email protected]
accounts-facebook@1.1.1
accounts-google@1.1.2
accounts-twitter@1.2.1
accounts-facebook@1.2.0
accounts-google@1.2.0
accounts-twitter@1.3.0
[email protected]
# accounts-github
# accounts-weibo
# accounts-oauth
[email protected]
[email protected]
[email protected]


# Community Packages
alanning:roles
Expand Down Expand Up @@ -72,8 +74,8 @@ ongoworks:security
raix:ui-dropped-event
risul:moment-timezone
tmeasday:publish-counts
vsivsi:[email protected]
react-meteor-data
vsivsi:job-collection@=1.4.0
react-meteor-data@=0.2.9
percolate:migrations
gadicc:blaze-react-component

Expand All @@ -94,6 +96,3 @@ johanbrook:publication-collector
# meteorhacks:sikka # additional ddp, login security

# Custom Packages
[email protected]
[email protected]
[email protected]
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.4.4.2
METEOR@1.5
47 changes: 25 additions & 22 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
abernix:[email protected]
abernix:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
accounts-twitter@1.2.1
accounts-twitter@1.3.0
alanning:[email protected]
aldeed:[email protected]
aldeed:[email protected]
Expand All @@ -19,14 +17,14 @@ [email protected]
[email protected]
[email protected]
[email protected]
babel-compiler@6.18.2
babel-compiler@6.19.2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
boilerplate-generator@1.0.11
boilerplate-generator@1.1.0
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -66,13 +64,16 @@ [email protected]
[email protected]
dispatch:[email protected]
dispatch:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].3
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
gadicc:[email protected]
[email protected]
Expand All @@ -96,23 +97,24 @@ kadira:[email protected]
[email protected]
[email protected]
[email protected]
localstorage@1.0.12
localstorage@1.1.0
[email protected]
matb33:[email protected]
mdg:[email protected]
mdg:[email protected]
[email protected]
meteor-base@1.0.4
meteor-base@1.1.0
meteorhacks:[email protected]
meteorhacks:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
modules@0.8.2
modules-runtime@0.7.10
momentjs:moment@2.17.1
[email protected].17
modules@0.9.1
modules-runtime@0.8.0
momentjs:moment@2.18.1
[email protected].18
[email protected]
[email protected]
mrt:[email protected]
Expand All @@ -130,13 +132,13 @@ percolate:[email protected]
practicalmeteor:[email protected]_1
practicalmeteor:[email protected]
practicalmeteor:[email protected]_2
[email protected].8
[email protected].9
raix:[email protected]
raix:[email protected]
[email protected]
[email protected]
[email protected]
[email protected].8
[email protected].9
[email protected]
[email protected]
[email protected]
Expand All @@ -149,6 +151,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Expand All @@ -162,5 +165,5 @@ [email protected]
[email protected]
[email protected]
vsivsi:[email protected]
[email protected].15
[email protected].16
[email protected]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM reactioncommerce/base:v1.4.0
FROM reactioncommerce/base:v2.0.0

# Default environment variables
ENV ROOT_URL "http://localhost"
Expand Down
7 changes: 7 additions & 0 deletions client/lib/buffer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// this is an expensive polyfill for clientside Buffer usage
// TODO refactor to remove this buffer dependency
global.Buffer = global.Buffer || require("buffer").Buffer; // eslint-disable-line

// how to refactor
// you can easily drop a breakpoint on the error in your browser's inspector, then refresh the page to hit the breakpoint and see via the call stack which package is trying to use Buffer
// https://github.com/meteor/meteor/issues/8645
2 changes: 1 addition & 1 deletion client/modules/core/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// client slugify only works when import minified version.
import "transliteration/lib/browser/transliteration.min.js";
import "transliteration/lib/browser/transliteration.js";

/**
* getSlug - return a client slugified string using the "slugify"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meteor } from "meteor/meteor";
import { composeWithTracker } from "/lib/api/compose";
import { Router } from "/client/api";
import { ReactionProduct } from "/lib/api";
import { Tags, Media, Products } from "/lib/collections";
import { Products } from "/lib/collections";
import PublishContainer from "/imports/plugins/core/revisions/client/containers/publishContainer";

class ProductPublishContainer extends Component {
Expand Down Expand Up @@ -71,24 +71,6 @@ function composer(props, onData) {
let revisonDocumentIds;

if (product) {
if (_.isArray(product.hashtags)) {
tags = _.map(product.hashtags, function (id) {
return Tags.findOne(id);
});
}

const selectedVariant = ReactionProduct.selectedVariant();

if (selectedVariant) {
media = Media.find({
"metadata.variantId": selectedVariant._id
}, {
sort: {
"metadata.priority": 1
}
});
}

revisonDocumentIds = [product._id];

onData(null, {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"swiper": "^3.4.2",
"tether-drop": "^1.4.2",
"tether-tooltip": "^1.2.0",
"transliteration": "1.5.2",
"transliteration": "1.6.2",
"twilio": "^2.11.1",
"url": "^0.11.0",
"velocity-animate": "^1.5.0",
Expand Down

0 comments on commit 9cfe6e8

Please sign in to comment.