On the jump server the CLI-suite is installed. It initiates the rollout by notifying the configuration management system that this application deployment is to be initiated. The current source code is loaded from the specified sources and stored on a distributed file system for further processing. |
You need access to jumphost with you personal Openssh access key. Access an environment via OpenSSH or Putty
The general usage instructions for the CLI-suite r3
can be found at CLI-Suite (root360) or at Code Deploy (root360)
Starting the deployment of several roles at the same time (“parallel deployments”) is only possible under these conditions:
|
~$ r3 deploy -h # Response usage: r3 deploy [-h] [-r ROLE] [--init-hook [INITHOOKDIR]] [--pre-hook [PREHOOKDIR]] [--post-hook [POSTHOOKDIR]] [--rev REV] [-n] [-m] [--sanity-check] [--list-roles | --list-sources] [-d] [-q] optional arguments: -h, --help show this help message and exit -r ROLE, --role ROLE Server role to work on --init-hook [INITHOOKDIR] Run initial hook scripts in default path "init-hook.d/" or given directory (optional) --pre-hook [PREHOOKDIR] Run pre-deploy hook scripts in default path "pre-hook.d/" or given directory (optional) --post-hook [POSTHOOKDIR] Run post-deploy hook scripts in default path "post-hook.d/" or given directory (optional) --rev REV Specify tag/branch to clone (git deployment only!) -n, --skip-update Skip update of source code (optional) -m, --skip-deploy Skip distribution of source code (optional) --sanity-check only check the sanity of all components --list-roles List deployable roles and exit --list-sources List source details and exit -d, --debug Run in debug mode. -q, --quiet Run in quiet mode (only errors are shown). |
~$ r3 deploy --list-roles # Response +-------+ | Roles | +-------+ | admin | +-------+ | api | +-------+ | web | +-------+ |
~$ r3 deploy --role YOUR-ROLE |
r3 deploy --list-roles
allows you to see the static configuration for each application/role of the respective environment, e.g. prod.
Role: the name of the role
Deployment Method: names the method (see details below) used
Source: The source repository or path in filesystem used to obtain data from
Branch: In case of Git a branch was named by you during setup. You can overwrite this reference by giving the --rev command line option.
Excludes: If the filesystem is used as source, sometimes files or folders should be excluded from deployment generally or to protect against human error ( e.g. .git/* or /cache)
~$:r3 [instance] deploy --list-sources [--role ROLE] # Response +-------+-------------------+-------------------------------------------------------------+--------+----------+ | Roles | Deployment Method | Source | Branch | Excludes | +-------+-------------------+-------------------------------------------------------------+--------+----------+ | web | git | ssh://gogs@git.root360.de:2222/3rd-party/simple-php-app.git | master | None | +-------+-------------------+-------------------------------------------------------------+--------+----------+ |
The response is presented to the command line directly.
The response is logged to /var/log/application/deploy.log on the JumpServer for downstream analysis.
On each target /var/log/application/deploy.log furthermore locally captures additional process information for deeper downstream analysis.
Exit Codes are returned for programmatic integration e.g. in CI/CD (details can be found below).
2016-01-25 22: 34: 16,087 - deploy.py - INFO - Starting Deploying for role "web" in project "xxxxxxxx" 2016-01-25 22: 34: 16,088 - deploy.py - INFO - Checking out project. ************ 2016-01-25 22: 34: 28.957 - deploy.py - INFO - SourcesTests updated 2016-01-25 22: 34: 29.958 - deploy.py - INFO - Calculating the number of deployed targets. 2016-01-25 22: 34: 31.891 - deploy.py - INFO - Deploying for 2 target (s). 2016-01-25 22: 34: 31.892 - deploy.py - INFO - total: 2, success: 0, fail: 0 ************************************************** ********** **************************** 2016-01-25 22: 39: 00.596 - deploy.py - INFO - total: 2, success: 1, fail: 0 **************************** 2016-01-25 22: 39: 28.673 - deploy.py - INFO - total: 2, success: 2, fail: 0 2016-01-25 22: 39: 28,673 - deploy.py - INFO - Deploy finished without errors |
Method | Authentication | Description |
---|---|---|
git | Private-public-key via SSH | Clones a Git repository over SSH (recommended) |
svn | Username Password | Clones an SVN repository over HTTP / HTTPS |
HTTP / HTTPS | Username Password | Loads packed source code (eg Zip / Tar) |
rsync | Private-public-key via SSH | Synchronizes source code from a server via SSH |
The Deploy script returns different exit codes in case of an error.
These can be read in the shell with the following command, for example:
r3 deploy ...; echo $? |
code | importance | solution |
0 | Deployment was successful |
|
1 | Could not run install.sh | Read the error message (red) accurately and correct the error |
2 | Error updating from project sources | Access to the location of the project sources (eg customer Git servers) |
3 | Failed to determine the number of servers to update | Open the support ticket |
4 | Failed to update servers | Check log file /var/log/application/deploy.log for issues |
5 | Users can not be resolved for hooks | Open support ticket and append Deployment Log at /var/log/application/deploy.log |
6 | A hook terminated with non-zero return code | Check the output of the hook and correct the fault |
7 | There was a global Hook execution error | Check output of hooks and eliminate errors |
8 | No valid hooks found in the specified path | Hook option or at least one valid hook script |
9 | A deployment is already in progress | Check who started a deployment and wait for it to complete |
10 | An unknown error occurred | Open support ticket and append Deployment Log at /var/log/application/deploy.log |
11 | Can not connect to the configuration management system | Open support ticket and append Deployment Log at /var/log/application/deploy.log |
12 | Maximum number (10) achieved at simultaneous deployments | Wait for the ongoing deployments to terminate |
13 | The user canceled the deployment with Ctrl + C | Ask users for the reason and, if necessary, start deployment again |
15 | project is missing and could not be determined | Specify project using '–project' option |
16 | role is missing and could not be determined | Specify role using '–role' option |
17 | given role is unknown | check role given with '–role' option for typos and fix those |
18 | Encountered a timeout while waiting for status messages | Open a support ticket mentioning the used commandline and the whole command output |
19 | Found some minions that cannot be deployed | wait up to 10 minutes and try again |
20 | Got several different states during minion count resulting in deploy stop | check messages returned by the minions and solve the specified issues, if that's not possible contact our support with the output |
21 | Retry limit for getting available port reached | Contact our support with the output and deploy command |
22 | revision is unknown and could not be determined | Revision parameter ( |
23 | unable to detect IP address | Contact our support with the output and deploy command |
Pick one level and also add as tag to page
INTERMEDIATE