Skip to content

Instantly share code, notes, and snippets.

@janpaul123
Created July 6, 2016 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janpaul123/64d8fdef567bb531fe0fb9392b400e2e to your computer and use it in GitHub Desktop.
Save janpaul123/64d8fdef567bb531fe0fb9392b400e2e to your computer and use it in GitHub Desktop.
Diffux on CircleCI sketch
source_files:
- http://localhost:8080/diffux.js # For convenience, for use with webpack server. Is ignored on CircleCI.
- diffux-new.js
snapshots_folder: ./diffux_snapshots
source_files:
- diffux-old.js
snapshots_folder: ./diffux_snapshots

This is a super hacky-patchy-sketchy version of how far I've gotten with setting up Diffux on CircleCI.

We use Webpack that outputs a file like public/client/1.diffux.0198u2j129832hjf3.js or something so I copy it to ./diffux-old.js and ./diffux-new.js. I also have two yaml files for both runs -- it would be great if we can instead just pass those files as command line options to Diffux. There's also a bug in Diffux, see a comment in circle.yml.

Also, the first couple of lines of circle.yml are not super relevant but I kept them in there as it was stuff I ran into in the last few months so figured it might be useful for you too.

machine:
ruby:
version: 2.2.4
node:
version: 5.5.0 # Latest on https://circleci.com/docs/build-image-precise/#nodejs
checkout:
post:
- npm install -g npm # See https://discuss.circleci.com/t/wrong-npm-version-with-node-5-0-5-1/827
- cp .env.sample .env
dependencies:
post:
# Get previous master build for diffux.
- git checkout `git merge-base HEAD origin/diffux-wip`
- npm run build
- cp public/client/*diffux*.js ./diffux-old.js
- rm public/client/*
- git checkout -
# Regular build
- npm run build # Without WEBPACK_MINIFY, as we want warnings to show up in tests.
- cp public/client/*diffux*.js ./diffux-new.js # Also copy new Diffux file.
test:
override:
- bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml:
parallel: true
files:
- spec/**/*_spec.rb
- npm test
# Run Diffux on diffux-old.js (set in .diffux_ci-old.yaml)
- DIFFUX_CI_CONFIG_FILE=.diffux_ci-old.yaml bundle exec diffux
# Run Diffux on diffux-new.js (set in .diffux_ci-new.yaml)
- DIFFUX_CI_CONFIG_FILE=.diffux_ci-new.yaml bundle exec diffux
# Copy snapshots so we can access them.
# (Will have to fix https://github.com/diffux/diffux_ci/issues/76 for this to work properly…)
- cp -r diffux_snapshots $CIRCLE_ARTIFACTS/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment