Thanks, again.

One more question.  None of the pipeline-as-code examples show the creation
of pipeline groups.  Do these need to exist?  Does it create them
dynamically based on the JSON? Or should I create a JSON for each group as
well?

-Jeff

On Tue, Sep 12, 2017 at 5:56 PM, Aravind SV <[email protected]> wrote:

> Yes, I believe you should be able to reference the XML from the JSON, but
> not the JSON from the XML. As far as I remember, the GoCD config XML should
> be standalone, irrespective of whether the repository with the JSON can be
> found or not.
>
> On Tue, Sep 12, 2017 at 6:02 PM, Jeff <[email protected]> wrote:
>
>> Thanks!
>>
>> Are elements defined using JSON able to reference elements defined in the
>> global XML or does the JSON configuration need to be self-contained and
>> apart from other pipeline/environment definitions?
>>
>> In other words, in my XML I have defined a pipeline group called
>> TestGroup and an Environment called TESTING.  Should I be able to create a
>> JSON pipeline thusly?
>>
>> {
>>   "name": "test-json-pipeline",
>>   "environment_variables": [],
>>   "group" : "TestGroup",
>>    ....
>> }
>>
>> and then add it to my TESTING environment?
>>
>> -Jeff
>>
>> On Tue, Sep 12, 2017 at 3:11 PM, Aravind SV <[email protected]>
>> wrote:
>>
>>> Hey Jeff,
>>>
>>> I tried this quickly, using a docker image and it seems to work. I
>>> started a docker instance of gocd 17.8 like this:
>>>
>>> docker run -it -p8153:8153 -p8154:8154 gocd/gocd-server:v17.8.0
>>>
>>>
>>> Then, I went to the config XML and added the config-repo snippet (since
>>> the plugin already exists on 17.8). After adding it, my config looked like
>>> this:
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <cruise xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>> xsi:noNamespaceSchemaLocation="cruise-config.xsd" schemaVersion="94">
>>>   <server artifactsdir="artifacts" agentAutoRegisterKey="something"
>>> webhookSecret="something" commandRepositoryLocation="default"
>>> serverId="something" />
>>>
>>>
>>>
>>>
>>> *  <config-repos>    <config-repo plugin="json.config.plugin"
>>> id="gocd-demo-config-repo-json">      <git
>>> url="https://github.com/arvindsv/gocd-demo-config-repo-json.git
>>> <https://github.com/arvindsv/gocd-demo-config-repo-json.git>" />
>>> </config-repo>  </config-repos>*
>>> </cruise>
>>>
>>> Within a few seconds, when I went to the dashboard (
>>> http://localhost:8153/go), I saw three pipelines.
>>>
>>>
>>> I do vaguely remember an issue, where some problems in the config
>>> repository were not showing up as errors in the UI. They have been fixed in
>>> 17.9, I think.
>>>
>>> Cheers,
>>> Aravind
>>>
>>>
>>> On Tue, Sep 12, 2017 at 4:05 PM, Jeff <[email protected]> wrote:
>>>
>>>> I'm experimenting with the pipeline as code and have followed the
>>>> instructions at:
>>>>
>>>> https://docs.gocd.org/current/advanced_usage/pipelines_as_code.html
>>>>
>>>> and have included the sample config-repo.  However, none of the "demo"
>>>> pipelines or environments are showing up in my system.
>>>>
>>>> I don't see any errors showing up in the GoCD error dialog nor in the
>>>> logs that I can see.
>>>>
>>>> Has anyone successfully gotten this to work?  I'm using GoCD v 17.8.0
>>>>
>>>> I put the <config-repos>...</config-repos> section just before the
>>>> first <pipeline> definition and right after the </repositories> tag.  I had
>>>> to c hange 'pluginId' to 'plugin' or it wouldn't save.
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "go-cd" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "go-cd" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "go-cd" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to