From a89d83f2ba3597470867c70e2f6061116b7f0668 Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Tue, 3 Jan 2017 13:53:24 +0000 Subject: [PATCH] Publish to npm on passing builds --- circle.yml | 2 ++ ui/Makefile | 7 ++++++- ui/package.json | 5 ++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index f772ee27..a5dba7c0 100644 --- a/circle.yml +++ b/circle.yml @@ -19,6 +19,7 @@ dependencies: - echo '{"url":"https://eu-ams-1.api.joyent.com","account":"'$SDC_ACCOUNT'","keyId":"c3:30:35:9b:85:48:73:44:31:cc:4b:2e:6a:00:16:e2","name":"eu-ams-1","curr":true}' | triton profile create -f - - triton env --docker eu-ams-1 - mkdir -p ${CIRCLE_TEST_REPORTS}/tap-xunit/ + - echo -e "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc override: - make && make install @@ -31,6 +32,7 @@ deployment: branch: master commands: - ./bin/docker-login + - make -C ui publish - make -j2 build - make -j2 push - ./bin/deploy diff --git a/ui/Makefile b/ui/Makefile index 54a93e9f..777be564 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -48,7 +48,7 @@ build: docker build -t quay.io/yldio/joyent-dashboard-$(NAME) . .PHONY: push -push: +push: publish docker push quay.io/yldio/joyent-dashboard-$(NAME) .PHONY: clean @@ -65,3 +65,8 @@ lint: lint-ci: mkdir -p $(XUNIT_DIR) -$(bindir)/eslint . --format tap | $(XUNIT) $(XUNIT_OUTPUT)-lint.xml + +.PHONY: publish +publish: + npm version 0.0.1-$(CIRCLE_BUILD_NUM) + npm publish --tag alpha --access public diff --git a/ui/package.json b/ui/package.json index 0a7ff530..66d11a7b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,8 +1,7 @@ { - "name": "joyent-portal-ui", - "version": "1.0.0", + "name": "@tomgco/joyent-portal-ui", + "version": "0.0.1-1", "license": "MPL2", - "private": true, "main": "dist/index.js", "scripts": { "start": "cd docs && npm start",