# \[solved\] Jsonnet multiple pipelines

**URL:** <https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132>\
**Category:** Drone Support\
**Created:** [November 14, 2019, 7:55am UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132 "2019-11-14T07:55:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![m42e](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/m42e/32/2194_2.png) [@m42e](https://drone.discourse.group/u/m42e)\
**Post date:** [November 14, 2019, 7:55am UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/1 "2019-11-14T07:55:52Z")

</div>

Hi,

could someone help me how to have multiple pipelines using jsonnet? I could not figure it out, either I have one, or I get a “kind” missing message.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 14, 2019, 10:26pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/2 "2019-11-14T22:26:33Z")

</div>

example at [https://docs.drone.io/pipeline/docker/examples/languages/golang/#test-multiple-versions](https://docs.drone.io/pipeline/docker/examples/languages/golang/#test-multiple-versions)

---

<div class="post-metadata">

**Author:** ![m42e](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/m42e/32/2194_2.png) [@m42e](https://drone.discourse.group/u/m42e)\
**Post date:** [November 15, 2019, 12:50pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/3 "2019-11-15T12:50:37Z")

</div>

This did not work for me, I’m always getting the following error (using drone-cli 1.2.0):

```
2019/11/15 13:47:51 yaml: unmarshal errors:
line 1: cannot unmarshal !!seq into yaml.RawResource

```

What did I do wrong? I"m using the code as given in the example.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 15, 2019, 3:35pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/4 "2019-11-15T15:35:11Z")

</div>

you need to use the `--stream` flag when you are processing a stream of multiple yaml files.

---

<div class="post-metadata">

**Author:** ![bibekg](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bibekg/32/5856_2.png) [@bibekg](https://drone.discourse.group/u/bibekg)\
**Post date:** [April 8, 2020, 12:04am UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/5 "2020-04-08T00:04:06Z")

</div>

Had the same issue. Tried debugging by incrementally paring down my .jsonnet file until it had virtually nothing and I still kept getting the same error. Then on a whim, I tried transpiling the jsonnet to yml locally using `drone jsonnet --stream`, changed the config file back to `.drone.yml` and pushed up the newly transpiled `.yml` file and it worked as expected. Not ideal but usable workaround.

Edit: Hopefully this debugging flow can point the way toward figuring out the source of the problem?

---

<div class="post-metadata">

**Author:** ![cyberb](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/cyberb/32/3719_2.png) [@cyberb](https://drone.discourse.group/u/cyberb)\
**Post date:** [April 4, 2021, 9:24pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/6 "2021-04-04T21:24:52Z")

</div>

Am I right that multiple pipelines are not supported with server jsonnet to yaml conversion support (DRONE\_JSONNET\_ENABLED)?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [April 4, 2021, 10:33pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/7 "2021-04-04T22:33:44Z")

</div>

nope, multi-pipeline jsonnet files are fully supported

---

<div class="post-metadata">

**Author:** ![cyberb](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/cyberb/32/3719_2.png) [@cyberb](https://drone.discourse.group/u/cyberb)\
**Post date:** [April 5, 2021, 1:23pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/8 "2021-04-05T13:23:12Z")

</div>

Could you help me, I use.drone.jsonnet and convert to .drone.yml every time I change it. Both files in git and drone works fine.  
Tried enabling native support and got this error:

```auto
invalid or missing step name

```

What I did:

1. Self hosted drone v1.10.1
2. Server flag DRONE\_JSONNET\_ENABLED=true
3. Set file in UI to .drone.jsonnet
4. Removed generated .drone.yml
5. Got this error

> <https://github.com/syncloud/home-assistant/commit/f3646b4af3d54fab2652f03f256d6b06a0bac70f>

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [April 5, 2021, 3:02pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/9 "2021-04-05T15:02:21Z")

</div>

I clicked the link and I see two stages (arm and arm64) in the Drone user interface which means Drone successfully parsed your jsonnet file. If it was a problem with jsonnet parsing, or lacking support for multiple stages, we would not see those two stages in the user interface.

Instead, the error message tells me that the jsonnet generates an invalid yaml, where at least one of your pipeline steps does not have a name.

EDIT: I used the jsonnet command line tools to execute your jsonnet file, and I noticed you have empty steps with no data (see below). These empty steps are the root cause of the error, and need to be removed.

```nohighlight
      {},
      {},
      {
        "commands": [
          "VERSION=$(cat version)",
          "PACKAGE=$(cat package.name)",
          "pip2 install -r dev_requirements.txt",
          "syncloud-upload.sh home-assistant $DRONE_BRANCH $VERSION $PACKAGE"
        ],
        "environment": {
          "AWS_ACCESS_KEY_ID": {
            "from_secret": "AWS_ACCESS_KEY_ID"
          },
          "AWS_SECRET_ACCESS_KEY": {
            "from_secret": "AWS_SECRET_ACCESS_KEY"
          }
        },
        "image": "syncloud/build-deps-arm:2021.4.1",
        "name": "upload"
      },

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [April 5, 2021, 3:06pm UTC](https://drone.discourse.group/t/solved-jsonnet-multiple-pipelines/11132/10 "2021-04-05T15:06:45Z")

</div>

Closed on April 5, 2021, 3:06pm UTC


