zowe / explorer-ui-server

Simple HTTPS web server, used by explorer UI plugins
Eclipse Public License 2.0
0 stars 2 forks source link

explorer-ui-server

Quality Gate Status

Provide simple HTTPS server to server Zowe Desktop Explorer plugins.

Start Dev Server

// with key cert
npm start -- -s "jes" -b "/" -d "public" -p "9090" -k "configs/server.key" -c "configs/server.cert"

// with pfx pass
npm start -- -s "jes" -b "/" -d "public" -p "9090" -x "configs/server.pfx" -w "pass"

// with keyring
npm start -- -s "jes" -b "/" -d "public" -p "9090" -n "keyring" -o "keyring-owner" -l "keyring-label"

Then visit https://localhost:9090 to access the test server. The default config file is configs/config-default.json.

CLI Options

$ node src/index.js -h
Usage: explorer-ui-server [options]

Options:
  --version             Show version number                                   [boolean]
  -s, --service         service-for path                                  [default: ""]
  -b, --path            base path uri
  -d, --dir             base dir                         [required] [default: "../app"]
  -p, --port            listening port
  -k, --key             server key                                        [default: ""]
  -c, --cert            server cert                                       [default: ""]
  -x, --pfx             server pfx                                        [default: ""]
  -w, --pass            server pfx passphrase                             [default: ""]
  -n, --keyring         keyring name                                      [default: ""]
  -o, --keyring-owner   keyring owner id                                  [default: ""]
  -l, --keyring-label   keyring certificate label                         [default: ""]
  -f, --csp             csp whitelist ancestors frames                       [required]
  -v, --verbose         show request logs                    [boolean] [default: false]
  -h, --help            Show help                                             [boolean]

Run Tests

npm test

Test reports are saved in reports folder, including JUnit result, Mochawesome report, Istanbul Coverage report, Cobertura report etc.

Run SonarQube Code Analysis

Install SonarQube Scanner.

If you are using Mac, try install with HomeBrew sonar-scanner formula, then update the configuration of SonarQube server at /usr/local/Cellar/sonar-scanner/<version>/libexec/conf/sonar-scanner.properties.

Example scanner configurations:

sonar.host.url=https://jayne.zowe.org:9000
sonar.login=<hash>

Then you can run sonar-scanner to start code analysis.

Build pipeline has embedded the SonarQube code analysis stage.