Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
use occ for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Feb 19, 2019
2 parents f451e39 + 6801331 commit ff92677
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1,491 deletions.
85 changes: 23 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,36 @@
version: 2

# References to reduce duplication in the rest of the config
references:
container: &container_config
docker:
- image: circleci/node:8
cache_key: &cache_key
dependency-cache-{{ checksum "package.json" }}
cache_node_modules: &cache_node_modules
save_cache:
key: *cache_key
paths:
- node_modules
restore_node_modules: &restore_node_modules
restore_cache:
keys:
- *cache_key

# Circle jobs
jobs:

# Ensure that the image set manifest is in place
manifest:
<<: *container_config
test:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- *restore_node_modules
- run:
name: Install dependencies
command: npm install
- *cache_node_modules
- run:
name: Build the image set manifest
command: ./node_modules/.bin/oist build-manifest --scheme ${IMAGESET_SCHEME} --source-directory=${IMAGESET_SOURCE_DIRECTORY}
- run:
name: Commit and push the manifest changes
command: >
if [ ! "$(git status --porcelain)" == "" ]; then
git config --global user.email "origami.support@ft.com";
git config --global user.name "origamiserviceuser [bot]";
git commit imageset.json -m 'Update image manifest [ci skip]';
git push origin master;
fi
# Publish the image set to S3
publish:
<<: *container_config
- run: npm config set prefix "$HOME/.local"
- run: npm i -g origami-build-tools@^7
- run: $HOME/.local/bin/obt install
- run: $HOME/.local/bin/obt demo --demo-filter pa11y --suppress-errors
- run: $HOME/.local/bin/obt verify
- run: $HOME/.local/bin/obt test
- run: git clean -fxd
- run: npx occ 0.0.0
- run: $HOME/.local/bin/obt install --ignore-bower
- run: $HOME/.local/bin/obt test --ignore-bower
publish_to_npm:
docker:
- image: circleci/node:10
steps:
- checkout
- *restore_node_modules
- run:
name: Publish to EU bucket
command: ./node_modules/.bin/oist publish-s3 --bucket origami-imageset-data-eu --scheme ${IMAGESET_SCHEME} --source-directory=${IMAGESET_SOURCE_DIRECTORY} --scheme-version $CIRCLE_TAG
- run:
name: Publish to US bucket
command: ./node_modules/.bin/oist publish-s3 --bucket origami-imageset-data-us --scheme ${IMAGESET_SCHEME} --source-directory=${IMAGESET_SOURCE_DIRECTORY} --scheme-version $CIRCLE_TAG

# Circle workflows
- run: npx occ ${CIRCLE_TAG##v}
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > $HOME/.npmrc
- run: npm publish --access public
workflows:
version: 2
manifest-and-publish:
test:
jobs:
- manifest:
- test
- publish_to_npm:
filters:
branches:
only: master
tags:
ignore: /.*/
- publish:
filters:
only: /^v.*/
branches:
ignore: /.*/
tags:
only: /v.*/
3 changes: 3 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "logo-images"
}
Loading

0 comments on commit ff92677

Please sign in to comment.