Skip to content

Ts004777910 #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
433d788
Replace © to (c)
Apr 25, 2017
9dc380a
UPDATE to [PMR 52093,L6Q,000] : IBM UCD Jenkins Pipeline Plugin Bug (#1)
a259937 May 2, 2017
f8de864
Revert Back to Original Internal Ant Build
May 2, 2017
04b3424
Remove Codestation reference
May 2, 2017
733e196
External Gradle Build
May 2, 2017
996c4f7
Removed build.life.id build.xml prop
May 3, 2017
4fcb8a5
Merge pull request #2 from IBM-UrbanCode/revert-ant
May 3, 2017
b98da6a
Updated for SNAPSHOT=
May 3, 2017
9179fc7
Merge pull request #3 from IBM-UrbanCode/snapshot=
May 3, 2017
8339492
gradle jpi
May 22, 2017
1e948f9
163394 Update README with Syntax Doc
Jun 30, 2017
694c908
164401 Support Description and App Request Props (#5)
Jul 3, 2017
d7146fb
164936 2/2 Import versions no longer fails without properties. (#6)
jrbarto Aug 17, 2017
a1e6a71
168300 2/2 Acquire unfilled application process request properties wi…
jrbarto Jan 3, 2018
c51ee93
168422 Clean up null pointers and remove maintenance mode check. (#8)
jrbarto Jan 18, 2018
fcc4e6d
Fixed 401 error when setting version properties. (#9)
jrbarto Aug 27, 2018
26912b8
Plugins-2205 Preemptively create environment snapshot. (#10)
jrbarto Jan 24, 2019
9b2ddaf
Plugins 2246 1/1 Added checkbox to skip waiting for deployment. (#11)
jrbarto Feb 18, 2019
c0443ad
PLUGINS-2328 Set component version as environment variable.
jrbarto Apr 15, 2019
c4ca94d
Merge pull request #12 from UrbanCode/PLUGINS-2328
aberkDev Apr 15, 2019
1d7c863
Modified process to continue if user is unable to set environment var…
jrbarto Apr 19, 2019
6bdbc41
DataBoundSetters for compatibility with Jenkins Configuration as Code…
romanfurst Jul 1, 2019
021007a
DEPLOY-10651 Agent connecting relay shows auth token in HTTP Connect …
spulugurtha Jul 3, 2019
8758147
[PLUGINS-2682] Fixed : Jenkins Plugin Shows success on Canceled job i…
Jyoti-Prakash01 Mar 30, 2020
df53e8d
Fixed - Making deploy version -not required- field to support ([a]. o…
Jyoti-Prakash01 May 25, 2020
258d7dd
Update README.md
Jyoti-Prakash01 May 28, 2020
d81c936
Merge pull request #17 from UrbanCode/PLUGINS-2769
Jyoti-Prakash01 Jun 2, 2020
c80a0d1
Block -Run as Alternative User- : Help text added for -Alternative Us…
Jyoti-Prakash01 Jun 21, 2020
bb7fa39
Merge pull request #18 from UrbanCode/PLUGINS-2802
Jyoti-Prakash01 Jul 3, 2020
8eff5b9
APAR PH28324 - UCD Jenkins Plugin - Fail the Jenkins job if nothing i…
Jyoti-Prakash01 Aug 18, 2020
6254285
[PLUGINS-3003] Fixed : Addition of latest version to specified compon…
Jyoti-Prakash01 Oct 12, 2020
5bf0e60
Updated dependency to support Jenkins 2.2
Feb 3, 2021
499c561
updated the rest client
Feb 3, 2021
ae6194c
[DO NOT MERGE] [PLUGINS-3122] - RFE created ID:147414 Enhance ibm-ucd…
Jyoti-Prakash01 Feb 23, 2021
81f83e2
Merge branch 'master' into TS004777910
AjeetGupta Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
*.iml
*.ipr
*.iws
pom.properties
69 changes: 65 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ The compiled plugin is available for download on the [IBM UrbanCode website](htt
Plug-ins downloaded directly from the [IBM UrbanCode Plug-ins microsite](https://developer.ibm.com/urbancode/plugins) are fully supported by IBM. Create a GitHub Issue or Pull Request for minor requests and bug fixes. For time sensitive issues that require immediate assistance, [file a PMR](https://www-947.ibm.com/support/servicerequest/newServiceRequest.action) through the normal IBM support channels. Plug-ins built externally or modified with custom code are supported on a best-effort-basis using GitHub Issues.

### Locally Build the Plug-in
This open source plug-in uses Ant as its build tool. [Install the latest version of Ant](http://ant.apache.org/manual/install.html) to build the plug-in locally. Build the plug-in by running the `ant` command in the plug-in's root directory. The plug-in distributable will be placed under the `dist` folder.
This open source plug-in uses Gradle as its build tool. [Install the latest version of Gradle](https://gradle.org/install) to build the plug-in locally. Build the plug-in by running the `gradle jpi` command in the plug-in's root directory. The plug-in distributable will be placed under the `build/libs` folder.

## Pipeline Examples
Full explanation of these Pipeline syntax examples can be found on our [Jenkins Pipeline Syntax](https://developer.ibm.com/urbancode/plugindoc/ibmucd/jenkins-pipeline-formerly-jenkins-2-0/2-2/jenkins-pipeline-syntax-overview/) documentation.

### Create Component Version
```groovy
node {
Expand All @@ -33,8 +35,7 @@ node {
fileIncludePatterns: '*.zip',
fileExcludePatterns: '',
pushProperties: 'jenkins.server=Local\njenkins.reviewed=false',
pushDescription: 'Pushed from Jenkins',
pushIncremental: false
pushDescription: 'Pushed from Jenkins'
]
]
])
Expand All @@ -46,6 +47,10 @@ node {
node {
step([$class: 'UCDeployPublisher',
siteName: 'local',
component: [
$class: 'com.urbancode.jenkins.plugins.ucdeploy.VersionHelper$VersionBlock',
componentName: 'Jenkins'
],
deploy: [
$class: 'com.urbancode.jenkins.plugins.ucdeploy.DeployHelper$DeployBlock',
deployApp: 'Jenkins',
Expand Down Expand Up @@ -88,11 +93,67 @@ node {
```

## Release Notes
### Version 2.21
Update dependencies for compatibility for jenkins 2.2.

### Version 2.20
RFE 147414 : Added ucd application process log url for more details.

### Version 2.19
Fixed : Addition of latest version to specified component only instead of all components.

### Version 2.18
Fixed APAR PH28324 - UCD Jenkins Plugin - Fail the Jenkins job if nothing is found to push to UCD( avoid false positive).

### Version 2.17
Block "Run as Alternative User" : Help text added for "Alternative Username" and "Alternative Password".

### Version 2.16
Fixed APAR PH25862 - Making deploy version "not required" field to support following, which needs no version:
1. Operational component process.
2. Application generic process.

### Version 2.15
Fixed APAR PH23739 - Fixed : Jenkins Plugin Shows success on Canceled job in UCD

### Version 2.14
Fixing CVE:CVE-2019-4233

### Version 2.13
Modified process to continue if user is unable to set environment variable.

### Version 2.12
Set component version as environment variable when pushing a new version.

### Version 2.11
Added option to skip waiting for a successful deployment from UCD.

### Version 2.10
Added functionality to preemptively create environment snapshot to use during deployment.

### Version 2.9
Fixed 401 http error when setting version properties by using latest uDeployRestClient.

### Version 2.8
Fixed all Null pointer and bad casting exceptions returned in Jenkins system logs upon saving a job.
Removed administrative checkbox from global and job configuration of user credentials.

### Version 2.7
Fixed APAR PI91900 - Unfilled application process properties unable to be checked with a snapshot.
### Version 2.6
Fixed APAR PI85407 - Importing component versions no longer fails when runtime properties aren't provided.

### Version 2.5
RFE 104275 - Support for Description and Application Request Properties on deployments.

### Version 2.4
Fixed APAR PI80038 - Snapshot names no longer require a leading equals sign.

### Version 2.3
Fixed APAR PI77548 - Component process properties failing to resolve on deployment.

### Version 2.2
Fixed RFE 98375 - Jenkins Plugin only allows Global credentials instead of job-based credentials.
RFE 98375 - Jenkins Plugin only allows Global credentials instead of job-based credentials.

Fixed PI75045 - UCD server maintenance mode check requires admin privileges.

Expand Down
65 changes: 65 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* (c) Copyright IBM Corporation 2017.
* This is licensed under the following license.
* The Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/

import groovy.util.XmlSlurper
plugins {
id "org.jenkins-ci.jpi" version "0.16.0"
}

group = "com.urbancode.ds.jenkins.plugins"
version = getVersion()
description = "Publish artifacts into an IBM UrbanCode Deploy component as a build step."

jenkinsPlugin {
coreVersion = "1.587" // Version of Jenkins core this plugin depends on.
displayName = "IBM UrbanCode Deploy Jenkins Pipeline Plugin" // Human-readable name of plugin.
url = "https://developer.ibm.com/urbancode/plugin/jenkins-2-0/" // URL for plugin on Jenkins wiki or elsewhere.
gitHubUrl = "https://github.com/IBM-UrbanCode" // Plugin URL on GitHub. Optional.
shortName = "ibm-ucdeploy-pipeline-open" // Plugin ID, defaults to the project name without trailing '-plugin'

// The developers section is optional, and corresponds to the POM developers section.
developers {[
developer {
id "nhmathis"
name "Nicholas Mathison"
email "nhmathis(at)us(dot)ibm(dot)com"
},
developer {
id "jrbarto"
name "Jeffrey Barto"
email "jrbarto(at)us(dot)ibm(dot)com"
}
]}
}

repositories {
mavenCentral()
maven {
url "https://public.dhe.ibm.com/software/products/UrbanCode/maven2/"
}
}

dependencies {
compile 'com.ibm.urbancode.commons:uDeployRestClient:+'
// compile 'com.ibm.urbancode.commons:CommonsFileUtils:+'
// compile 'com.ibm.urbancode.commons:HttpComponents-Util:+'
// compile 'com.ibm.urbancode.commons:CommonsUtil:+'
// compile 'com.sun.jersey:jersey-core:1.12'
// compile 'com.sun.jersey:jersey-client:1.12'
compile 'javax.ws.rs:jsr311-api:1.1.1'
// compile 'org.codehaus.jettison:jettison:1.1'
// compile 'commons-lang:commons-lang:2.5'
// compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.4'
// compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.3.4'
// compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.4'
}

def getVersion() {
def pomFile = new XmlSlurper().parseText(new File("pom.xml").text)
def version = pomFile.version.text()
return version.replace('${env.buildLife}', "open")
}
63 changes: 8 additions & 55 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<project name="jenkins-pipeline-ud-plugin" default="dist" xmlns:codestation="antlib:com.urbancode.codestation2.client" xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="jenkins-pipeline-ud-plugin" default="dist" xmlns:codestation="antlib:com.urbancode.codestation2.client">

<defaultexcludes add="**/.ahs.dig" />
<defaultexcludes add="**/.ahs.manifest" />
Expand All @@ -12,16 +12,13 @@
PROJECT CONFIGURATION
================================================================== -->
<property name="project" value="${ant.project.name}"/>

<property name="ahp.branch.name" value="master"/>
<property name="ahp.project.name" value="${project}"/>
<property name="ahp.workflow.name" value="build workflow [${ahp.branch.name}]"/>

<condition property="build.life.id" value="${env.AH_BUILD_LIFE_ID}">
<condition property="plugin.version" value="${env.AH_BUILD_LIFE_ID}" else="dev">
<isset property="env.AH_BUILD_LIFE_ID" />
</condition>
<condition property="plugin.version" value="${build.life.id}" else="dev">
<isset property="build.life.id" />
</condition>

<property name="MAVEN_HOME" value="${env.MAVEN_HOME}"/>

Expand All @@ -48,8 +45,6 @@
<property name="src.main.java.dir" location="${src.dir}/main/java" />

<property name="lib.dir" location="lib" />
<property name="lib.build.dir" location="${lib.dir}/build" />
<property name="lib.test.dir" location="${lib.dir}/test" />

<!-- ==================================================================
LOCATIONS OF BUILD ARTIFACTS
Expand Down Expand Up @@ -84,57 +79,15 @@
<!-- ==================================================================
ARTIFACT HANDLING
================================================================== -->
<target name="resolve"
unless="resolve.no"
description="Resolve all dependencies"
depends="resolve-ivy, resolve-codestation">
</target>

<target name="resolve-codestation" if="build.life.id"
description="Resolve all codestation dependencies">
<target name="resolve" unless="resolve.no"
description="Resolve all dependencies">
<mkdir dir="${lib.dir}"/>
<codestation:resolve
buildLife="${build.life.id}"
buildLife="${env.AH_BUILD_LIFE_ID}"
xmlFile="dependencies.xml" />
</target>

<target name="resolve-ivy" depends="install-ivy" unless="build.life.id" description="Resolve all ivy dependencies">
<ivy:settings file="ivysettings.xml"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${lib.build.dir}"/>
<mkdir dir="${lib.test.dir}"/>
<ivy:retrieve conf="default" pattern="${lib.dir}/[artifact]-[revision](-[classifier]).[ext]"/>
<ivy:retrieve conf="urbancode" pattern="${lib.dir}/[artifact].[ext]"/>
<ivy:retrieve conf="build" pattern="${lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]"/>
<ivy:retrieve conf="test" pattern="${lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]"/>
</target>

<!-- =================================================== -->
<!-- INSTALL IVY TARGET -->
<!-- =================================================== -->
<available classname="org.apache.ivy.Main" property="ivy.installed"/>
<target name="install-ivy" depends="-install, -fail"></target>

<target name="-install" description="Install ivy" unless="ivy.installed">
<!-- Installation -->
<property name="antHome" value="${user.home}${file.separator}.ant"/>
<mkdir dir="${antHome}${file.separator}lib"/>
<get dest="${antHome}${file.separator}lib${file.separator}ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar"/>
<echo message="SUCCESS! Ivy has been installed in ${antHome}." />

<!-- Determine whether to continue or fail -->
<property name="failIvy" value="true"/>
<condition property="do.fail">
<equals arg1="${failIvy}" arg2="true" />
</condition>
</target>

<!-- Default to fail if Ivy installed, unless -DfailIvy=false : Used for .travis -->
<target name="-fail" if="do.fail">
<fail message="Please run the build again.${line.separator}Note: If you get this message more than once, trying specify your Ant's home directory with the flag: ant -DantHome='ant/home/directory/here' or set/export the `ANT_HOME` environment variable." />
</target>

<target name="publish" if="buildlife.exists" depends="dist" unless="publish.no"
<target name="publish" depends="dist" unless="publish.no"
description="Publish artifacts to local codestation repository">
<codestation:publish
project="${ahp.project.name}"
Expand All @@ -145,7 +98,7 @@
<!-- ==================================================================
COMPILE
================================================================== -->
<target name="prepare" depends="resolve">
<target name="prepare" depends="resolve" unless="prepare.no">
<exec executable="${mvn}">
<arg value="--batch-mode"/>
<arg value="install:install-file"/>
Expand Down
20 changes: 2 additions & 18 deletions dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<dependency>
<cs-project name='Apache HttpComponents' />
<criteria stamp='4.3.4' status='success' />
<criteria stamp='4.*' status='success' />
<delivery artifact-set='lib'>
<directory>lib</directory>
</delivery>
Expand Down Expand Up @@ -75,22 +75,6 @@
</delivery>
</dependency>

<dependency>
<ah-project name="codestation-aggregate" workflow="build workflow [master]"/>
<criteria status="success"/>
<delivery artifact-set="Dist">
<directory>lib</directory>
</delivery>
</dependency>

<dependency>
<ah-project name='replicated-codestation' workflow='build workflow [master]' />
<criteria status='success' />
<delivery artifact-set='Dist'>
<directory>lib</directory>
</delivery>
</dependency>

<dependency>
<cs-project name="Apache-Commons-Lang3" />
<criteria stamp="3.*" status="success" />
Expand All @@ -101,7 +85,7 @@

<dependency>
<ah-project name='uDeployRestClient' workflow='build workflow [master]' />
<criteria status='success' />
<criteria stamp="1.0.0.1068960" status='success' />
<delivery artifact-set='Dist'>
<directory>lib</directory>
</delivery>
Expand Down
41 changes: 0 additions & 41 deletions ivy.xml

This file was deleted.

17 changes: 0 additions & 17 deletions ivysettings.xml

This file was deleted.

Loading