<p>I want to run two commands in my cronjob.yaml one after each other. The first command runs a python-scipt and the second changes an environment variable in another pod. The commands added separately work.</p>

<p>This is what I'm trying right now (found the syntax in <a href="https://stackoverflow.com/q/33887194/11242263">How to set multiple commands in one yaml file with Kubernetes?</a> ) but it gives me an error.</p>

<pre><code>command:
- "/bin/bash"
- "-c"
args: ["python3 recalc.py &amp;&amp; kubectl set env deployment recommender --env="LAST_MANUAL_RESTART=$(date)" --namespace=default"]
</code></pre>

<p>The error I get in cloudbuild:</p>

<pre><code>error converting YAML to JSON: yaml: line 30: did not find expected ',' or ']'
</code></pre>

<p>(for the long line)</p>

Florian
<p>You have nested double quotes, try something more like this:</p>

<pre><code>command:
- /bin/bash
- -c
- python3 recalc.py &amp;&amp; kubectl set env deployment recommender --env="LAST_MANUAL_RESTART=$(date)" --namespace=default
</code></pre>

<p>i.e. without the outer double quotes.</p>
