Windows

From OpenMBD
< CI
Jump to: navigation, search


Back to Home

Setting up the PC as a server

To set up the PC as a server there are several setting that needs to be done. First of all some applications needs to be installed. A batchfile needs to be made and some batchfiles needs to be scheduled with task scheduler.

And the last step is setting up the PC to not go in standby mode.

Installing the applications

The next apllications need to be installed to set the PC as a server.

  • Jenkins: In order to install jenkins go to the Jenkins page.
  • SonarQube: In order to install SonarQube go to the SonarQube page.
  • TestExecute: In order to install TestExecute go to the TestExecute page.
  • TestComplete: In order to install TestComplete go to the TestComplete page.
  • TortoiseSVN: In order to install TortoiseSVN go to the TortoiseSVN page.
  • Apache Ant: In order to install Apache Ant go to the Ant page.
  • JUnit: In order to install JUnit go to the JUnit page.

Startup scripts

Batchfiles

There are two scripts that need to be run.

  • One for Jenkins: JenkinsStartUp.bat
  • One for SonarQube: StartSonar.bat

The batchfile for Jenkins needs to be made. An example of this batchfile is shown below.

cd "C:\Program Files (x86)\Jenkins" 
runas /user:TestServer-PC\TestServer /htsauto jenkins.exe

The batchfile for SonarQube can be find in the map of SonarQube. The path can look like this:

C:\Program Files\SonarQube\sonarqube-5.6.6\bin\windows-x86-64

The StartSonar.bat must look like this batchfile if editing it.

SonarBat.png

Schedule tasks with Windows Task Scheduler

To let the server of Jenkins and SonarQube run, Task Scheduler is used, to let the batchfiles run. The following steps must be followed. Open Task Scheduler and click on "Action" and then click on "Create Task".

An example of this is shown on the picture below.

TaskSchedulerHome.png

When clicked on "Create Task" there will be a screen like the picture below. Fill in the name and choose in the "Security optios" "Run only when user is logged on" and choose "Run with highest privileges". Also choose the correct "Conigure for" system.

TaskSchedulerGeneral.png

Then click on the "Triggers" tab, there will be a screen like the picture below, and click on "New".

TaskSchedulerTriggers.png

After that click on "Begin the task" and choose "At log on" for the nightly build. It is also possible to choose a day, time, week et cetera. Click on the box "Enabled".

An example of this is shown on the picture below.

TaskSchedulerTriggersTask.png

Now click on the tab "Actions" and there will appear a screen similair as the picture below.

TaskSchedulerActions.png

To add a new program, click on "New" and there a screen like the picture below will appear. Click on "Browse" and for example to start SonarQube, the following path can be used: "C:\Program Files\SonarQube\sonarqube-5.6.6\bin\windows-x86-64\StartSonar.bat"

TaskSchedulerActionsProgram.png

To see how to add a batchfile see...

Next step click on "Conditions" and make sure that the following boxes are clicked:

  • Start the task only if the computer is on AC power.
  • Stop if the computer switches to battery power.

An example of this schreen can be seen on the picture below.

TaskSchedulerConditions.png

The last step is clicking on the tab "Settings". The following boxes mus be clicked:

  • Allow task to be run on demand.
  • If the running task does not end when requested, force stop.

See the picture below for an example of the screen.

TaskSchedulerSettings.png

Now click on "Ok" and close Task Scheduler.

Windows Settings

The next Windows Settings must be set:

  • Environment variables
  • standby setting

Environment variables

For the environment variables click on "Windows start", and type "env" and click on "Edit environment variables for your account".

The window that will be shown on the screen is shown below.

EnvironmentVariables.png

In order to add a new environment variables click on "New". In the "variable name" cassette type in Jenkins. In the "variable value" cassette type in the path where Jenkins is installed.

In the picture below is shown an example of the jenkins environment variable.

EnvironmentVariablesJenkins.png

For the communication between TestComplete and TestExecute, there must be te same environment variable for the map of SVN.

An example of this is shown in the picture below.

EnvironmentVariablesSVN.png


Standby setting

The server PC must be always on in order to build tests. The next settings must be done:

In order to turn of automatic locking the PC click on "Windows start", and type "scr" and click on "Turn screen saver on or off".

There will appear a window like the picture below.

ScreenSaver.png

Now click on the arrow and choose "None", then unclick "On resume, display logon screen" and click on "Apply" and then on "Ok".

Now again click on "Windows start", and type "po" and click on "Power Options".

The next window will be seen on the screen.

PowerOptions.png

Click on "Balanced (recommended)" and then click on "Change plan settings".

PowerOptionsEditPlanSettings.png

Click next to the cassette "Tun off the display" and click on "Never". Also click next to the cassette "Put the computer to sleep" and click on "Never". Then click on "Save changes", and the settings are done.