Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Deployment

The deployment deployments from test to integration to test have production make use of the following steps

  • copy the configuration files from one stage to the other
  • do not copy the files that are only used exclusively for testing in your test environment
  • do not copy mock files

...

  • host names for process classes are different
    • Solution: Having a set of process classes on each stage that will not be part of the deployment procedure. This configuration will be handled directy directly on the specific stage.
  • different input for file order sources
    • Solution: Having different file order source sources on each stage that will not be part of the deployment procedure. This configuration will be handled directy directly on the specific stage.
  • different values for parameters, e.g. DB database connection strings are different
    • Make use of include files.
    • Make use of environment variables that will be substituted at run time.

Using a version control software for deployment

When deploying configuration files it is more than just copying files from a to b. When working with sources a version control software migth be helpfullhelpful. With a version control system

...

This table describes the deployment with git Git and subversionSubversion.

 Subversion

Git

 
 

The full Find the Subversion documentation can be found herefrom

http://svnbook.red-bean.com/en/1.5/

The full git Git documentation can be found here

https://git-scm.com/documentation

 
Pre Conditions   
 

Subversion Server

You find Find the documentation „how to install a subversion server“ herefrom

http://svnbook.red-bean.com/en/1.8/svn.serverconfig.html

Git central repository.

You can create a central repository with

Navigate to a folder live where you want to locate the git Git repository

e.g. c:\temp\git_repro\live

git --bare init

 
 SVN Subversion client installed on local machinegit Git client installed on local machine 
 

Subversion Projectarchive

  
All files to be deployes are located in the live folder of a JobScheduler Installationinstallation.

Creating a working copy in your live folder from the projectarchive

Please note that after the import the live folder is not a working copy.

Creating a working copy in your live folder from the git repository

 
 

svn import -m "initial load" --username myUser --password myPassword

"C:\sos-berlin.com\jobscheduler\scheduler_current\config\live"

http://subversion.sos/svn/myprocject

navigate to your config folder

move all files to a temporary folder

git clone c:\temp\git_repro\live

move all files back to the live folder

git add *

git commit -m "initial load"

git push origin master

 

 

The files are now in the subversion projectarchiveSubversion project archive. You can verify this with the command

svn list http://subversion.sos/svn/sos/test/ur

The files are now in the git Git repository. You can verify this with cloning the repository to one more folder

git clone c:\temp\git_repro\live


 
 

Delete the files from the live folder

Execute the command checkout to get the files from the projectarchive project archive to the live folder

svn checkout http://subversion.sos/svn/myprocject

"C:\sos-berlin.com\jobscheduler\scheduler_current\config\live"

  
Working with the projectarchiveproject archive

You can have several working copies of the live folder (see command checkout).

To synchronize changes in the working copy with the project folder there are two commands

You can have several working copies of the live folder (see command clone).

To synchronize changes in the working copy with the project folder there are three commands

 
 

Read the actual current version from the projectarchive project archive (update)

The update command reads changes from the projectarchive project archive and merge them into the

working copy.

svn update C:\ jobscheduler\scheduler_current\config\live

Read the actual current version from the repository (pull)

git pull c:\temp\git_repro\live

 
 

The commit command writes changes from the working copy to the projectarchiveproject archive

Please note that before commiting changes a update command is neccessary

especially when a commit from another working copy has been executed.

svn commit C:\ jobscheduler\scheduler_current\config\live

The push command writes committed changes from the working copy to the repository

 

git commit -m "Commit-Nachricht"

git push origin master

 

Making changes

Changes are made in applied to the working copy using by use of JOE or a text editor software.

When all changes for certain approach has been done the changes can be commited to the projectarchiveproject archive. Before doing carrying out the commit command the working copy has to be actualize updated with changes from other working copies by executing the update command. During the update it is possible that a conflict will be detectdetected. That means that in your working copy is a change and also in another working copy in the same file and the same line a change has been done. If so, you have to resolve the conflict before proceeding. It is neccessary to apply a commit message with the commit command.

  1. update
  2. make changes
  3. update
  4. commit

Changes are made in applied to the working copy using by use of JOE or a text editor software.

  1. pull
  2. make changes
  3. pull
  4. commit
  5. push
 
Deployment

There are two possible architectures to organize the deployment :

  1. The live folders of int integration and prod production environments also are working copies

  2. The live folders of int the integration and prod production environments are simple folders without assignment to a projectarchiveproject archive

 

  1. When int integration and prod production environments are working copies, then the deployment will be done by executing an update command on the intintegratioon/prod production live folder.

    1. Changes can be done directly in the intintegration/prod production live folders. They will be merged with the changes coming from devthe development environment.

    2. This approach is more risky as the merged changes are not testettested. The configuration will be merged directly in int/prod to the integration/production live folder and has never been existed in this version before.

    3. For a more save and stable environment, it should be forbidden avoided to make changes directly in intintegration/prod production environment live folders.

  2. When int integration and prod production environments are simple folders, then the deployment will be done by executing the export command from dev to int/prodthe development environment to the integration/production environments. Before doing the export, all existing files should be deleted.

    del /s c:\int\live
    svn export http://subversion.sos/svn/myprocject/live C:\int\live
    svn export http://subversion.sos/svn/myprocject/include/int C:\int\live

     

    1. Changes that have been made directly in to the intintegration/prod production folders will be overwritten

    2. In case of an urgent, quick change directly in intthe integration/prodproduction environment, the change also has to be done in dev applied to the development environment to make it persistent.

    3. Working with this approach is more save as

      1. Changes in int/dev normally will not be madeIn integration/production environments normally no changes will be applied.

      2. The configuration that is deployed has been testet tested in dev.

 

 
      1. the development environment.

  
    

 

Consider environment specific parameters and configurations. 

When doing the deployment it is possible that parameter value values are not valid in int/prod environment. E.G. the name integration/production environments, e.g. the names of files, folders, printers etc.

Use environment variables that have accept different values in intdevelopment, prod integration and devproduction environments. For

  • File order sources
  • Directories in file names

 

Code Block
languagexml
<job_chain name="job_chain1">

...


<file_order_source directory="${file_input_dir}\input" regex=".*"/>

...


...

...


</job_chain>

 

Use include files for specifying to specify parameter values<order>
<params ><include :

Code Block
languagexml
<order>
	<params>
		<include live_file="

...

myorder.params.xml" node=""/>

...


..

...


</order>

 

and the file paramfile

<params >

...

where the file myorder.params.xml could look like this:

Code Block
languagexml
<params >
	<param name="par1" value="value1"/>

...


	<param name="par2" value="value2"/>

...


</params>

 

 

Use different script include files for dev prod and int

 

...

development, integration and production environments:

Code Block
languagexml
<job order="yes">

...

 


	<script language="shell">

...


		<include live_file="include_scriptfile.sh"/>

...


	</script>

...

 


    <run_time />

...


</job>

 

How to handle different include files for parameters and scripts

  • create a folder include_files (parallel to the live folder)
  • create subfolders for dev, int and prod
  • create the same subfolders under dev, int and prod as in the live folder
  • create the include files in the subfolders for dev, int and prod
  • create a projectarchive wich contains the folder include_file
  • create a working copy with the import, delete and checkout command (see above).
  • When committing the include_files folder you should also commit the live folder (and vica versa) to have consistency between both folders.
  • When deploying to int export the include_files/int folder to the live folder at int
  • When deploying to prod export the include_files/prod folder to the live folder at prod

As you have a working copy in the live folder of dev, the include files from dev will be deployed when exporting the dev live folder. But with the second export from the include_files folder, the dev files will be overwritten with the correct version. An alternative approach is that also the live folder in dev is not a working copy but will be actualized with an export command from the dev working copy.

 

The quality of the dev development environment

When having some test configuration items files in the development environment you should take care of not commiting to commit them to the repository. To achieve this, no add command should be executed on this filethese files. You also can add these files to a an ignore list (available with git Git and subversionSubversion). You should take in mind into account that every each configuration item that has been committed to the repository will be in int or prod environment sometimes deployed to the integration or production environments some time later.

 

Rollback to a former previous version

To rollback to a former previous version

  1. identify the release to which you want to fall back
  2. With subversionSubversion/git Git commands get the files of the release
  3. Publish these files to int/prod

...