mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-21 06:20:31 +00:00
Added npm module scripts to CI
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -56,4 +56,4 @@ vendor/github.com/ugorji/go/codec/codecgen/bin/*
|
||||
client/build-external/*
|
||||
prog/staticui/*
|
||||
prog/externalui/*
|
||||
client/dist
|
||||
client/pkg
|
||||
|
||||
3
Makefile
3
Makefile
@@ -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
|
||||
|
||||
@@ -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
2
client/.gitignore
vendored
@@ -2,4 +2,4 @@ node_modules
|
||||
build/
|
||||
coverage/
|
||||
test/*png
|
||||
*.tgz
|
||||
weave-scope.tgz
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user