From 30d2aeb6a362e81a4c304a50344a4be824a66529 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Tue, 14 Sep 2021 13:26:26 +0200 Subject: [PATCH] Update build commands (#1180) --- .github/workflows/build.yml | 6 +++--- .github/workflows/deploy.yml | 2 +- .github/workflows/release.yml | 2 +- README.md | 10 +++------- package.json | 34 ++++++++++++++++------------------ 5 files changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a122627a9..66664eeb98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,7 +107,7 @@ jobs: echo -e "# Building Web\n" echo "Building app" echo "npm version $(npm --version)" - npm run dist:selfhost + npm run dist:bit:selfhost echo -e "\nBuilding Docker image" docker --version @@ -200,7 +200,7 @@ jobs: jq --arg version "$VERSION - ${GITHUB_SHA:0:7}" '.version = $version' package.json > package.json.tmp mv package.json.tmp package.json - npm run build:qa + npm run build:bit:qa echo "{\"commit_hash\": \"$GITHUB_SHA\", \"ref\": \"$GITHUB_REF\"}" | jq . > build/info.json @@ -285,4 +285,4 @@ jobs: run: npm install - name: NPM build - run: npm run build:cloud + run: npm run build:bit:cloud diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 95dd9242a4..7496eed1a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -52,7 +52,7 @@ jobs: run: | npm run sub:init npm ci - npm run dist + npm run dist:bit:cloud - name: Deploy GitHub Pages uses: crazy-max/ghaction-github-pages@db4476a01402e1a7ce05f41832040eef16d14925 # v2.5.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 974e6db6b4..30693e8eb3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -132,7 +132,7 @@ jobs: echo "Building app" echo "npm version $(npm --version)" npm install - npm run dist:selfhost + npm run dist:bit:selfhost echo -e "\nBuilding Docker image" docker --version diff --git a/README.md b/README.md index b22e9c57f9..740d8ac101 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ For local development, run the app with: ``` npm install -npm run build:watch +npm run build:oss:watch ``` You can now access the web vault in your browser at `https://localhost:8080`. @@ -41,7 +41,7 @@ If you want to point the development web vault to the production APIs, you can r ``` npm install -ENV=production npm run build:watch +ENV=production npm run build:oss:watch ``` You can also manually adjusting your API endpoint settings by adding `config/local.json` overriding any of the following values: @@ -60,11 +60,7 @@ You can also manually adjusting your API endpoint settings by adding `config/loc } ``` -Where the `urls` object is defined by the [Urls type in jslib](https://github.com/bitwarden/jslib/blob/master/common/src/abstractions/environment.service.ts). To pick up the overrides in the newly created `config/local.json` file, run the app with: - -``` -npm run build:dev:watch -``` +Where the `urls` object is defined by the [Urls type in jslib](https://github.com/bitwarden/jslib/blob/master/common/src/abstractions/environment.service.ts). ## Contribute diff --git a/package.json b/package.json index c86ce6e3cf..24aff41ab7 100644 --- a/package.json +++ b/package.json @@ -11,26 +11,24 @@ "symlink:win": "rm -rf ./jslib && cmd /c mklink /J .\\jslib ..\\jslib", "symlink:mac": "npm run symlink:lin", "symlink:lin": "rm -rf ./jslib && ln -s ../jslib ./jslib", - "build": "gulp prebuild && webpack -c bitwarden_license/webpack.config.js", "build:oss": "gulp prebuild && webpack", - "build:watch": "gulp prebuild && webpack serve -c bitwarden_license/webpack.config.js", - "build:watch:oss": "gulp prebuild && webpack serve", - "build:dev": "cross-env ENV=development npm run build", - "build:dev:watch": "cross-env ENV=development npm run build:watch", - "build:qa": "cross-env NODE_ENV=production ENV=qa npm run build", - "build:cloud": "cross-env NODE_ENV=production ENV=cloud npm run build", - "build:cloud:oss": "cross-env NODE_ENV=production ENV=cloud npm run build:oss", - "build:selfhost": "cross-env ENV=selfhosted npm run build:watch", - "build:selfhost:watch": "cross-env ENV=selfhosted npm run build:watch", - "build:selfhost:prod": "cross-env ENV=selfhosted NODE_ENV=production npm run build", - "build:selfhost:prod:oss": "cross-env ENV=selfhosted NODE_ENV=production npm run build:oss", + "build:bit": "gulp prebuild && webpack -c bitwarden_license/webpack.config.js", + "build:oss:watch": "gulp prebuild && webpack serve", + "build:bit:watch": "gulp prebuild && webpack serve -c bitwarden_license/webpack.config.js", + "build:bit:dev": "cross-env ENV=development npm run build:bit", + "build:bit:dev:watch": "cross-env ENV=development npm run build:bit:watch", + "build:bit:qa": "cross-env NODE_ENV=production ENV=qa npm run build:bit", + "build:bit:cloud": "cross-env NODE_ENV=production ENV=cloud npm run build:bit", + "build:oss:selfhost:watch": "cross-env ENV=selfhosted npm run build:oss:watch", + "build:bit:selfhost:watch": "cross-env ENV=selfhosted npm run build:bit:watch", + "build:oss:selfhost:prod": "cross-env ENV=selfhosted NODE_ENV=production npm run build:oss", + "build:bit:selfhost:prod": "cross-env ENV=selfhosted NODE_ENV=production npm run build:bit", "clean:l10n": "git push origin --delete l10n_master", - "dist": "npm run build:cloud && gulp postdist", - "dist:oss": "npm run build:cloud:oss && gulp postdist", - "dist:selfhost": "npm run build:selfhost:prod && gulp postdist", - "dist:selfhost:oss": "npm run build:selfhost:prod:oss && gulp postdist", - "deploy": "npm run dist && gh-pages -d build", - "deploy:dev": "npm run dist && gh-pages -d build -r git@github.com:kspearrin/bitwarden-web-dev.git", + "dist:bit:cloud": "npm run build:bit:cloud && gulp postdist", + "dist:oss:selfhost": "npm run build:oss:selfhost:prod && gulp postdist", + "dist:bit:selfhost": "npm run build:bit:selfhost:prod && gulp postdist", + "deploy": "npm run dist:bit && gh-pages -d build", + "deploy:dev": "npm run dist:bit && gh-pages -d build -r git@github.com:kspearrin/bitwarden-web-dev.git", "lint": "tslint 'src/**/*.ts' 'bitwarden_license/src/**/*.ts' || true", "lint:fix": "tslint 'src/**/*.ts' 'bitwarden_license/src/**/*.ts' --fix" },