Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into website
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Jul 24, 2020
2 parents fbd53ae + df4d956 commit ca1e052
Show file tree
Hide file tree
Showing 412 changed files with 1,098 additions and 638 deletions.
40 changes: 40 additions & 0 deletions build/clean-symlinks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Clean any symlinks from a pre 4.0 Stratos
// These are no longer used for customization and need to be removed

// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');

function processFile(filepath) {
if (fs.existsSync(filepath)) {
const stats = fs.lstatSync(filepath);
if (stats.isSymbolicLink()) {
console.log(`Removing symlink ${filepath}`);
fs.unlinkSync(filepath);
}
}
}

function processFolder(dir) {
if (!fs.existsSync(dir)) {
return
}
fs.readdirSync(dir).forEach( f => {
let dirPath = path.join(dir, f);
const realPath = fs.realpathSync(dirPath);
const stats = fs.lstatSync(realPath);
if (stats.isDirectory()) {
processFolder(dirPath);
} else {
processFile(dirPath);
}
});
};

processFolder(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'sass'));
processFolder(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'assets'));
processFile(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'favicon.ico'));
28 changes: 0 additions & 28 deletions build/clean-symlinks.sh

This file was deleted.

30 changes: 30 additions & 0 deletions build/dev-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copy files required for developer quick start
// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');

// Only copy files if they are not already there - just make sure initial versions are in place for developer

// Proxy config file
const PROXY_CONF = path.join(STRATOS_DIR, 'proxy.conf.js');
if (!fs.existsSync(PROXY_CONF)) {
let err = fs.copyFileSync(path.join(__dirname, 'proxy.conf.localdev.js'), PROXY_CONF);
if (err) {
console.log(err);
}
}

// config.properties
const BACKEND_DIR = path.join(STRATOS_DIR, 'src', 'jetstream');
const BACKEND_CONF = path.join(BACKEND_DIR, 'config.properties');
const BACKEND_CONF_DEV = path.join(BACKEND_DIR, 'config.dev');
if (!fs.existsSync(BACKEND_CONF)) {
let err = fs.copyFileSync(BACKEND_CONF_DEV, BACKEND_CONF);
if (err) {
console.log(err);
}
}
82 changes: 0 additions & 82 deletions build/fe-build.js

This file was deleted.

14 changes: 0 additions & 14 deletions build/gulp.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions build/prebuild-zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Zip the dist folder
// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');
const AdmZip = require('adm-zip');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');
const DIST_DIR= path.join(STRATOS_DIR, 'dist');
const ZIP_FILE= path.join(STRATOS_DIR, 'stratos-frontend-prebuild.zip');

var zip = new AdmZip();

zip.addLocalFolder(DIST_DIR);
zip.writeZip(path.join(ZIP_FILE));
38 changes: 38 additions & 0 deletions build/store-git-metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Generate the git metadata file

// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');
const execSync = require('child_process').execSync;

// __dirname is the folder where build.js is located
const STRATOS_DIR = path.resolve(__dirname, '..');
const GIT_FOLDER = path.join(STRATOS_DIR, '.git');
const GIT_METADATA = path.join(STRATOS_DIR, '.stratos-git-metadata.json');

function execGit(cmd) {
try {
var response = execSync(cmd);
return response.toString().trim();
} catch (e) {
console.log(e)
return '';
}
}

// We can only do this if we have a git repository checkout
// We'll store this in a file which we will then use - when in environments like Docker, we will run this
// in the host environment so that we can pick it up when we're running in the Docker world
// Do we have a git folder?
if (!fs.existsSync(GIT_FOLDER)) {
console.log(' + Unable to store git repository metadata - .git folder not found');
return;
}
var gitMetadata = {
project: execGit('git config --get remote.origin.url'),
branch: execGit('git rev-parse --abbrev-ref HEAD'),
commit: execGit('git rev-parse HEAD')
};

fs.writeFileSync(GIT_METADATA, JSON.stringify(gitMetadata, null, 2));
2 changes: 1 addition & 1 deletion deploy/stratos-ui-release/packages/backend/pre_packaging
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# Build backend
npm install
export PATH=$PATH:$PWD/node_modules/.bin
npm run bosh-build-backend
npm run build-backend

find ../stratos/deploy -type d ! -path '../stratos/deploy' ! -path '*/db' -maxdepth 1 | xargs rm -rf

Expand Down
Loading

0 comments on commit ca1e052

Please sign in to comment.