Added npm module scripts to CI

This commit is contained in:
jpellizzari
2017-01-24 12:09:26 -08:00
parent a6412f12b2
commit 9acca772a9
7 changed files with 11 additions and 15 deletions

2
.gitignore vendored
View File

@@ -56,4 +56,4 @@ vendor/github.com/ugorji/go/codec/codecgen/bin/*
client/build-external/*
prog/staticui/*
prog/externalui/*
client/dist
client/pkg

View File

@@ -167,6 +167,9 @@ ui-upload: client/build-external/index.html
AWS_SECRET_ACCESS_KEY=$$UI_BUCKET_KEY_SECRET \
aws s3 cp client/build-external/ s3://static.weave.works/scope-ui/ --recursive --exclude '*.html'
ui-build-pkg:
cd client && npm run build-pkg && npm run s3-publish
clean:
$(GO) clean ./...
# Don't actually rmi the build images - rm'ing the .uptodate files is enough to ensure

View File

@@ -75,7 +75,8 @@ deployment:
)) &&
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope &&
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:$(./tools/image-tag) &&
(test -z "${UI_BUCKET_KEY_ID}" || make ui-upload)
(test -z "${UI_BUCKET_KEY_ID}" || make ui-upload) &&
make ui-build-pkg
)
- |
test -z "${QUAY_USER}" || (

2
client/.gitignore vendored
View File

@@ -2,4 +2,4 @@ node_modules
build/
coverage/
test/*png
*.tgz
weave-scope.tgz

View File

@@ -1,6 +1,6 @@
FROM node:6.9.0
WORKDIR /home/weave
COPY package.json post-install /home/weave/
COPY package.json /home/weave/
ENV NPM_CONFIG_LOGLEVEL=warn NPM_CONFIG_PROGRESS=false
RUN npm install
COPY webpack.local.config.js webpack.production.config.js server.js .babelrc .eslintrc .eslintignore /home/weave/

View File

@@ -90,8 +90,8 @@
"scripts": {
"build": "webpack --config webpack.production.config.js",
"build-external": "EXTERNAL=true webpack --config webpack.production.config.js",
"build-pkg": "babel app/scripts --ignore __tests__ --out-dir dist && cp -R app/styles dist",
"install": "./post-install",
"build-pkg": "babel app/scripts --ignore __tests__ --out-dir pkg && cp package.json pkg/ && cp -R app/styles pkg/",
"bundle": "npm pack pkg && mv weave-scope-$npm_package_version.tgz weave-scope.tgz",
"start": "node server.js",
"start-production": "NODE_ENV=production node server.js",
"test": "jest",
@@ -100,7 +100,7 @@
"clean": "rm build/app.js",
"noprobe": "../scope stop && ../scope launch --no-probe --app.window 8760h",
"loadreport": "npm run noprobe && sleep 1 && curl -X POST -H \"Content-Type: application/json\" http://$BACKEND_HOST/api/report -d",
"s3-publish" : "npm pack && aws s3 cp weave-scope-*.tgz s3://weaveworks-npm-modules/weave-scope/ --acl public-read"
"s3-publish": "aws s3 cp weave-scope.tgz s3://weaveworks-npm-modules/weave-scope/ --acl public-read"
},
"jest": {
"transform": {

View File

@@ -1,8 +0,0 @@
#!/bin/bash
pwd=$(pwd)
if [[ $pwd == *"node_modules"* ]]; then
echo "Installed as Node module. Building package..."
npm run build-pkg
else
echo "Installed as stand-alone UI. Skipped building package"
fi