This ‘First Hour’ tutorial introduces you to the most basic concepts behind DeployHub. You’ll  know how to create all the objects required for a deployment of files from source to target.

First Hour Tutorial Setup Instructions

Setup For SaaS Users:

Creating a Repository of text files in a directory on the Docker Host for the Reverse Proxy: In order for the Reverse Proxy to see the text files, you need to mount a Docker Volume to expose those to the Reverse Proxy file system. For installing your Reverse Proxy and mounting a Docker Volume see https://www.deployhub.com/reverse-proxy-setup/.


In the Docker Volume, create 2 directories:

/home/reuser

/target

Place several text (.txt) files into the /home/reuser directory. You should now be ready to proceed to Step 1 below.


Setup For On Premise Users:

We will be using a very simple example which includes creating a Repository of text files in a directory on a Linux server, and deploying the files from that server onto the same server in a different directory. If you haven’t already, install DeployHub on a Linux server. For On Premise instructions see https://www.deployhub.com/deployhub-pro-on-prem-installation/.


On the Linux Server, create 2 directories:

/home/reuser

/target

Place several text (.txt) files into the /home/reuser directory. You should now be ready to proceed to Step 1 below.

Step 1 - Create a Domain

  • Click on the “Domains” menu.
  • Right click on your Site Domain under the “Domains” tab. If you are a SaaS user, your Site Domain name will be the name you provided as your “Project” name when you registered.  If you are an On Premise user, the Site Domain will be “Global.”
  • Select the “New Sub-Domain” Option.
  • Click on the General tab on the right, then click on the Pencil icon on the far right.
  • Rename the newly created Domain “FirstHour”.
  • The window should look similar to this when you are finished with these steps:


Step 2 - Create a Credential

  • Click on the Connections menu.
  • Click on the Credentials tab on the left side.
  • Right click on the “FirstHour” Domain and select “New Credential in this Domain”.
  • Change the name of the new Credential object to “FHCreds” in the pop-up window.
  • Make sure the value in the “Kind” drop down field is “Encrypted in Database”.
  • Enter the Username and Password you will use to connect to the target Endpoint (during a deployment) in the Username and Password fields.
  • Click OK.
  • The window should look similar to this when you are finished with these steps.



Step 3 - Create a Repository

  • Click on the “Connections” Menu.
  • Click on the “Repositories” tab on the left side.
  • Right click on the “FirstHour” Domain and select “New Repository in this Domain”.
  • Enter the name of the new Repository as “FHFiles” in the resulting window.
  • In the “Type” field, leave the default value of “filesystem”.
  • Leave the default values of ‘User’ and ‘admin’ for Owner Type and Users fields.
  • In the “Credential” field, click on the down arrow to produce a drop-down list of Credentials to choose from and select “<Site Domain>.FirstHour.FHCreds”.
  • Click OK.
  • The window should look similar to this when you are finished with these steps:



  • Click on the “Properties” tab.
  • Click on the plus (+) sign on the far right.
  • Leave the default of “filepath” in the dropdown list.
  • Enter a directory in which to place the files during the deployment, such as “/home/reuser” into the “value” field.
  • Click OK.
  • The window should look similar to this when you are finished with these steps.



Step 4 - Create a Target Environment and an Endpoint to Deploy To

  • Click on the “Data Center” Menu.
  • Click on the “Environments” tab on the left side.
  • Right click on the “FirstHour” Domain and select “New Environment in this Domain”.
  • Change the name of the new Environment to “FHEnv” in the resulting window and click OK.
  • Leave the default values of “User” and “admin” for the Owner Type and Users fields.
  • Leave the default value of “Always Available Unless Denied by Calendar” in the Availability field.
  • The window should look similar to this when you are finished with these steps.



  • Right click on the “FHEnv” Environment in the tree structure on the left side.
  • Select “New Endpoint in this Environment”.
  • Enter ”FHEndPoint” as the name of the new Endpoint in the resulting window.
  • Leave the default values of “User” and “admin” for the Owner Type and Users fields.
  • Make sure the “Endpoint Type” field is set “unix”.
  • Enter the correct hostname or i.p. address into the “Hostname” field.
  • Set the “Protocol” field to “sftp”.
  • Enter /target, where the files will be placed, into the “Base Directory” field.
  • Click on the “Credential” field, and select “<Site Domain>.FirstHour.FHCreds” from the drop down list.
  • Leave all other default values in place, including the Endpoint Component Type of “Application File”.
  • Click OK.
  • The window should look similar to this when you are finished with these steps.



NOTE: An Endpoint can be created independently from an Environment by clicking on the Endpoints tab next to the Environments tab. An Environment can have many different Endpoints, and an Endpoint can exist in many different Environments.

Step 5 - Create a Component Base Version and a Component Item

  • Click on the Deploy Menu
  • Select the Components tab on the left side.
  • Right click on the FirstHour Domain and select “New Component Base Version in This Domain” from the drop-down list.
  • Change the name of the new Component Base Version in the resulting window to “FHComp”.
  • Leave the default values of “User” and “admin” for the Owner Type and Users fields, as well as the Category type of “General”, and click OK.
  • Click on the “Component Items” tab in the right hand panel.
  • Right click on the Component Item and select “Edit Details”.
  • Change the name of the new Component Item in the resulting window to “CompItem1”.
  • Select <Site Domain>.FirstHour.FHFiles from the Repository drop-down list.
  • Click OK.
  • The window should look similar to this when you are finished with these steps:



NOTE: At this point, a single Component Base Version containing a single Component Item has been created. The Component Item has “FHFiles” as its Repository, which contains all of the files in the /home/reuser directory.

Step 6 - Create an Application Base Version

  • Click on the “Deploy” menu.
  • Click on the “Applications” tab on the left side.
  • Right click on the “FirstHour” Domain and select “New Application Base Version in this Domain”.
  • Name the new Application in the resulting window to “FirstHourApp” and click OK.
  • The window should look similar to this when you are finished with these steps:



  • Click on the “Assigned Components” tab on the left side.
  • Click on the plus (+) sign for the FirstHour Domain to show the General Category, then click on the plus sign (+) for the General Category to show the “FHComp” Component.
  • Click and drag “FHComp” from the tree structure on the right onto the area containing the “Start” icon.
  • Notice a connector has been drawn between the “Start” icon and the “FHComp” Component.
  • The window should look similar to this when you are finished with these steps:



  • Click on the “Assigned Environments” tab on the right side.
  • Click on the plus sign (+) on the far right.
  • Select “FHEnv” from the list of Environments in the resulting window and click OK.
  • The window should look similar to this when you are finished with these steps:



Step 7 - Create a Deployment Task

  • Click on the “Domains” menu.
  • Click on the “FirstHour” Domain in the tree structure.
  • Click on the “Tasks” tab on the right side.
  • Right click in the “Tasks in this Domain” area and select “Add Deploy Task” from the drop down list.
  • Click on the new Task in the “Tasks in this Domain” area, click on the pencil icon on the far right, and change the name to “FHDeploy”. Click OK.
  • Drag the “Everyone” Group from the “Available Groups” list into the “Group Access” list.
  • The window should look similar to this when you are finished with these steps:


NOTE: Tasks are Domain specific.

Step 8 - Run a deployment

  • Click on the “Deploy” menu.
  • Select the “Applications” tab on the right side.
  • Open the “FirstHour” domain in the tree structure.
  • Right click on the “FirstHourApp” Application Base Version.
  • Select the “FHDeploy” Task from the drop down list.
  • Select the “FHEnv” Environment from the drop down list in the resulting window.
  • Click OK.
  • Click on the Timeline tab on the right side.
  • Click on the uppermost deployment number link in the list.
  • A window will open with 7 tabs. Click on the Log tab.
  • The window should look similar to this when you are finished with these steps:



  • Navigate to the /target directory of the target server. The files that are located in the /home/reuser directory are now also in the /target directory.
  • In DeployHub, click on the Files tab on the open window to see a list of the files that were deployed.



  • Click on the General tab on the open window to see information about the deployment, including Exit Status, Time Taken, and any errors or warnings.



Click on the Feedback Loop tab to see a simple example of the Feedback Loop for this deployment, which shows different coloured symbols representing the various DeployHub objects that were just created and used to deploy the text files.



This concludes the introduction to DeployHub. You can change and/or add to the Application Base Version and its Component Base Version, create different types of Repositories, and use different target destinations (directories on your local machine or other machines on your network) as the Endpoint, to see how DeployHub can be used to deploy files from any source to any target.