This setting is necessary for TLS handshake.
Update the your powershell profile with the following:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Reference
Extremely Serious
This setting is necessary for TLS handshake.
Update the your powershell profile with the following:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Reference
Reference
#Write to right-updater.log log normal "right-updater.log" #Load a folder compare session. load "%1" #Confirmation will be set to yes by default. option confirm:yes-to-all #Make the right equals to the left of the loaded folder from the session. sync mirror:left->right
#expects 2 command line parameters param([string]$script, [string]$session) #The beyond compare command to be used. $cmd="C:\Program Files\Beyond Compare 4\BComp.com" #Holds the session argument for the beyond compare command. $args="""$session""" #Write on screen the actual command to be executed. write-output "$cmd /silent @$script $args" #Perform the command. &$cmd /silent @$script $args
Action | Start a program |
Program/script | powershell |
Add arguments(optional) | ./bcrunner.ps1 right-updater.bc <SAVED_SESSION_FROM_STEP_2> |
Start in (optional) | <DIRECTORY_OF_BCRUNNER.PS1_FILE_FROM_STEP_4> |
Note: Fill-in the other tabs of the scheduler accordingly.
Use Cases
Lower Jenkins (e.g. v1.x) but requires later Jenkins (e.g. v2.x) functionality (e.g. using git plugin which has some transitive dependencies which requires v2.x).
For some reason , we just wanted a Jenkins server to delegate a task to another Jenkins server.
You've created a script (i.e. python, ruby, groovy, etc) that will trigger a Jenkins task via HTTP protocol. This is not part of this document but the Backend Jenkins Server section is applicable.
Backend Jenkins Server
This is the server that will perform the task.
Setting-up a role that can do remote build
Overall | Read |
Job | Build |
Job | Read |
Job | Workspace |
Example 1: Sample role configuration
If we have remote_triggers as the new role, we have the following:
Assigning a role to a user
Example 2: Assign a role following Example 1.
If the known user is GwDevOpsDev, we have the following:
Setting-up the Build Triggers
Note: You can use https://www.guidgenerator.com/ just remove the hyphen for this.
This will enable you to trigger the job remotely via HTTP Post using one of the following:
Without Build Parameters
<JENKINS_URL>/job/<URL_ENCODED_ITEM_NAME>/build?token=<AUTHENTICATION_TOKEN>
With Build Parameters
<JENKINS_URL>/job/<URL_ENCODED_ITEM_NAME>/buildWithParameters?token=<AUTHENTICATION_TOKEN>
Example 3: Address to call a task remotely.
If we have the following:
JENKINS_URL = http://d-51306g2.fmg.net:9080 ITEM_NAME=Statement Date Update to Saturday URL_ENCODED_ITEM_NAME=Statement%20Date%20Update%20to%20Saturday AUTHENTICATION_TOKEN=49dcf6a2164147b1871de70b40afef6f
The URL to call this job remotely with build parameters must be:
http://d-51306g2.fmg.net:9080/job/Statement%20Date%20Update%20to%20Saturday/buildWithParameters?token=49dcf6a2164147b1871de70b40afef6f
User Facing Jenkins Server
This is the Jenkins server that is normally use by the user to invoke tasks but the task is actually being done by a another Jenkins server.
Pre-requisite
Setting-up Credential to be used with the HTTP request.
Setting-up a New Item to Delegate Task to Backend Jenkins Server
Introduction
Expando object can make dynamic object, properties and methods if you like. This can be used for stubbing an object to be used for testing.
For example if have the following:
Code 1 - processor function that requires the SSampleStructure structure
//Structure works with objects with similar features but no common inheritance and interface declarations structure SSampleStructure { function someAction() : int } function processor(sample : SSampleStructure) : int { return sample.someAction() + 10 }
The SSampleStructure structure will be compliant to all the classes that has someAction function that returns an int. And the actual compliant implementation of the structure is the following:
Code 2 - Actual implementation that is compatible with SSampleStructure
class SampleCodeWithStaticMethods { private construct() {} function someAction() : int { return (Math.round(Math.random()*100) as int) + 100 } }
We can notice that in Code 2, we cannot have a consistent output for someAction method since it is return arbitrary values. And what the processor function does is just add 10 on it.
What we can do here is to create an Expando object that will also comply with SSampleStructure structure like the following:
Code 3 - Using Expando class
uses gw.lang.reflect.Expando // By declaring the Dynamic type for the variable or function argument, you can // programmatically access any property or method without requiring compile-time confirmation of its existence. var testObj : Dynamic = // An expando object is an object whose properties, and potentially methods, are created dynamically on assignment. new Expando() // We can attached function using the block syntax as below. testObj.someAction = \ -> 25
Since the testObj of Code 3, also has someAction function that returns an int. This is compliant with SSampleStructure structure. So we can safely run the following test of logic without any problem:
Code 4 - Actual test
function testProcessor() { print("Is35: " + (processor(testObj)==35)) } testProcessor()
As we can see from Code 4, we are using testObj to test the processor method.
Syntax
git clone -b <branch> <repo>
Example
git clone -b gw9 http://sample.gitrepo.org/r/gw/scm.git
Where:
branch = gw9
repo = http://sample.gitrepo.org/r/gw/scm.git
Edit <APP_DIR>\grails-app\conf\application.yml to add or edit the following lines:
--- server: port: <PORT_NUMBER>
Where:
<APP_DIR> is the directory created by using the grails create-app command.
<PORT_NUMBER> is the desired port to be used in the app.
Get-Variable | Where-Object {$_.Name -like "PROFILE"}
Test-Path $PROFILE
This will return True if the profile is already existing on the disk and ready for editing. If this returns False execute the following command:
New-Item -Path $PROFILE -ItemType "file" -Force
Jabba is a java version manager (see https://github.com/shyiko/jabba) that simplifies the installation and switching of/to different JDK.
If your powershell is behind the firewall follow the procedure here.
Install Jabba using the following cmdlet:
Note: If you encountered something like jabba.ps1 cannot be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 see running unsigned script.
Invoke-Expression ( wget https://github.com/shyiko/jabba/raw/master/install.ps1 -UseBasicParsing ).Content
Get-ExecutionPolicy
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Note: This is not required if you know that you are only running the script that you trust.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy <EXECUTION_POLICY_FROM_STEP1>
© 2025 Ron and Ella Wiki Page
Theme by Anders Noren — Up ↑
Recent Comments