Search code examples
artifactoryjfrog-pipelines

System Templates version 1.31.0 and higher implementation


I have upgraded my cloud Artifactory to "7.52.0". Prior to the upgrade I was using System Templates to deploy my pipelines.

Although after the upgrade there is still backward compatibility, The new way to deploy and use System Templates for creating new pipelines is not working for me.

From the release notes I got to this link to configure System Templates in the new way.

https://www.jfrog.com/confluence/display/JFROG/System+Templates

So in my repository A I have 2 files 'pipelines.yml' and 'values.yml' pipelines.yml is configured as follows:

valuesFilePath: ./values.yml
Include:
    template: myTemplates/TestTemplate/1.0.0

My values file contains values for the TestTemplate.

Then I go to https://example.jfrog.io/ui/admin/pipelines/pipelineSources and I try to create a new pipeline from repository A.

Looking at https://example.jfrog.io/ui/pipelines/myPipelines/myPipelines I don't see any pipeline created from the template.

Is that the right way to implement the new System Template?

I have also made sure that the templates are in the Artifactory by checking:

https://example.jfrog.io/ui/pipelines/templates

and also in the Artifactory directory tree.

Currently I am using the REST API in order to CRUD my Template Sources(https://example.jfrog.io/ui/pipelines/sources) and also use the REST API to create a new pipelines sources from a system template (apparently this is the old way).

As after the upgrade creating a source pipeline doesn't sync the old/new templates nor does it create a new pipeline from a system template that is located in the Artifactory.


Solution

  • You need to use the syntax documented in the Global template link.
    Using the "jfrog/PublishTemplate" global template documentation
    https://www.jfrog.com/confluence/display/JFROG/Global+Templates .
    I have noticed that in order to create and upload a system template you need to use the following syntax:

    valuesFilePath: ./values.yml
    include:
      template: jfrog/<global_template_name>/<template_version>
    

    According to the system template documentation this is the syntax that got me confused:

    valuesFilePath: ./values.yml
    Include:
        template: jfrog/PublishTemplate/1.0.0
    

    So I have used capital "I" instead of small "i" and bad indentation in order to create a new pipeline from my system template, which failed.

    You use the Global template "PublishTemplate" for uploading your system template into your artifactory.
    And then use the uploaded templates in order to create your new pipelines.