A simple project to deploy and run a script
Download
To install a blueprint, follow these steps:
- Download the selected blueprints to your desktop.
- Log in to RapidDeploy and go to ‘Menu’ -> ‘Resources’ -> ‘Projects’
- Click the ‘Upload Project’ button in the top right of the project list panel.
- Select the file you downloaded and then follow the on-screen instructions!
The link below will download the Hello World blueprint to your desktop
Project overview.
Here is a summary of what this project will achieve.
This project is designed to deploy a script onto a server, and then run it. The server can be Windows or Linix, and the script run will be a Windows bat file or Linux shell script as needed.
Four target environments are configured in the project (two for windows and two for Linux).
Taking the Linux example, the two environments demonstrate how the project payload (hellowWorld.sh script) is generic, and is parameterised differently in each of the target environments. One environment sets the parameters for a Square, and the other for a Circle (Shape, colour, number of sides).
The parameters are passed to the script as command line arguments AND as environment variables.
When you run the project for each of the environments, view the logs once the deployment is finished, and see how the scripts echo out the different command line parameters and environment variables.
What is preconfigured and demonstrated.
- Target servers for Windows and Linux using localhost
- Use of the Remote agent plugin
- Windows batch file or shell script depending on target
- Environment variables per environment
- Command Line arguments per environment
- ScriptRunner, Copy and Echo tasks
- Environment specific Data Dictionary items
- Use of built in variables such as ${ARCHIVE_ROOT}, ${MV_UUID}, ${MV_DATE_MILLIS}
How to use this project.
- Download the project to your desktop by clicking on one of the links. The file will be saved as SCRIPT_DEMO_40.zip
- Log into your RapidDeploy instance as mvadmin.
- Navigate to Resources-> Projects.
- In the top right hand corner click on the Upload Project button.
- Select the zip file you downloaded in step 1.
- You are guided through a project import wizard. The important thing to check and change (if necessary) here is the path to the project storage directory. Ideally this should be under the projects directory in your RapidDeploy installation. E.g.
-
/usr/midvision/projects/SCRIPT_DEMO_40
-
- Once the project is imported, you’ll need to create a package to deploy.
- Firstly, navigate to Resources-> Projects and edit the project (pencil icon on the tool menu).
- Navigate to the Packages tab and click the Create Package button. A new package is created with a version number. This is the package you’ll deploy later, containing all the environment definitions, actions and paylod (scripts) to allow the jobs to be run on all defined servers.
- Over time, as you update the configuration or payload (script), you’ll create more packages, which are a versioned snapshot of the configuration and payload at the time they are created.
- Now you can run a new job to the environment of your choice.
- Navigate to Jobs-> New Job.
- Double click on the ‘Empty’ project job box, and select the project you created earlier from the droplist.
- Select the Target you want to deploy from the droplist.
- Select the Version (package version) you want to deploy from the droplist.
- Since there is only one package, it is preselected. The latest package will always be preselected by default.
- Click on the Run button in the bottom right corner, enter a comment for this run and click and click Yes .
- The deployment is started. Click on the Running Jobs icon in the top right corner and you see the tasks executed and job log in real time.
Further Reading
- Explore the Hello World Project
- ScriptRunnerTask from the Scripts management plugin
- CopyTask from the Folder management plugin
- EchoTask from core orchestration
- Use of Built In Variables
- YouTube video demonstrating this project.
Reviews
There are no reviews yet.