This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
150 additions
and
37 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
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
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
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
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
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
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
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
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
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
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
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,70 @@ | ||
#!/usr/bin/env node | ||
|
||
var ghpages = require('gh-pages'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var args = require('yargs') | ||
.boolean('p') | ||
.default('p', false) | ||
.alias('p', 'push') | ||
.describe('p', 'Push changes to remote repository, i.e. do an actual publish') | ||
.alias('v', 'version') | ||
.describe('v', 'semver version to publish the app as') | ||
.demandOption(['p']) | ||
.demandCommand(1) | ||
.usage('Usage: $0 <app name> -p ') | ||
.argv; | ||
|
||
// Debug tooling | ||
process.env.NODE_DEBUG = 'gh-pages'; | ||
|
||
// get version from lerna global version | ||
var version = args.version || require(path.resolve(__dirname, '../lerna.json')).version; | ||
var appName = args._[0]; | ||
|
||
var appInfo = { | ||
server: { | ||
path: 'demo/server', | ||
repo: 'git@github.com:feedhenry-templates/wfm-server.git' | ||
}, | ||
mobile: { | ||
path: 'demo/mobile', | ||
repo: 'git@github.com:feedhenry-templates/wfm-portal.git' | ||
}, | ||
portal: { | ||
path: 'demo/portal', | ||
repo: 'git@github.com:feedhenry-templates/wfm-mobile.git' | ||
}, | ||
}; | ||
|
||
var target = appInfo[appName]; | ||
|
||
if(!target || !fs.existsSync(target.path)) { | ||
console.error('module ' + appName + ' not found!'); | ||
} | ||
|
||
var options = { | ||
branch: version, | ||
dotfiles: true, | ||
//Only add, and never remove existing files | ||
add: true, | ||
remote: 'origin', | ||
repo: target.repo, | ||
user: { name: "Wojciech Trocki", email: "wtrocki@redhat.com" }, | ||
tag: 'release-' + appName + "-" + version, | ||
// Commit message | ||
message: "Release " + appName + " at version: " + version, | ||
// Do not push (we will need to review and run tests before) | ||
push: args.push | ||
}; | ||
|
||
console.info('Publishing contents of ' + target.path + | ||
' to remote ' + target.repo); | ||
|
||
ghpages.publish(target.path, options, function(err) { | ||
if (err) { | ||
console.info("Finished with error ", err); | ||
} else { | ||
console.info("Finished with success "); | ||
} | ||
}); |
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,34 @@ | ||
#!/bin/bash | ||
set -e | ||
containerId=$(docker run -itd -p 0:4873 verdaccio/verdaccio) | ||
|
||
# get random assined port | ||
port=$(docker port $containerId | awk -F ':' '{print $2}') | ||
echo "Started local npm registry" | ||
registry="http://localhost:$port" | ||
|
||
# adduser doesn't allow cli params, use stdin hack | ||
npm adduser --registry=$registry <<EOF | ||
test-user | ||
testPwd | ||
test@test.com | ||
EOF | ||
|
||
echo "Beginning publish test" | ||
npm run publish:prepare | ||
lerna publish --skip-git --canary --yes --registry=$registry | ||
|
||
echo "Publishing finished, reverting version changes..." | ||
git checkout cloud/ demo/ client/ | ||
|
||
# kill container if in CI, else open in browser | ||
# travis sets CI=true by default | ||
if [ -n "$CI" ]; | ||
then | ||
docker kill $containerId | ||
docker rm $containerId | ||
else | ||
# cross-platform `open` command | ||
# requires `npm i -g opn-cli` if not running as npm script | ||
opn $registry | ||
fi |