Overview
The rocken_deploy script is designed to simplify the procedure for deploying applications (api, crm, talent, ui-lib and rockenjobs) from GitLab to a sandbox environment. The script comes with a help command to guide users through available options. Below is a step-by-step guide.
Step 1: Log In to the Droplet
-
Use SSH to connect to the droplet. Ensure you are connected to the corporate VPN.
ssh root@<YouSandboxHostName>
change
<YouSandboxHostNameto the IP or Host Name sent by DevOps engineer.
Step 2: Display Help
Run the script with the -h or --help option to display all available commands and their descriptions:
rocken_deploy --help
Step 3: Execute Commands
Below are common use cases for the script:
-
Deploy All Applications with empty DB:
rocken_deploy -d
This command removes all the apps and their conf files and deploys all applications on the droplet.
-
Restore DB backup:
rocken_deploy -i
This command imports one of the existing backups into the database
-
Backup DB:
rocken_deploy -e
This command takes a dump of an existing database
-
Update One Application
rocken_deploy -u
This command updates one specific application
-
Delete All:
rocken_deploy -r
This command deletes all application folders and docker containers
-
Display Available Application Links:
rocken_deploy -s
Run the Setup Script:
Start the script execution. The following prompts will appear:
-
Token Input: The token can be retrieved securely from your password manager, which ensures the script operates with the correct credentials.
-
Branch Name Inputs: For each application (
api,crm,talent,ui-lib,rockenjobs), the script will ask for the branch name. Enter the name of the branch, or simply press Enter to use themainbranch as the default. -
Import Database: you will see a list of existing database dumps. Select the desired dump by typing its name in the appropriate line and pressing the Enter button.
-
Export Database: when executed, the dump will be saved with a filename based on the current date, ensuring easy identification and organization of backups.
"Use only the token that is provided in the password manager – otherwise, the script will fail. This is the best practice from a security perspective."
Link to a page describing the sandbox settings can be found here – Setting up SandBox



