Ease set / switch deployment config for JetBrains IDE from config file using node CLI.
Tested on:
- PhpStorm 2016.2 @ macOS Sierra 10.12.1
- PhpStorm 2016.2 @ Windows 10
- WebStorm 2016.3 @ macOS Sierra 10.12.1
Help with testing! Write if it's works or not works in you system.
Require Node.js.
$ npm install ide-deploy-config -g
.idea
folder must be created in project root.
- Go to
Tools - Deployment - Configuration
and create server - Set
Name
for server and access data:FTP host
,Port
,Root path
,Username
,Password
It's all. Mappings and excluded paths will be configured with script.
Buy default script search deploy-config.json
in project root. You can specify path to config file.
$ cd my-project
$ touch deploy-config.json
Also you can run ide-deploy-config init
for create config file.
Content of deploy-config.json
:
{
"dev": {
"serverName": "serverName",
"autoUpload": "Always",
"autoUploadExternalChanges": true,
"mappings": [
{
"deploy": "/",
"local": "$PROJECT_DIR$",
"web": "/"
}
],
"excludedLocal": [
"$PROJECT_DIR$/.idea",
"$PROJECT_DIR$/bower_components",
"$PROJECT_DIR$/node_modules",
"$PROJECT_DIR$/deploy-config.json"
],
"excludedServer": [
"/uploads/"
]
},
"production": {
"serverName": "anotherServerName",
"autoUpload": "Always",
"autoUploadExternalChanges": true,
"mappings": [
{
"deploy": "/",
"local": "$PROJECT_DIR$",
"web": "/"
}
],
"excludedLocal": [
"$PROJECT_DIR$/.idea",
"$PROJECT_DIR$/bower_components",
"$PROJECT_DIR$/node_modules",
"$PROJECT_DIR$/deploy-config.json"
],
"excludedServer": [
"/uploads/"
]
}
}
Set serverName
that exist in IDE deployment configuration.
Go to project root and run script:
Usage
$ ide-deploy-config
$ ide-deploy-config <env>
$ ide-deploy-config <env> <path to config>
Example
$ ide-deploy-config // set first deployment configuration from deploy-config.json
$ ide-deploy-config production // set 'production' deployment configuration from deploy-config.json
$ ide-deploy-config stage configs/deploy.json // set 'stage' deployment configuration from configs/deploy.json
- Set default
notifyRemoteChanges: true
- Rewrite to ES6
- Add multiple mappings config instead serverPath and localPath options.
Breaking change
MIT