Andrew and community:

Thanks for the details.  I think I should start by adding add a local parameter 
to this job defined in global-templates-java.yaml:
  
   name: '{project-name}-{stream}-release-version-java-daily'

This job has 2 maven-target entries, here is the second:

      - maven-target:
          maven-version: '{maven-version}'
          goals: 'clean deploy -B
            
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          properties:
            - '{maven-deploy-properties}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp


I think I need to modify the portal.yaml file to set a value for the property 
"maven-deploy-properties" above with my new bit of text 
"-Dbuild.number=${BUILD_NUMBER}"

So here is that portal.yaml file again:

---
- project:
    name: portal
    project-name: 'portal'
    jobs:
      - '{project-name}-{stream}-release-version-java-daily'
      - '{project-name}-{stream}-stage-site-java':
          site-pom: 'pom.xml'
          trigger-job: '{project-name}-{stream}-release-version-java-daily'

    project: 'portal'
    stream:
      - 'master':
          branch: 'master'
      - 'release-1.0.0':
          branch: 'release-1.0.0'
    mvn-settings: 'portal-settings'
    files: '**'
    archive-artifacts: ''
    build-node: ubuntu1604-basebuild-4c-4g

In the template (above) the hooks available to me seem to be anything in curly 
braces; e.g., {maven-deploy-properties} and {mvn-settings}.  So I added this 
line at the end of the portal.yaml file:

    maven-deploy-properties: -Dbuild.number=${BUILD_NUMBER}

Does that look right?  I will submit this change to gerrit soon for review.

Finally, do you want a Jira ticket number here?

Please guide me. 


> On Jun 12, 2017, at 2:02 PM, Andrew Grimberg <[email protected]> 
> wrote:
> 
> +onap-discuss
> 
> These sorts of discussions should be held in the public where everyone
> can benefit.
> 
> On 06/12/2017 10:41 AM, LOTT, CHRISTOPHER M (CHRISTOPHER) wrote:
>> Thanks Andrew. I cloned that project and am trying to figure it out.  Looks 
>> like I could modify global-defaults.yaml (probably the wrong thing to do); 
>> modify global-templates-java.yaml (in many many places); or limit the scope 
>> to just the portal project (seems the best option).  So I found this file - 
>> it seems to reference a variable 'portal-settings' but I cannot find where 
>> that is defined, what it contains, etc.  Please advise.
>> 
>> 
>> bd-228-251:~/git/ci-management/jjb/portal$ cat portal.yaml 
>> 
>> ---
>> - project:
>>    name: portal
>>    project-name: 'portal'
>>    jobs:
>>      - '{project-name}-{stream}-release-version-java-daily'
>>      - '{project-name}-{stream}-stage-site-java':
>>          site-pom: 'pom.xml'
>>          trigger-job: '{project-name}-{stream}-release-version-java-daily'
>> 
>>    project: 'portal'
>>    stream:
>>      - 'master':
>>          branch: 'master'
>>      - 'release-1.0.0':
>>          branch: 'release-1.0.0'
>>    mvn-settings: 'portal-settings'                   <------ is this my hook 
>> to make a change??
> 
> That file is non-settable by any of the projects. It's the credentials
> settings file that LF provides to each project in our systems. It is
> required to be "${projectrepo}-settings".
> 
> The correct thing to do is the following:
> 
> 1) Determine what job(s) it is you're trying to modify
> 2) Determine if there are variables already being passed in that you can
> modify to do what you want, if there are, then modify them in your
> project definition
> 3) If there are not, then updating the job template to take a new
> variable is something that can be done, but then all projects that are
> using the template must be updated to pass a proper default so as to not
> break the jobs.
> 
> -Andy-
> 
>>    files: '**'
>>    archive-artifacts: ''
>>    build-node: ubuntu1604-basebuild-4c-4g
>> 
>> 
>> 
>> 
>>> On Jun 12, 2017, at 12:53 PM, Andrew Grimberg 
>>> <[email protected]> wrote:
>>> 
>>> On 06/12/2017 09:34 AM, LOTT, CHRISTOPHER M (CHRISTOPHER) wrote:
>>>> I would like to suggest a extension to the Jenkins job that builds the 
>>>> ONAP Portal back-end (compiles java, yields war file).  The job is 
>>>> probably "portal-master-release-version-java-daily".  I propose to add 
>>>> this argument to mvn: "-Dbuild.number=${BUILD_NUMBER}".  This passes thru 
>>>> the build number chosen by Jenkins so it can be used as a unique artifact 
>>>> identifier.  Our POM the incorporates that detail into the manifest file 
>>>> so the webapp can display a unique version number.
>>>> 
>>>> So right now the config shows these arguments ("Goals") to mvn33:
>>>> 
>>>> clean deploy sonar:sonar -Dsonar.host.url=${SONAR} -B 
>>>> -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
>>>> 
>>>> I would like to extend this field to be:
>>>> 
>>>> clean deploy sonar:sonar -Dsonar.host.url=${SONAR} -B 
>>>> -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
>>>>  -Dbuild.number=${BUILD_NUMBER}
>>>> 
>>>> Please advise how these things are handled - do I need to write a Jira 
>>>> ticket?  Thanks.
>>> 
>>> Submit a change in gerrit against the ci-management project. The jobs
>>> are publicly defined and get code reviewed just like anything else.
>>> 
>>> -Andy-
>>> 
> 

_______________________________________________
onap-discuss mailing list
[email protected]
https://lists.onap.org/mailman/listinfo/onap-discuss

Reply via email to