Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop buildsuite #6

Merged
merged 96 commits into from Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a02f78e
davos main package
Feb 4, 2017
b99b7a6
change indent style to space
popjelev Apr 11, 2017
d43e128
remove airbnb eslint and set a default one
popjelev Apr 11, 2017
de65c4b
correct linting
popjelev Apr 11, 2017
a51272e
add some eslint rules
popjelev Apr 11, 2017
ac07d32
make davos as a library
popjelev Apr 11, 2017
7b2510c
increment package version
popjelev Apr 11, 2017
d24391a
Merge pull request #3 from ForkPoint/refactoring
k2kirov Apr 11, 2017
f4f9f85
ignoring some folders while scanning for cartriges
popjelev Apr 11, 2017
1f90230
move class variables inside the class (where they belong)
popjelev Apr 11, 2017
990eaa4
prettify the configuration
popjelev Apr 11, 2017
82293b6
code formatting and some refactoring
popjelev Apr 11, 2017
e95a168
refactoring webdav
popjelev Apr 12, 2017
24bce3a
remove unused variable
popjelev Apr 12, 2017
3c5e27f
Merge pull request #4 from ForkPoint/refactoring
popjelev Apr 12, 2017
e08cc7e
change default config name to davos.json
popjelev Apr 12, 2017
ff47996
Merge branch 'change-default-config-name' into develop
popjelev Apr 12, 2017
505a40e
moving script settings outside
popjelev Apr 12, 2017
b679a9b
refactoring nasty recursion for getCartridges
popjelev Apr 13, 2017
8919300
normalize var names
popjelev Apr 13, 2017
a1eee69
new method: isValidCartridgePath
popjelev Apr 13, 2017
a39cb12
add zipping all cartridge folders at once
popjelev Apr 13, 2017
3c12eaf
add @todo
popjelev Apr 18, 2017
a709af1
add deleteCartridges method and clean up some of the previous defined…
popjelev Apr 18, 2017
95848b7
removing info line
popjelev Apr 18, 2017
2ffac56
removing possible wrong method
popjelev Apr 18, 2017
263858f
fix todo prefix
popjelev Apr 18, 2017
5bc9113
Merge branch 'upload-all-cartriges-as-one-zip' into develop
popjelev Apr 18, 2017
047c9da
refactoring webdav as a class
popjelev Apr 18, 2017
ee73b5c
adding basic comments
popjelev Apr 18, 2017
1eb8a38
add login and activateCodeVersion versions
popjelev Apr 18, 2017
64f493e
fix var declarations
popjelev Apr 18, 2017
ea8fa2f
add activate code version
popjelev Apr 18, 2017
019d3e9
rename zipCartriges to compress
popjelev Apr 18, 2017
68d98cc
remove obsolete methods
popjelev Apr 18, 2017
915fa57
add empty method compressMeta
popjelev Apr 18, 2017
b2d6cbb
Merge branch 'create-http-requests' into develop
popjelev Apr 18, 2017
dac920d
refactoring config which is now ConfigManager
popjelev Apr 19, 2017
ac1833d
Merge branch 'refactor-config' into develop
popjelev Apr 19, 2017
77c9b08
fix declaration of fileContent
popjelev Apr 19, 2017
f95391f
Merge branch 'refactor-config' into develop
popjelev Apr 19, 2017
ed173b9
fix erroreous method name
popjelev Apr 19, 2017
2d6f54c
Merge branch 'refactor-config' into develop
popjelev Apr 19, 2017
fe92988
fix erroreous method call
popjelev Apr 19, 2017
d121bb9
Merge branch 'refactor-config' into develop
popjelev Apr 19, 2017
79a7c4e
refactor ConfigManager to instance one if being instanced
popjelev Apr 20, 2017
0ac0145
refactor upload promise chain to be in correct way
popjelev Apr 20, 2017
810a532
add replaceTemplateInfo
popjelev Apr 20, 2017
323556d
refactoring webdav do request to be event based
popjelev Apr 20, 2017
b31d6bd
add node-readme generator
popjelev Apr 20, 2017
c1c52d2
add readme.md template
popjelev Apr 20, 2017
6bc4f03
renaming upload/zip methods
popjelev Apr 21, 2017
4dffcda
basic bm tools
popjelev Apr 21, 2017
b888b7e
yet another refactoring: merge doRequest into one class
popjelev Apr 24, 2017
154ee0f
add bm tools to webdav
popjelev Apr 24, 2017
ac49924
make proper activate codeversion method
popjelev Apr 24, 2017
f1a5f9f
move activateVersion above watch
popjelev Apr 24, 2017
719f897
fix webdav options object merge
popjelev Apr 24, 2017
cf50991
refactor compressMeta (using new library)
popjelev Apr 24, 2017
19b967d
replacing walk library with globby
popjelev Apr 24, 2017
437e908
request manager will handle http requests
popjelev Apr 25, 2017
ed045db
add more logging
popjelev Apr 25, 2017
5d5db8b
change uploadCartridge error to be debug
popjelev Apr 25, 2017
74c4d2b
fully sync promise queue
popjelev Apr 25, 2017
870fbfe
add validation of cartridge array
popjelev Apr 25, 2017
d0305c8
remove debug info
popjelev Apr 25, 2017
7ac26fd
move info to promise resolve event
popjelev Apr 25, 2017
97af219
remove deleteCartridges as its being unused
popjelev Apr 25, 2017
5c9d381
add upload/delete sites meta
popjelev Apr 25, 2017
f2d5461
fix logic
popjelev Apr 25, 2017
42fccc5
revert back isLoggedIn logic
popjelev Apr 26, 2017
4d08f71
add login and importSites (not completed) methods
popjelev Apr 26, 2017
d0446b7
add archiveName as parameter for importSites()
popjelev Apr 26, 2017
b6d0729
fix bmtools (add missing libs and refactor)
popjelev Apr 26, 2017
46d8182
add compress() functionality to make site meta archive compatible wit…
popjelev Apr 26, 2017
fa9fc0c
create constant for sites meta folder
popjelev Apr 26, 2017
33ba418
bugfix
popjelev Apr 26, 2017
24b04ab
change error level for reject promises
popjelev Apr 26, 2017
1db99af
add external cookie jar
popjelev Apr 26, 2017
a820d79
add retrying on import monitor
popjelev Apr 27, 2017
c921a89
error fixes
popjelev Apr 27, 2017
b765d25
add isValidRequest to bm-tools
popjelev Apr 27, 2017
32fde1a
add validation if file is valid for site import
popjelev Apr 27, 2017
ca48a32
change error message
popjelev Apr 27, 2017
3e14cf1
create delete file method so it can be used from grunt or other
popjelev Apr 28, 2017
e7d0683
added missing required http headers
manix Oct 25, 2017
182a97e
progress on importMeta
manix Oct 25, 2017
e41d34f
added uploadMeta functionality, added temp folder customization
manix Oct 26, 2017
bd3017c
added splitMetaBundle method
manix Oct 30, 2017
af8c36a
split and merge library files
manix Oct 31, 2017
bbda389
hotfix lib split proper string replacement
manix Oct 31, 2017
d87ef37
fixed webdav put paths
manix Oct 31, 2017
c010e07
refactored split functions
manix Nov 1, 2017
5882da6
unified merge functionality in a single function
manix Nov 10, 2017
2e04142
convert from options to parameters
manix Nov 13, 2017
ea8de96
hotfix globby path in merge
manix Nov 13, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 44 additions & 0 deletions .README.md
@@ -0,0 +1,44 @@
# ${pkg.name}

${badge('npm')} ${badge('npm-license')} ${badge('github-issues')} ${badge('circleci')}

${pkg.description}

${badge('nodei')}

${badge('travis-status')}
${badge('github-stars')}
${badge('github-forks')}

${badge('github-forks')}

${badge('dependencies')}
${badge('devDependencies')}

## Features


## Install

`npm install --save ${pkg.name}`


## Scripts

${scripts()}

## Dependencies

${dependencies()}

## Contributing

Contributions welcome; Please submit all pull requests against the master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Please check the [Contributing Guidelines](contributng.md) for more details. Thanks!

## Author

${author()}

## License

${license()}
2 changes: 1 addition & 1 deletion .editorconfig
@@ -1,7 +1,7 @@
root = true

[*]
indent_style = tab
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
24 changes: 20 additions & 4 deletions .eslintrc.js
@@ -1,6 +1,22 @@
module.exports = {
"extends": "airbnb-base",
"ecmaVersion": 6,
"ecmaFeatures": {
"modules": true,
"module": true
},
"env": {
"mocha": true,
"node": true,
"es6": true
},
"plugins": [
"import"
]
};
"babel",
"import",
"mocha"
],
"extends": "eslint:recommended",
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"]
}
};
95 changes: 10 additions & 85 deletions index.js
@@ -1,90 +1,15 @@
#!/usr/bin/env node
/*jshint esversion: 6 */
process.env.UV_THREADPOOL_SIZE = 128;
(function(){
'use strict';

const davos = require('./src/davos'),
config = require('./src/config'),
fs = require('fs'),
chalk = require('chalk'),
log = require('./src/logger'),
path = require('path');
process.env.UV_THREADPOOL_SIZE = 128;

var configuration,
activeConfig,
argv,
isNewConfigOrHelp = process.argv[2] === 'create' || process.argv[2] === undefined || process.argv[2] === '-h' || process.argv[2] === '--help';
if (config.isConfigExisting() || isNewConfigOrHelp) {
var configPath = path.join(process.cwd(), config.getConfigName());
if (!isNewConfigOrHelp) {
configuration = config.loadConfiguration();
(function () {
'use strict';

//there was a problem retrieving the config file
if(!!!configuration) {
log.error(chalk.red(`\nConfiguration ${configPath} cannot be read.`));
return;
}
var activeProfile = configuration.find(x => x.active === true);
if(!!!activeProfile) {
log.error(chalk.red(`\nThere is no active profile in your configuration ${configPath}`));
return;
}
activeConfig = activeProfile.config;
}
argv = require('yargs')
.usage('Usage: davos [command] [options]')
.command('create', 'Creates a config file')
.command('insert', 'Adds a new profile to the config file')
.command('list', 'Lists all profiles')
.command('edit', 'Edit profile in the config file')
.command('switch', 'Switch to a specified profile')
.command('sync', 'Sync the cartridges on the server with your local cartridges', function(yargs) {
return yargs.config(activeConfig);
}).command('upload', 'Upload cartredges', function(yargs) {
return yargs.config(activeConfig);
}).command('watch', 'Watch cartredges for changes', function(yargs) {
return yargs.config(activeConfig);
})
.example('davos create', 'create the config file')
.example('davos insert', 'insert new profile in the config file')
.example('davos list', 'list profiles in the config file')
.example('davos edit --profile [name of profile]', 'edit the specified profile in the config file')
.example('davos switch --profile [name of profile]', 'switch to specified profile in the config file')
.example('davos sync', 'update your active profile\'s cartridges in the config file with the local cartridges. It will also ask you if you wish to delete the cartridges on the server that do not exist in your local cartridges')
.example('davos upload <optional>--cartridge [path to cartridge]</optional>', 'upload all cartridges from your configuration or a specific single cartridge from your local cartridges')
.example('davos watch <optional>--cartridge [path to cartridge]</optional>', 'watch all cartridges from your configuration for changes or a specific single cartridge from your local cartridges')
.config(activeConfig)
.options({
'profile': {
alias: 'P',
describe: 'Profile to activate'
},
'cartridge': {
alias: 'c',
describe: 'Cartridge to upload/watch.'
},
'username': {
alias: 'u',
describe: 'Username of your Sandbox'
},
'password': {
alias: 'p',
describe: 'Password of your Sandbox'
},
'hostname': {
alias: 'H',
describe: 'Sandbox URL'
},
'verbose': {
describe: 'verbose'
},
})
.help('h')
.alias('h', 'help')
.argv;
davos(argv);
} else {
log.error(chalk.red(`\nCannot find configuration in ${process.cwd()}`));
}
module.exports = {
Core: require('./src/davos'),
ConfigManager: require('./src/config-manager'),
Logger: require('./src/logger'),
BM: require('./src/bm'),
WebDav: require('./src/webdav')
};
}());