-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into website
- Loading branch information
Showing
412 changed files
with
1,098 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.