Field Name | Type | Required | Usage | Default Value |
---|---|---|---|---|
servers | array | Yes | Deployment servers [{server,chown,chmod,deployto}] | |
strategy | string | Yes | Deployment strategy, see detailed explanation below | |
maven_params | string | No | Additional Maven parameters | |
deployto | string | No | Default deployment path. Used when “deployto” is not specified in “servers” | |
chmod | string | No | Folder permissions for deployment | 775 |
chown | string | No | User group for the deployment directory | |
name | string | No | Project name | application |
keyfile | string | No | SSH key location | |
keyfilepass | string | No | SSH key password | |
user | string | No | SSH username | Current shell login user |
sudo_user | string | No | SSH username for remote sudo access. Only supported in jumper server mode | |
password | string | No | SSH password. If set, SSH username and password will be used instead of SSH key | |
auth_type | string | No | Authentication type. If empty, it will be detected based on the context | |
repository | string | No | Repository address | If not specified, it will default to the repository address where the deploy.json file is located |
scm_keyfile | string | No | SCM key location | Default: using SSH key |
scm_keyfilepass | string | No | SCM git SSH key password. Used when “auth_type” is “key” | |
scm_username | string | No | SCM username. Used when “scm_authtype” is “password” | |
scm_password | string | No | SCM password. Used when “scm_authtype” is “password” | |
scm_type | string | No | SCM type | git |
scm_authtype | string | No | SCM authentication type (key, password) | key |
stage | string | No | Default stage | |
sudo | boolean | No | Whether to use sudo. If true, it must be passwordless sudo. Avoid using sudo if possible | false |
upload | array | No | Directories to upload | If you need to specify a stage directory, prefix the script name with “@” and specify the stage using “stage:script” |
notify_email | string | No | Email addresses for deployment notification (comma-separated) | |
hooks | json | No | Task hooks: {before: [‘cmd1’, ‘cmd2’, …], after: []}. Use ${deployto} to represent the target path | |
deploy_mode | string | No | Default deployment mode (local, latest). Use “local” for testing/CI and “latest” for independent deployment | local |
custom_build | string | No | Custom build command | |
branch | string | No | Deployment branch name | |
task_dir | string | No | Extended task directory | tasks |
azkaban_url | string | No | Azkaban server URL | Default: read from conf/deploy_config.properties |
azkaban_user | string | No | Azkaban username | |
azkaban_password | string | No | Azkaban password | |
azkaban_job_path | string | No | Azkaban jobs configuration directory | Default: jobs folder in the project code |
description | string | No | Azkaban project description | |
local_repository | string | No | Local repository address. Use “..” if the .git folder is not in the project directory | Default: Look in the current directory, and if not found, look in the parent directory |
build_dir | string | No | When there are multiple projects in the code directory, specify the build folder | Default: Use the current folder name to search for the build folder based on the local .git folder in the parent directory |
shared_assets | array | No | Shared assets configuration [{from, to, create:true}]. If “from” starts with “/”, it is considered relative to the current directory. “to” is the target path, and “create” (optional) indicates whether to create the target path if it doesn’t exist. Default: true | |
link_jar_name | string | No | Soft link name for the target deployment directory | job.jar |
post_deploy_script | string | No | Post-deployment script path. If empty or the script does not exist, it will be skipped | |
current_link | string | No | Target path for the current symlink. Ensure it has the necessary permissions | |
keep_releases | int | No | Number of historical releases to keep | 20 |
tasks | array[] | No | {“cmd”:[””],”name”:”taskName”,”dir”:”/path/execdir”} If “dir” is not specified, it defaults to the project’s current deployment directory. “name” and “cmd” are required | |
parallel | int | No | Parallelism | 1 |
templates | array[object] | No | Template definition: {src, dest, mode} | |
code_patterns | object: includes:[] excludes:[] | No | only work in code strategy for compress code tgz |
Properties can be overridden by environment variables starting with “JD_” (all uppercase). For example, “a_b” can be overridden by “JD_A_B”.
In CI container environments, authentication can be achieved by mounting the SSH-Agent socket. For local environments, password/keyfile authentication is commonly used.
Socks5 Proxy: You can add “proxy=sockproxy.server:proxyport” to ~/.jobdeploy/my.properties to enable support.
{
"sftp":{
"prod": {"pattern": "*.prod.xxxx.com", "prefix": "/Default/prod-xxxx"},
"default" : {"pattern":"*", "prefix": "/Default"}
}
}
{
"var_name": "test",
"test_var" : "test ${var_name}",
"embed_map" : {
"a" : "${test_var}"
},
"list_var" : [
"a", "${test_var}"
]
}
"${env:TEST_NAME}"
"${env:TEST_NAME:default_value}"
deploy stage -D var_name=xxxx
Use JD_ prefix for variables and capitalize words, replace "." with underscore "_"
user.name -> JD_USER_NAME