mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-05 04:20:33 +03:00
Get rid of bash
This commit is contained in:
parent
f2b1ba8cda
commit
82060357c7
32
build/prepare_deploy.js
Executable file
32
build/prepare_deploy.js
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
require('shelljs/global');
|
||||
|
||||
var paths = require('./paths');
|
||||
var path = require('path');
|
||||
|
||||
// copy old releases
|
||||
mkdir('-p', '.ghpages-tmp');
|
||||
cd('.ghpages-tmp');
|
||||
|
||||
// reset local changes before checkout
|
||||
exec('git reset --hard');
|
||||
exec('git fetch origin gh-pages:gh-pages');
|
||||
exec('git checkout gh-pages');
|
||||
cp('-R', '../releases/*', '.');
|
||||
exec('git checkout @{-1}');
|
||||
cd('..');
|
||||
|
||||
// build
|
||||
exec('npm run build-dist');
|
||||
cd('demo');
|
||||
mkdir('-p', 'dist');
|
||||
cp('-R', '../dist/*', './dist/');
|
||||
mkdir('-p', 'releases');
|
||||
cp('-R', '../.ghpages-tmp/*', './releases/');
|
||||
cd('..');
|
||||
var version = 'v' + require(path.join(__dirname, '../package.json')).version + '/';
|
||||
var versionDir = path.join(paths.releases, version);
|
||||
mkdir('-p', versionDir)
|
||||
cp(paths.redocBuilt + '.min.js', versionDir);
|
||||
cp(paths.redocBuilt + '.min.js', path.join(paths.releases, 'latest/'));
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
# copy old releases
|
||||
mkdir -p .ghpages-tmp && cd .ghpages-tmp
|
||||
# reset local changes before checkout
|
||||
git reset --hard
|
||||
git fetch origin gh-pages:gh-pages
|
||||
git checkout gh-pages
|
||||
cp -R ../releases/* .
|
||||
git checkout @{-1}
|
||||
cd -
|
||||
|
||||
# build
|
||||
npm run build-dist
|
||||
cd demo
|
||||
cp -R ../dist/* ./dist/
|
||||
mkdir -p releases
|
||||
cp -R ../.ghpages-tmp/* ./releases/
|
||||
cd -
|
||||
gulp copy-version
|
13
build/run_tests.js
Executable file
13
build/run_tests.js
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
require('shelljs/global');
|
||||
set('-e');
|
||||
|
||||
if (process.env.JOB === 'e2e-guru') {
|
||||
exec('npm run e2e');
|
||||
} else {
|
||||
exec('npm run unit');
|
||||
console.log('Starting Basic E2E');
|
||||
exec('npm run e2e');
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
if [ "$JOB" = "e2e-guru" ]; then
|
||||
npm run e2e
|
||||
else
|
||||
npm run unit
|
||||
echo "Starting Basic E2E"
|
||||
npm run e2e
|
||||
fi
|
|
@ -8,14 +8,14 @@
|
|||
},
|
||||
"main": "dist/redoc.min.js",
|
||||
"scripts": {
|
||||
"test": "gulp lint && ./build/run_tests.sh",
|
||||
"test": "gulp lint && node ./build/run_tests.js",
|
||||
"jspm-install": "jspm install",
|
||||
"start": "gulp serve",
|
||||
"build-dist": "gulp build --prod",
|
||||
"branch-release": "git reset --hard && branch-release",
|
||||
"unit": "gulp test",
|
||||
"e2e": "gulp e2e --prod",
|
||||
"deploy": "build/prepare_deploy.sh && deploy-to-gh-pages demo"
|
||||
"deploy": "node ./build/prepare_deploy.js && deploy-to-gh-pages demo"
|
||||
},
|
||||
"keywords": [
|
||||
"OpenAPI",
|
||||
|
|
Loading…
Reference in New Issue
Block a user