<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://www.kolossi.co.uk/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.kolossi.co.uk/" rel="alternate" type="text/html" /><updated>2026-08-14T15:20:31+00:00</updated><id>https://www.kolossi.co.uk/feed.xml</id><title type="html">The Kolossi Courier</title><subtitle>A collection of missives on various topics</subtitle><author><name>Paul Sweeney</name></author><entry><title type="html">Kubevela PR build</title><link href="https://www.kolossi.co.uk/kubevela-pr-build/" rel="alternate" type="text/html" title="Kubevela PR build" /><published>2023-04-14T00:00:00+00:00</published><updated>2023-04-14T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/kubevela-pr-build</id><content type="html" xml:base="https://www.kolossi.co.uk/kubevela-pr-build/"><![CDATA[<p>To perform a build of kubevela to submit a pr, but without installing
all the dependencies on local …
<!--more--></p>

<p>Here’s how to do it on Windows WSL2 with Docker Desktop.</p>

<ul>
  <li>
    <p>Start Docker Desktop and do</p>

    <ul>
      <li>:gear: -&gt; kubernetes -&gt; :ballot_box_with_check: Enable Kubernetes -&gt; apply</li>
    </ul>
  </li>
  <li>
    <p>Start WSL2 prompt.</p>
  </li>
</ul>

<p><strong>NOTE</strong> : the required docker image is available on docker hub as
<a href="https://hub.docker.com/r/kolossi/kubevela_dev/tags">kolossi/kubevela_dev:1.0.19</a>, 
so there isn’t a need to build it, but if you wish to do so:</p>

<blockquote>
  <ul>
    <li>In a working directory, save a file <code class="language-plaintext highlighter-rouge">kubevela_dev_Dockerfile</code> with the following content:</li>
  </ul>

  <div class="language-dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">FROM</span><span class="s"> golang:1.19.10-buster</span>
<span class="k">WORKDIR</span><span class="s"> /tmp</span>
<span class="k">RUN </span>apt-get update <span class="o">&amp;&amp;</span> apt-get <span class="nb">install</span> <span class="nt">-y</span> curl make git gcc bash ca-certificates gnupg
<span class="k">RUN </span><span class="nb">mkdir</span> <span class="nt">-p</span> /etc/apt/keyrings
<span class="k">RUN </span>curl <span class="nt">-fsSL</span> https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg <span class="nt">--dearmor</span> <span class="nt">-o</span> /etc/apt/keyrings/nodesource.gpg
<span class="k">ENV</span><span class="s"> NODE_MAJOR=21</span>
<span class="k">RUN </span><span class="nb">echo</span> <span class="s2">"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_</span><span class="nv">$NODE_MAJOR</span><span class="s2">.x nodistro main"</span> | <span class="nb">tee</span> /etc/apt/sources.list.d/nodesource.list
<span class="k">RUN </span>git config <span class="nt">--system</span> <span class="nt">--add</span> safe.directory /root/kubevela
<span class="k">RUN </span>apt-get update <span class="o">&amp;&amp;</span> apt-get <span class="nb">install</span> <span class="nt">-y</span> nodejs
<span class="k">ENV</span><span class="s"> PATH $PATH:/usr/local/go/bin:/root/kubevela/bin</span>
<span class="k">RUN </span>curl <span class="nt">-LO</span> <span class="s2">"https://dl.k8s.io/release/</span><span class="si">$(</span>curl <span class="nt">-L</span> <span class="nt">-s</span> https://dl.k8s.io/release/stable.txt<span class="si">)</span><span class="s2">/bin/linux/amd64/kubectl"</span>
<span class="k">RUN </span><span class="nb">install</span> <span class="nt">-o</span> root <span class="nt">-g</span> root <span class="nt">-m</span> 0755 kubectl /usr/local/bin/kubectl
<span class="k">ENV</span><span class="s"> KUBECONFIG /root/.kube/config</span>
<span class="k">RUN </span><span class="nb">cd</span> /usr/local/go/ <span class="o">&amp;&amp;</span> curl <span class="nt">-sSfL</span> https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh <span class="nt">-s</span> <span class="nt">--</span> <span class="nt">-b</span> /usr/local/go/bin v1.49.0
<span class="k">RUN </span>curl <span class="nt">-s</span> <span class="s2">"https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"</span>  | bash
<span class="k">RUN </span><span class="nb">mv </span>kustomize /usr/local/bin
<span class="k">RUN </span>go <span class="nb">install </span>github.com/onsi/ginkgo/v2/ginkgo@latest
<span class="k">RUN </span>curl <span class="nt">-LO</span> https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-1.21.2-linux-amd64.tar.gz <span class="o">&amp;&amp;</span> <span class="se">\
</span>      <span class="nb">tar</span> <span class="nt">-zxvf</span>  kubebuilder-tools-1.21.2-linux-amd64.tar.gz <span class="o">&amp;&amp;</span> <span class="se">\
</span>      <span class="nb">mkdir</span> <span class="nt">-p</span> /usr/local/kubebuilder/bin <span class="o">&amp;&amp;</span> <span class="se">\
</span>      <span class="nb">mv </span>kubebuilder/bin/<span class="k">*</span> /usr/local/kubebuilder/bin
<span class="k">RUN </span>go <span class="nb">install </span>cuelang.org/go/cmd/cue@v0.4.3
<span class="k">RUN </span>go <span class="nb">install </span>honnef.co/go/tools/cmd/staticcheck@2022.1
<span class="k">RUN </span>go <span class="nb">install </span>sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2
<span class="k">RUN </span>go <span class="nb">install </span>golang.org/x/tools/cmd/goimports@latest
<span class="k">RUN </span>git clone https://github.com/bitnami-labs/readme-generator-for-helm
<span class="k">RUN </span>npm <span class="nb">install</span> ./readme-generator-for-helm
<span class="k">RUN </span><span class="nb">rm</span> <span class="nt">-rf</span> /tmp/<span class="k">*</span>
<span class="k">WORKDIR</span><span class="s"> /root/kubevela</span>
</code></pre></div>  </div>

  <ul>
    <li>Build the image with:</li>
  </ul>

  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker build -f kubevela_dev_Dockerfile -t kolossi/kubevela_dev:1.0.19 .
</code></pre></div>  </div>
</blockquote>

<ul>
  <li>checkout kubevela code with</li>
</ul>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone git@github.com:kubevela/kubevela.git
</code></pre></div></div>

<ul>
  <li>
    <p>make your changes to the code</p>
  </li>
  <li>
    <p>use the docker image to perform the required <code class="language-plaintext highlighter-rouge">make</code> and <code class="language-plaintext highlighter-rouge">make reviewable</code> to 
validate the changes before pushing to a fork and raising a PR:</p>
  </li>
</ul>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
        <span class="nt">-it</span> <span class="nt">--rm</span> <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/repos/kubevela:/root/kubevela <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/.kube/:/root/.kube/ <span class="se">\</span>
        kolossi/kubevela_dev:1.0.19 <span class="se">\</span>
        bash <span class="nt">-c</span> <span class="s2">"make &amp;&amp; make reviewable"</span>
</code></pre></div></div>

<p>Note that edited files may have their owner and perms changed, to fix do:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chown YOUR-USER:YOUR-USER filename
chmod 644 filename
</code></pre></div></div>

<h3 id="performance">Performance</h3>

<p>To improve performance on re-runs, mount the go pkg directory from local into
the container so packages don’t need to be downloaded each run:</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
        <span class="nt">-it</span> <span class="nt">--rm</span> <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/repos/kubevela:/root/kubevela <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/.kube/:/root/.kube/ <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/gopkg:/go/pkg <span class="se">\</span>
        kolossi/kubevela_dev:1.0.19 <span class="se">\</span>
        bash <span class="nt">-c</span> <span class="s2">"make &amp;&amp; make reviewable"</span>
</code></pre></div></div>

<h3 id="zscaler">zscaler</h3>

<p>If using ZScaler (or another MITM proxy), errors will occur during the kubevela
build due to the https/TLS connection not validating the untrusted CA cert.</p>

<p>To fix this, get a copy of the ca cert and store it in a <code class="language-plaintext highlighter-rouge">certs</code> subdirectory
of your home dir.  The builder image can then be used with the modified command:</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
        <span class="nt">-it</span> <span class="nt">--rm</span> <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/repos/kubevela:/root/kubevela <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/.kube/:/root/.kube/ <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/gopkg:/go/pkg <span class="se">\</span>
        <span class="nt">-v</span> /home/YOUR-USER/certs/ZscalerRootCertificate-2048-SHA256.crt:/usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt <span class="se">\</span>
        kolossi/kubevela_dev:1.0.19 <span class="se">\</span>
        bash <span class="nt">-c</span> <span class="s2">"update-ca-certificates &amp;&amp; npm config set cafile /etc/ssl/certs/ca-certificates.crt &amp;&amp; make &amp;&amp; make reviewable"</span>
</code></pre></div></div>

<h3 id="thanks">Thanks</h3>

<p>The following links were helpful in preparing the docker file:</p>

<ul>
  <li><a href="https://github.com/wonderflow/kubevela.io/blob/b4b7bae0a90e0b087df79e5ba5c46fdca072e4f6/docs/contributor/code-contribute.md#run-kubevela-locally">kubevela instructions</a></li>
  <li><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/">kubectl install instructions</a></li>
  <li><a href="https://github.com/nodesource/distributions#debinstall">nodejs install instructions</a></li>
  <li><a href="https://stackoverflow.com/a/67232164/2738122">debian/alpine zscaler ca fix</a></li>
  <li><a href="https://stackoverflow.com/a/67688638/2738122">npm zscaler ca fix</a></li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="kubevela" /><category term="pr" /><category term="build" /><summary type="html"><![CDATA[To perform a build of kubevela to submit a pr, but without installing all the dependencies on local …]]></summary></entry><entry><title type="html">azure devops pipelines var access part 2</title><link href="https://www.kolossi.co.uk/azure-devops-pipelines-var-access-part-2/" rel="alternate" type="text/html" title="azure devops pipelines var access part 2" /><published>2023-04-06T00:00:00+00:00</published><updated>2023-04-06T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/azure-devops-pipelines-var-access-part-2</id><content type="html" xml:base="https://www.kolossi.co.uk/azure-devops-pipelines-var-access-part-2/"><![CDATA[<p>How to access Azure devops pipelines variables and parameters in a way
that is reliable both in a script and in template conditions
<!--more--></p>

<h2 id="intro">Intro</h2>

<p>Finding a reliable way to accessing Azure devops pipelines variables and pass 
them to templates as parameters can be tricky. Particularly when needing both
access in a shell script and in adding conditional steps to a template using 
the <code class="language-plaintext highlighter-rouge">- ? </code> construct.</p>

<p>In the previous post <a href="/azure-devops-pipelines-var-access/">azure-devops-pipelines-var-access</a>
attention was turned to access of script-generated vars between stages, jobs
and steps.</p>

<p>In this post it’s focussing on reliable access at both “compile time” and
“runtime” and in predictably dealing with unset variables.</p>

<h2 id="suggested-guidelines">Suggested Guidelines</h2>

<p>For anything that needs to be used in a template conditional step check 
<code class="language-plaintext highlighter-rouge">- ? {{ if ...}}</code> construct, the value cannot be from a Library Variable Group.
This means anywhere up the chain of parameter passing or variable 
assignment/reassignment.  It’s probably best for the caller to use a literal
value for the param.  If it can’t be literal, it must be from a
literally-defined variable (not library variable group value), or a pipeline
param entered by user or defaulted.</p>

<p>To prevent issues with Library Variable Group keys with the same name as a
variable causing the value to be changed when using in a script, reassign a
parameter or variable to an env var of a different name - e.g. prefix with
<code class="language-plaintext highlighter-rouge">SH_</code>.</p>

<p>Within an inline shell script only refer to the env var in usual script format 
<code class="language-plaintext highlighter-rouge">$SH_VAR</code> or <code class="language-plaintext highlighter-rouge">${SH_VAR}</code>.  Do not use <code class="language-plaintext highlighter-rouge">$(VAR)</code>, <code class="language-plaintext highlighter-rouge">$[variables.VAR]</code> or 
<code class="language-plaintext highlighter-rouge">{{variables[VAR]}}</code> anywhere within an inline shell script.</p>

<p>So for example do:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">parameters</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">my_param</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>

<span class="pi">-</span> <span class="na">variables</span><span class="pi">:</span>
  <span class="na">name</span><span class="pi">:</span> <span class="s">my_var</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>

<span class="nn">...</span>

<span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
    <span class="s">echo "my param: ${SH_my_param}"</span>
    <span class="s">echo "my var: ${SH_my_var}</span>
  <span class="na">env</span><span class="pi">:</span>
    <span class="na">SH_my_param</span><span class="pi">:</span> <span class="s">${{parameters.my_param}}</span>
    <span class="na">SH_my_var</span><span class="pi">:</span> <span class="s">$(my_var)</span>
</code></pre></div></div>

<p>There is only one possible syntax to access a parameter value - 
<code class="language-plaintext highlighter-rouge">${{parameters.my_param}}</code>.</p>

<p>Use the <code class="language-plaintext highlighter-rouge">$(my_var)</code> syntax, to access a variable value to pass to a parameter or
a shell env var.  Given that this stays literal “$(my_var)” if <code class="language-plaintext highlighter-rouge">my_var</code> is not
defined, if necessary use a utility script to check for likely azure devops 
pipeline formats that may indicate an expected replacement has not occured. e.g.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">function </span>cicd_pipeline_value_is_set
<span class="o">{</span>
   <span class="nv">pipelineValue</span><span class="o">=</span><span class="nv">$1</span>

   <span class="o">[[</span> <span class="o">!</span> <span class="nt">-z</span> <span class="si">$(</span><span class="nb">echo</span> <span class="nv">$pipelineValue</span><span class="si">)</span> <span class="o">]]</span> <span class="se">\</span>
      <span class="o">&amp;&amp;</span> <span class="o">[[</span> <span class="o">!</span> <span class="nv">$pipelineValue</span> <span class="o">=</span>~ ^<span class="se">\$\(</span>.<span class="k">*</span><span class="se">\)</span><span class="nv">$ </span><span class="o">]]</span> <span class="se">\</span>
      <span class="o">&amp;&amp;</span> <span class="o">[[</span> <span class="o">!</span> <span class="nv">$pipelineValue</span> <span class="o">=</span>~ ^<span class="se">\$\[</span>variables<span class="se">\.</span>.<span class="k">*</span><span class="se">\]</span><span class="nv">$ </span><span class="o">]]</span> <span class="se">\</span>
      <span class="o">&amp;&amp;</span> <span class="o">[[</span> <span class="o">!</span> <span class="nv">$pipelineValue</span> <span class="o">=</span>~ ^<span class="se">\$\{\{</span>variables<span class="se">\.</span>.<span class="k">*</span><span class="se">\}\}</span><span class="nv">$ </span><span class="o">]]</span> <span class="se">\</span>
      <span class="o">&amp;&amp;</span> <span class="o">[[</span> <span class="o">!</span> <span class="nv">$pipelineValue</span> <span class="o">=</span>~ ^<span class="se">\$\{\{</span>parameters<span class="se">\.</span>.<span class="k">*</span><span class="se">\}\}</span><span class="nv">$ </span><span class="o">]]</span>
<span class="o">}</span>
</code></pre></div></div>

<p>and use it in a script with something like:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
    <span class="s">cicd_pipeline_value_is_set $SH_my_var || export SH_my_var=''</span>
    <span class="s">...</span>
  <span class="na">env</span><span class="pi">:</span>
    <span class="na">SH_my_var</span><span class="pi">:</span> <span class="s">$(my_var)</span>
</code></pre></div></div>

<p>Note that the value of <code class="language-plaintext highlighter-rouge">my_var</code> may not match the name of the variable and
therefore the name of the <code class="language-plaintext highlighter-rouge">SH_</code> var.  For instance caller might do 
<code class="language-plaintext highlighter-rouge">host_param: $(does_not_exist)</code> so if our script does 
<code class="language-plaintext highlighter-rouge">env: sh_host_param: $(host_param)</code> the script can’t check if the value is set
to <code class="language-plaintext highlighter-rouge">"$(host_param)"</code> as a value, because it won’t be, it will have a value of 
<code class="language-plaintext highlighter-rouge">"$(does_not_exist)"</code> which is entirely down to the caller.</p>

<h2 id="deep-dive">Deep dive</h2>

<p>Trying to get to the bottom of all this, a variable group
<code class="language-plaintext highlighter-rouge">CICD_VAR_TEST</code>, was created with these values (but with the “SECRET” ones
actually made secret!):</p>
<div id="lib_var_group_table"></div>
<script type="text/javascript">
if (jsit_options !== null && typeof jsit_options == 'undefined') var jsit_options={};
var options = {
    headercells: true,
    columns: [
        { title: "Name", datafield: "Name" },
        { title: "Value", datafield: "Value" }
    ],
    data: [
      {Name:'CICD_OVERRIDE_VALUE',Value: 'TTTOverrideValue'},
      {Name:'CICD_SECRET_OVERRIDE_VALUE',Value: 'TTTSecretOverrideValue'},
      {Name:'CICD_SECRET_VALUE',Value: 'TTTSecretValue'},
      {Name:'CICD_VALUE',Value: 'TTTValue'}
    ]
};
jsit_options['lib_var_group_table'] = options;
if (!!options.data)
{
    $('#lib_var_group_table').JSIronTable(options);
}
else
{
    $.getJSON( "/", function( data ) {
        var options = jsit_options['lib_var_group_table'];
        options.data = data;
        var dataFilter = eval("");
        if (dataFilter) options.data = data.filter(dataFilter);
        $('#lib_var_group_table').JSIronTable(options);
    })
    .fail(function() {
        console.error("Error loading json from /");
    });
}
</script>

<p>The following pipeline and template files were used:</p>

<h3 id="azure_pipelinesyml">azure_pipelines.yml</h3>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">parameters</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">CICD_TestParam</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="na">variables</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">CICD_Literal</span>
  <span class="na">value</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTPipelineLiteral"</span>
<span class="pi">-</span> <span class="na">group</span><span class="pi">:</span> <span class="s">CICD_VAR_TEST</span>

<span class="na">trigger</span><span class="pi">:</span> <span class="s">none</span>

<span class="na">name</span><span class="pi">:</span> <span class="s">test.0.0$(Rev:.r)</span>

<span class="na">resources</span><span class="pi">:</span>
  <span class="na">repositories</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">repository</span><span class="pi">:</span> <span class="s">CICD</span>
      <span class="na">type</span><span class="pi">:</span> <span class="s">git</span>
      <span class="na">name</span><span class="pi">:</span> <span class="s">CICD/CICD</span>
      <span class="na">ref</span><span class="pi">:</span> <span class="s">GKE_AKS_Support</span>

<span class="na">pool</span><span class="pi">:</span> <span class="s">vmss-agentpool-linux-v2</span>

<span class="na">stages</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">template</span><span class="pi">:</span> <span class="s">testing/test_vars_stages.yml@CICD</span>
  <span class="na">parameters</span><span class="pi">:</span> 
     <span class="na">CICD_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTNewValue"</span>
     <span class="na">CICD_SECRET_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTNewSecretValue"</span>
     <span class="na">PARAMLibrary1</span><span class="pi">:</span> <span class="s">$(CICD_VALUE)</span>
     <span class="na">PARAMLibrary2</span><span class="pi">:</span> <span class="s">${{variables.CICD_VALUE}}</span>
     <span class="na">PARAMLibrary3</span><span class="pi">:</span> <span class="s">$[variables.CICD_VALUE]</span>
     <span class="na">PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s">$(CICD_SECRET_VALUE)</span>
     <span class="na">PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s">${{variables.CICD_SECRET_VALUE}}</span>
     <span class="na">PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s">$[variables.CICD_SECRET_VALUE]</span>
     <span class="na">PARAMAssigned1</span><span class="pi">:</span> <span class="s">$(CICD_Literal)</span>
     <span class="na">PARAMAssigned2</span><span class="pi">:</span> <span class="s">${{variables.CICD_Literal}}</span>
     <span class="na">PARAMAssigned3</span><span class="pi">:</span> <span class="s">$[variables.CICD_Literal]</span>
     <span class="na">PARAMMissing1</span><span class="pi">:</span> <span class="s">$(DOES_NOT_EXIST)</span>
     <span class="na">PARAMMissing2</span><span class="pi">:</span> <span class="s">${{variables.DOES_NOT_EXIST}}</span>
     <span class="na">PARAMMissing3</span><span class="pi">:</span> <span class="s">$[variables.DOES_NOT_EXIST]</span>
     <span class="na">PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTLiteral"</span>
     <span class="na">PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="nv"> </span><span class="s">"</span>
     <span class="na">PARAMParam</span><span class="pi">:</span> <span class="s">${{parameters.CICD_TestParam}}</span>
</code></pre></div></div>

<h3 id="test_var_stagesyml">test_var_stages.yml</h3>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">#--------------------------------------------</span>
<span class="na">parameters</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">CICD_OVERRIDE_VALUE</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">CICD_SECRET_OVERRIDE_VALUE</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrary1</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrary2</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrary3</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrarySecret1</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrarySecret2</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLibrarySecret3</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMAssigned1</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMAssigned2</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMAssigned3</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMMissing1</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMMissing2</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMMissing3</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMLiteral</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMEmpty</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMParam</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">PARAMDefaulted</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
  <span class="na">default</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTDefault"</span>
<span class="c1">#--------------------------------------------</span>

<span class="na">stages</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">stage</span><span class="pi">:</span> <span class="s">VarsTest</span>
  <span class="na">jobs</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">deployment</span><span class="pi">:</span> <span class="s">varsTest</span>
    <span class="na">variables</span><span class="pi">:</span>
      <span class="na">VAR_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary1}}"</span>
      <span class="na">VAR_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary2}}"</span>
      <span class="na">VAR_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary3}}"</span>
      <span class="na">VAR_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret1}}"</span>
      <span class="na">VAR_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret2}}"</span>
      <span class="na">VAR_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret3}}"</span>
      <span class="na">VAR_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned1}}"</span>
      <span class="na">VAR_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned2}}"</span>
      <span class="na">VAR_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned3}}"</span>
      <span class="na">VAR_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing1}}"</span>
      <span class="na">VAR_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing2}}"</span>
      <span class="na">VAR_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing3}}"</span>
      <span class="na">VAR_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLiteral}}"</span>
      <span class="na">VAR_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMEmpty}}"</span>
      <span class="na">VAR_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMParam}}"</span>
      <span class="na">VAR_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMDefaulted}}"</span>
      <span class="na">VAR_Literal</span><span class="pi">:</span> <span class="s2">"</span><span class="s">TTTVAR"</span>
    <span class="na">environment</span><span class="pi">:</span> <span class="s">dv</span>
    <span class="na">displayName</span><span class="pi">:</span> <span class="s">varsTest</span>
    <span class="na">strategy</span><span class="pi">:</span>
      <span class="na">runOnce</span><span class="pi">:</span>
        <span class="na">deploy</span><span class="pi">:</span>
          <span class="na">steps</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">echo "  PARAMLibrary1='${PARAMLibrary1}'"</span>
              <span class="s">echo "  PARAMLibrary2='${PARAMLibrary2}'"</span>
              <span class="s">echo "  PARAMLibrary3='${PARAMLibrary3}'"</span>
              <span class="s">echo "  PARAMLibrarySecret1='${PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  PARAMLibrarySecret2='${PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  PARAMLibrarySecret3='${PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  PARAMAssigned1='${PARAMAssigned1}'"</span>
              <span class="s">echo "  PARAMAssigned2='${PARAMAssigned2}'"</span>
              <span class="s">echo "  PARAMAssigned3='${PARAMAssigned3}'"</span>
              <span class="s">echo "  PARAMMissing1='${PARAMMissing1}'"</span>
              <span class="s">echo "  PARAMMissing2='${PARAMMissing2}'"</span>
              <span class="s">echo "  PARAMMissing3='${PARAMMissing3}'"</span>
              <span class="s">echo "  PARAMLiteral='${PARAMLiteral}'"</span>
              <span class="s">echo "  PARAMEmpty='${PARAMEmpty}'"</span>
              <span class="s">echo "  PARAMParam='${PARAMParam}'"</span>
              <span class="s">echo "  PARAMDefaulted='${PARAMDefaulted}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  CICD_OVERRIDE_VALUE='${CICD_OVERRIDE_VALUE}'"</span>
              <span class="s">echo "  CICD_SECRET_OVERRIDE_VALUE='${CICD_SECRET_OVERRIDE_VALUE}'"</span>
              <span class="s">echo "  SH_CICD_OVERRIDE_VALUE='${SH_CICD_OVERRIDE_VALUE}'"</span>
              <span class="s">echo "  SH_CICD_SECRET_OVERRIDE_VALUE='${SH_CICD_SECRET_OVERRIDE_VALUE}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  VAR_PARAMLibrary1='${VAR_PARAMLibrary1}'"</span>
              <span class="s">echo "  VAR_PARAMLibrary2='${VAR_PARAMLibrary2}'"</span>
              <span class="s">echo "  VAR_PARAMLibrary3='${VAR_PARAMLibrary3}'"</span>
              <span class="s">echo "  VAR_PARAMLibrarySecret1='${VAR_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  VAR_PARAMLibrarySecret2='${VAR_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  VAR_PARAMLibrarySecret3='${VAR_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  VAR_PARAMAssigned1='${VAR_PARAMAssigned1}'"</span>
              <span class="s">echo "  VAR_PARAMAssigned2='${VAR_PARAMAssigned2}'"</span>
              <span class="s">echo "  VAR_PARAMAssigned3='${VAR_PARAMAssigned3}'"</span>
              <span class="s">echo "  VAR_PARAMMissing1='${VAR_PARAMMissing1}'"</span>
              <span class="s">echo "  VAR_PARAMMissing2='${VAR_PARAMMissing2}'"</span>
              <span class="s">echo "  VAR_PARAMMissing3='${VAR_PARAMMissing3}'"</span>
              <span class="s">echo "  VAR_PARAMLiteral='${VAR_PARAMLiteral}'"</span>
              <span class="s">echo "  VAR_PARAMEmpty='${VAR_PARAMEmpty}'"</span>
              <span class="s">echo "  VAR_PARAMParam='${VAR_PARAMParam}'"</span>
              <span class="s">echo "  VAR_PARAMDefaulted='${VAR_PARAMDefaulted}'"</span>
              <span class="s">echo "  VAR_Literal='${VAR_Literal}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  VAR1_PARAMLibrary1='$(VAR_PARAMLibrary1)'"</span>
              <span class="s">echo "  VAR1_PARAMLibrary2='$(VAR_PARAMLibrary2)'"</span>
              <span class="s">echo "  VAR1_PARAMLibrary3='$(VAR_PARAMLibrary3)'"</span>
              <span class="s">echo "  VAR1_PARAMLibrarySecret1='$(VAR_PARAMLibrarySecret1)'"</span>
              <span class="s">echo "  VAR1_PARAMLibrarySecret2='$(VAR_PARAMLibrarySecret2)'"</span>
              <span class="s">echo "  VAR1_PARAMLibrarySecret3='$(VAR_PARAMLibrarySecret3)'"</span>
              <span class="s">echo "  VAR1_PARAMAssigned1='$(VAR_PARAMAssigned1)'"</span>
              <span class="s">echo "  VAR1_PARAMAssigned2='$(VAR_PARAMAssigned2)'"</span>
              <span class="s">echo "  VAR1_PARAMAssigned3='$(VAR_PARAMAssigned3)'"</span>
              <span class="s">echo "  VAR1_PARAMMissing1='$(VAR_PARAMMissing1)'"</span>
              <span class="s">echo "  VAR1_PARAMMissing2='$(VAR_PARAMMissing2)'"</span>
              <span class="s">echo "  VAR1_PARAMMissing3='$(VAR_PARAMMissing3)'"</span>
              <span class="s">echo "  VAR1_PARAMLiteral='$(VAR_PARAMLiteral)'"</span>
              <span class="s">echo "  VAR1_PARAMEmpty='$(VAR_PARAMEmpty)'"</span>
              <span class="s">echo "  VAR1_PARAMParam='$(VAR_PARAMParam)'"</span>
              <span class="s">echo "  VAR1_PARAMDefaulted='$(VAR_PARAMDefaulted)'"</span>
              <span class="s">echo "  VAR1_Literal='$(VAR_Literal)'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  VAR2_PARAMLibrary1='${{variables.VAR_PARAMLibrary1}}'"</span>
              <span class="s">echo "  VAR2_PARAMLibrary2='${{variables.VAR_PARAMLibrary2}}'"</span>
              <span class="s">echo "  VAR2_PARAMLibrary3='${{variables.VAR_PARAMLibrary3}}'"</span>
              <span class="s">echo "  VAR2_PARAMLibrarySecret1='${{variables.VAR_PARAMLibrarySecret1}}'"</span>
              <span class="s">echo "  VAR2_PARAMLibrarySecret2='${{variables.VAR_PARAMLibrarySecret2}}'"</span>
              <span class="s">echo "  VAR2_PARAMLibrarySecret3='${{variables.VAR_PARAMLibrarySecret3}}'"</span>
              <span class="s">echo "  VAR2_PARAMAssigned1='${{variables.VAR_PARAMAssigned1}}'"</span>
              <span class="s">echo "  VAR2_PARAMAssigned2='${{variables.VAR_PARAMAssigned2}}'"</span>
              <span class="s">echo "  VAR2_PARAMAssigned3='${{variables.VAR_PARAMAssigned3}}'"</span>
              <span class="s">echo "  VAR2_PARAMMissing1='${{variables.VAR_PARAMMissing1}}'"</span>
              <span class="s">echo "  VAR2_PARAMMissing2='${{variables.VAR_PARAMMissing2}}'"</span>
              <span class="s">echo "  VAR2_PARAMMissing3='${{variables.VAR_PARAMMissing3}}'"</span>
              <span class="s">echo "  VAR2_PARAMLiteral='${{variables.VAR_PARAMLiteral}}'"</span>
              <span class="s">echo "  VAR2_PARAMEmpty='${{variables.VAR_PARAMEmpty}}'"</span>
              <span class="s">echo "  VAR2_PARAMParam='${{variables.VAR_PARAMParam}}'"</span>
              <span class="s">echo "  VAR2_PARAMDefaulted='${{variables.VAR_PARAMDefaulted}}'"</span>
              <span class="s">echo "  VAR2_Literal='${{variables.VAR_Literal}}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  VAR3_PARAMLibrary1='$[variables.VAR_PARAMLibrary1]'"</span>
              <span class="s">echo "  VAR3_PARAMLibrary2='$[variables.VAR_PARAMLibrary2]'"</span>
              <span class="s">echo "  VAR3_PARAMLibrary3='$[variables.VAR_PARAMLibrary3]'"</span>
              <span class="s">echo "  VAR3_PARAMLibrarySecret1='$[variables.VAR_PARAMLibrarySecret1]'"</span>
              <span class="s">echo "  VAR3_PARAMLibrarySecret2='$[variables.VAR_PARAMLibrarySecret2]'"</span>
              <span class="s">echo "  VAR3_PARAMLibrarySecret3='$[variables.VAR_PARAMLibrarySecret3]'"</span>
              <span class="s">echo "  VAR3_PARAMAssigned1='$[variables.VAR_PARAMAssigned1]'"</span>
              <span class="s">echo "  VAR3_PARAMAssigned2='$[variables.VAR_PARAMAssigned2]'"</span>
              <span class="s">echo "  VAR3_PARAMAssigned3='$[variables.VAR_PARAMAssigned3]'"</span>
              <span class="s">echo "  VAR3_PARAMMissing1='$[variables.VAR_PARAMMissing1]'"</span>
              <span class="s">echo "  VAR3_PARAMMissing2='$[variables.VAR_PARAMMissing2]'"</span>
              <span class="s">echo "  VAR3_PARAMMissing3='$[variables.VAR_PARAMMissing3]'"</span>
              <span class="s">echo "  VAR3_PARAMLiteral='$[variables.VAR_PARAMLiteral]'"</span>
              <span class="s">echo "  VAR3_PARAMEmpty='$[variables.VAR_PARAMEmpty]'"</span>
              <span class="s">echo "  VAR3_PARAMParam='$[variables.VAR_PARAMParam]'"</span>
              <span class="s">echo "  VAR3_PARAMDefaulted='$[variables.VAR_PARAMDefaulted]'"</span>
              <span class="s">echo "  VAR3_Literal='$[variables.VAR_Literal]'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_PARAMLibrary1='${SH_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_PARAMLibrary2='${SH_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_PARAMLibrary3='${SH_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_PARAMLibrarySecret1='${SH_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_PARAMLibrarySecret2='${SH_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_PARAMLibrarySecret3='${SH_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_PARAMAssigned1='${SH_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_PARAMAssigned2='${SH_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_PARAMAssigned3='${SH_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_PARAMMissing1='${SH_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_PARAMMissing2='${SH_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_PARAMMissing3='${SH_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_PARAMLiteral='${SH_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_PARAMEmpty='${SH_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_PARAMParam='${SH_PARAMParam}'"</span>
              <span class="s">echo "  SH_PARAMDefaulted='${SH_PARAMDefaulted}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrary1='${SH_VAR1_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrary2='${SH_VAR1_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrary3='${SH_VAR1_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrarySecret1='${SH_VAR1_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrarySecret2='${SH_VAR1_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLibrarySecret3='${SH_VAR1_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMAssigned1='${SH_VAR1_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMAssigned2='${SH_VAR1_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMAssigned3='${SH_VAR1_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMMissing1='${SH_VAR1_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMMissing2='${SH_VAR1_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMMissing3='${SH_VAR1_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMLiteral='${SH_VAR1_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMEmpty='${SH_VAR1_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMParam='${SH_VAR1_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR1_PARAMDefaulted='${SH_VAR1_PARAMDefaulted}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrary1='${SH_VAR2_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrary2='${SH_VAR2_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrary3='${SH_VAR2_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrarySecret1='${SH_VAR2_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrarySecret2='${SH_VAR2_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLibrarySecret3='${SH_VAR2_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMAssigned1='${SH_VAR2_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMAssigned2='${SH_VAR2_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMAssigned3='${SH_VAR2_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMMissing1='${SH_VAR2_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMMissing2='${SH_VAR2_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMMissing3='${SH_VAR2_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMLiteral='${SH_VAR2_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMEmpty='${SH_VAR2_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMParam='${SH_VAR2_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR2_PARAMDefaulted='${SH_VAR2_PARAMDefaulted}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrary1='${SH_VAR3_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrary2='${SH_VAR3_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrary3='${SH_VAR3_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrarySecret1='${SH_VAR3_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrarySecret2='${SH_VAR3_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLibrarySecret3='${SH_VAR3_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMAssigned1='${SH_VAR3_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMAssigned2='${SH_VAR3_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMAssigned3='${SH_VAR3_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMMissing1='${SH_VAR3_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMMissing2='${SH_VAR3_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMMissing3='${SH_VAR3_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMLiteral='${SH_VAR3_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMEmpty='${SH_VAR3_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMParam='${SH_VAR3_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR3_PARAMDefaulted='${SH_VAR3_PARAMDefaulted}'"</span>
              <span class="s">#pline fail   echo "---"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrary1='${SH_VAR_PARAMLibrary1}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrary2='${SH_VAR_PARAMLibrary2}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrary3='${SH_VAR_PARAMLibrary3}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrarySecret1='${SH_VAR_PARAMLibrarySecret1}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrarySecret2='${SH_VAR_PARAMLibrarySecret2}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLibrarySecret3='${SH_VAR_PARAMLibrarySecret3}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMAssigned1='${SH_VAR_PARAMAssigned1}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMAssigned2='${SH_VAR_PARAMAssigned2}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMAssigned3='${SH_VAR_PARAMAssigned3}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMMissing1='${SH_VAR_PARAMMissing1}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMMissing2='${SH_VAR_PARAMMissing2}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMMissing3='${SH_VAR_PARAMMissing3}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMLiteral='${SH_VAR_PARAMLiteral}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMEmpty='${SH_VAR_PARAMEmpty}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMParam='${SH_VAR_PARAMParam}'"</span>
              <span class="s">#pline fail   echo "  SH_VAR_PARAMDefaulted='${SH_VAR_PARAMDefaulted}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrary1='${SH_VAR1_VAR_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrary2='${SH_VAR1_VAR_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrary3='${SH_VAR1_VAR_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrarySecret1='${SH_VAR1_VAR_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrarySecret2='${SH_VAR1_VAR_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLibrarySecret3='${SH_VAR1_VAR_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMAssigned1='${SH_VAR1_VAR_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMAssigned2='${SH_VAR1_VAR_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMAssigned3='${SH_VAR1_VAR_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMMissing1='${SH_VAR1_VAR_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMMissing2='${SH_VAR1_VAR_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMMissing3='${SH_VAR1_VAR_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMLiteral='${SH_VAR1_VAR_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMEmpty='${SH_VAR1_VAR_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMParam='${SH_VAR1_VAR_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_PARAMDefaulted='${SH_VAR1_VAR_PARAMDefaulted}'"</span>
              <span class="s">echo "  SH_VAR1_VAR_Literal='${SH_VAR1_VAR_Literal}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrary1='${SH_VAR2_VAR_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrary2='${SH_VAR2_VAR_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrary3='${SH_VAR2_VAR_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrarySecret1='${SH_VAR2_VAR_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrarySecret2='${SH_VAR2_VAR_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLibrarySecret3='${SH_VAR2_VAR_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMAssigned1='${SH_VAR2_VAR_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMAssigned2='${SH_VAR2_VAR_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMAssigned3='${SH_VAR2_VAR_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMMissing1='${SH_VAR2_VAR_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMMissing2='${SH_VAR2_VAR_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMMissing3='${SH_VAR2_VAR_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMLiteral='${SH_VAR2_VAR_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMEmpty='${SH_VAR2_VAR_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMParam='${SH_VAR2_VAR_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_PARAMDefaulted='${SH_VAR2_VAR_PARAMDefaulted}'"</span>
              <span class="s">echo "  SH_VAR2_VAR_Literal='${SH_VAR2_VAR_Literal}'"</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrary1='${SH_VAR3_VAR_PARAMLibrary1}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrary2='${SH_VAR3_VAR_PARAMLibrary2}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrary3='${SH_VAR3_VAR_PARAMLibrary3}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrarySecret1='${SH_VAR3_VAR_PARAMLibrarySecret1}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrarySecret2='${SH_VAR3_VAR_PARAMLibrarySecret2}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLibrarySecret3='${SH_VAR3_VAR_PARAMLibrarySecret3}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMAssigned1='${SH_VAR3_VAR_PARAMAssigned1}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMAssigned2='${SH_VAR3_VAR_PARAMAssigned2}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMAssigned3='${SH_VAR3_VAR_PARAMAssigned3}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMMissing1='${SH_VAR3_VAR_PARAMMissing1}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMMissing2='${SH_VAR3_VAR_PARAMMissing2}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMMissing3='${SH_VAR3_VAR_PARAMMissing3}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMLiteral='${SH_VAR3_VAR_PARAMLiteral}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMEmpty='${SH_VAR3_VAR_PARAMEmpty}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMParam='${SH_VAR3_VAR_PARAMParam}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_PARAMDefaulted='${SH_VAR3_VAR_PARAMDefaulted}'"</span>
              <span class="s">echo "  SH_VAR3_VAR_Literal='${SH_VAR3_VAR_Literal}'"</span>
              <span class="s">echo "==="</span>
              <span class="s">echo "env:"</span>
              <span class="s">echo "---"</span>
              <span class="s">env | grep 'PARAM\|VAR\|CICD' | sort</span>
              <span class="s">echo "---"</span>
              <span class="s">echo "==="</span>
            <span class="na">displayName</span><span class="pi">:</span> <span class="s">Show ALL</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">CICD_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.CICD_OVERRIDE_VALUE}}"</span>
              <span class="na">CICD_SECRET_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.CICD_SECRET_OVERRIDE_VALUE}}"</span>
              <span class="na">SH_CICD_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.CICD_OVERRIDE_VALUE}}"</span>
              <span class="na">SH_CICD_SECRET_OVERRIDE_VALUE</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.CICD_SECRET_OVERRIDE_VALUE}}"</span>
              <span class="na">SH_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary1}}"</span>
              <span class="na">SH_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary2}}"</span>
              <span class="na">SH_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrary3}}"</span>
              <span class="na">SH_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret1}}"</span>
              <span class="na">SH_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret2}}"</span>
              <span class="na">SH_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLibrarySecret3}}"</span>
              <span class="na">SH_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned1}}"</span>
              <span class="na">SH_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned2}}"</span>
              <span class="na">SH_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMAssigned3}}"</span>
              <span class="na">SH_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing1}}"</span>
              <span class="na">SH_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing2}}"</span>
              <span class="na">SH_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMMissing3}}"</span>
              <span class="na">SH_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMLiteral}}"</span>
              <span class="na">SH_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMEmpty}}"</span>
              <span class="na">SH_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMParam}}"</span>
              <span class="na">SH_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{parameters.PARAMDefaulted}}"</span>
              <span class="na">SH_VAR1_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrary1)"</span>
              <span class="na">SH_VAR1_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrary2)"</span>
              <span class="na">SH_VAR1_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrary3)"</span>
              <span class="na">SH_VAR1_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrarySecret1)"</span>
              <span class="na">SH_VAR1_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrarySecret2)"</span>
              <span class="na">SH_VAR1_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLibrarySecret3)"</span>
              <span class="na">SH_VAR1_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMAssigned1)"</span>
              <span class="na">SH_VAR1_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMAssigned2)"</span>
              <span class="na">SH_VAR1_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMAssigned3)"</span>
              <span class="na">SH_VAR1_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMMissing1)"</span>
              <span class="na">SH_VAR1_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMMissing2)"</span>
              <span class="na">SH_VAR1_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMMissing3)"</span>
              <span class="na">SH_VAR1_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMLiteral)"</span>
              <span class="na">SH_VAR1_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMEmpty)"</span>
              <span class="na">SH_VAR1_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMParam)"</span>
              <span class="na">SH_VAR1_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(PARAMDefaulted)"</span>
              <span class="na">SH_VAR2_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrary1}}"</span>
              <span class="na">SH_VAR2_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrary2}}"</span>
              <span class="na">SH_VAR2_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrary3}}"</span>
              <span class="na">SH_VAR2_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrarySecret1}}"</span>
              <span class="na">SH_VAR2_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrarySecret2}}"</span>
              <span class="na">SH_VAR2_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLibrarySecret3}}"</span>
              <span class="na">SH_VAR2_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMAssigned1}}"</span>
              <span class="na">SH_VAR2_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMAssigned2}}"</span>
              <span class="na">SH_VAR2_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMAssigned3}}"</span>
              <span class="na">SH_VAR2_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMMissing1}}"</span>
              <span class="na">SH_VAR2_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMMissing2}}"</span>
              <span class="na">SH_VAR2_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMMissing3}}"</span>
              <span class="na">SH_VAR2_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMLiteral}}"</span>
              <span class="na">SH_VAR2_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMEmpty}}"</span>
              <span class="na">SH_VAR2_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMParam}}"</span>
              <span class="na">SH_VAR2_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.PARAMDefaulted}}"</span>
              <span class="na">SH_VAR3_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrary1]"</span>
              <span class="na">SH_VAR3_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrary2]"</span>
              <span class="na">SH_VAR3_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrary3]"</span>
              <span class="na">SH_VAR3_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrarySecret1]"</span>
              <span class="na">SH_VAR3_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrarySecret2]"</span>
              <span class="na">SH_VAR3_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLibrarySecret3]"</span>
              <span class="na">SH_VAR3_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMAssigned1]"</span>
              <span class="na">SH_VAR3_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMAssigned2]"</span>
              <span class="na">SH_VAR3_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMAssigned3]"</span>
              <span class="na">SH_VAR3_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMMissing1]"</span>
              <span class="na">SH_VAR3_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMMissing2]"</span>
              <span class="na">SH_VAR3_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMMissing3]"</span>
              <span class="na">SH_VAR3_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMLiteral]"</span>
              <span class="na">SH_VAR3_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMEmpty]"</span>
              <span class="na">SH_VAR3_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMParam]"</span>
              <span class="na">SH_VAR3_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.PARAMDefaulted]"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrary1: "${{parameters.VAR_PARAMLibrary1}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrary2: "${{parameters.VAR_PARAMLibrary2}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrary3: "${{parameters.VAR_PARAMLibrary3}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrarySecret1: "${{parameters.VAR_PARAMLibrarySecret1}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrarySecret2: "${{parameters.VAR_PARAMLibrarySecret2}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLibrarySecret3: "${{parameters.VAR_PARAMLibrarySecret3}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMAssigned1: "${{parameters.VAR_PARAMAssigned1}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMAssigned2: "${{parameters.VAR_PARAMAssigned2}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMAssigned3: "${{parameters.VAR_PARAMAssigned3}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMMissing1: "${{parameters.VAR_PARAMMissing1}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMMissing2: "${{parameters.VAR_PARAMMissing2}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMMissing3: "${{parameters.VAR_PARAMMissing3}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMLiteral: "${{parameters.VAR_PARAMLiteral}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMEmpty: "${{parameters.VAR_PARAMEmpty}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMParam: "${{parameters.VAR_PARAMParam}}"</span>
<span class="c1">#pline fail   SH_VAR_PARAMDefaulted: "${{parameters.VAR_PARAMDefaulted}}"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrary1)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrary2)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrary3)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrarySecret1)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrarySecret2)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLibrarySecret3)"</span>
              <span class="na">SH_VAR1_VAR_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMAssigned1)"</span>
              <span class="na">SH_VAR1_VAR_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMAssigned2)"</span>
              <span class="na">SH_VAR1_VAR_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMAssigned3)"</span>
              <span class="na">SH_VAR1_VAR_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMMissing1)"</span>
              <span class="na">SH_VAR1_VAR_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMMissing2)"</span>
              <span class="na">SH_VAR1_VAR_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMMissing3)"</span>
              <span class="na">SH_VAR1_VAR_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLiteral)"</span>
              <span class="na">SH_VAR1_VAR_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMEmpty)"</span>
              <span class="na">SH_VAR1_VAR_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMParam)"</span>
              <span class="na">SH_VAR1_VAR_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMDefaulted)"</span>
              <span class="na">SH_VAR1_VAR_Literal</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$(VAR_PARAMLiteral)"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrary1}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrary2}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrary3}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrarySecret1}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrarySecret2}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLibrarySecret3}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMAssigned1}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMAssigned2}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMAssigned3}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMMissing1}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMMissing2}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMMissing3}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMLiteral}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMEmpty}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMParam}}"</span>
              <span class="na">SH_VAR2_VAR_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_PARAMDefaulted}}"</span>
              <span class="na">SH_VAR2_VAR_Literal</span><span class="pi">:</span> <span class="s2">"</span><span class="s">${{variables.VAR_Literal}}"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrary1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrary1]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrary2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrary2]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrary3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrary3]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrarySecret1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrarySecret1]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrarySecret2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrarySecret2]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLibrarySecret3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLibrarySecret3]"</span>
              <span class="na">SH_VAR3_VAR_PARAMAssigned1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMAssigned1]"</span>
              <span class="na">SH_VAR3_VAR_PARAMAssigned2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMAssigned2]"</span>
              <span class="na">SH_VAR3_VAR_PARAMAssigned3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMAssigned3]"</span>
              <span class="na">SH_VAR3_VAR_PARAMMissing1</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMMissing1]"</span>
              <span class="na">SH_VAR3_VAR_PARAMMissing2</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMMissing2]"</span>
              <span class="na">SH_VAR3_VAR_PARAMMissing3</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMMissing3]"</span>
              <span class="na">SH_VAR3_VAR_PARAMLiteral</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMLiteral]"</span>
              <span class="na">SH_VAR3_VAR_PARAMEmpty</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMEmpty]"</span>
              <span class="na">SH_VAR3_VAR_PARAMParam</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMParam]"</span>
              <span class="na">SH_VAR3_VAR_PARAMDefaulted</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_PARAMDefaulted]"</span>
              <span class="na">SH_VAR3_VAR_Literal</span><span class="pi">:</span> <span class="s2">"</span><span class="s">$[variables.VAR_Literal]"</span>

          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.CICD_OVERRIDE_VALUE, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_OVERRIDE_VALUE not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct CICD_OVERRIDE_VALUE not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.CICD_OVERRIDE_VALUE, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_OVERRIDE_VALUE empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG CICD_OVERRIDE_VALUE empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.CICD_SECRET_OVERRIDE_VALUE, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_SECRET_OVERRIDE_VALUE not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct CICD_SECRET_OVERRIDE_VALUE not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.CICD_SECRET_OVERRIDE_VALUE, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_SECRET_OVERRIDE_VALUE empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG CICD_SECRET_OVERRIDE_VALUE empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrary1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary1 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary1 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrary1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary1 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary1 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrary2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary2 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary2 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrary2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary2 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary2 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrary3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary3 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary3 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrary3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary3 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary3 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrarySecret1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret1 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret1 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrarySecret1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret1 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret1 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrarySecret2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret2 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret2 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrarySecret2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret2 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret2 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLibrarySecret3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret3 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret3 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLibrarySecret3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret3 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret3 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMAssigned1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned1 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned1 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMAssigned1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned1 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned1 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMAssigned2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned2 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned2 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMAssigned2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned2 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned2 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMAssigned3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned3 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned3 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMAssigned3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned3 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned3 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMMissing1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing1 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing1 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMMissing1, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing1 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing1 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMMissing2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing2 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing2 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMMissing2, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing2 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing2 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMMissing3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing3 not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing3 not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMMissing3, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing3 empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing3 empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMLiteral, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLiteral not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLiteral not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMLiteral, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLiteral empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLiteral empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMEmpty, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMEmpty not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMEmpty not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMEmpty, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMEmpty empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMEmpty empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMParam, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMParam not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMParam not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMParam, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMParam empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMParam empty</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if notin(parameters.PARAMDefaulted, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMDefaulted not empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMDefaulted not empty</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if in(parameters.PARAMDefaulted, '', ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMDefaulted empty"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMDefaulted empty</span>





          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.CICD_OVERRIDE_VALUE, 'TTTNewValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_OVERRIDE_VALUE incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG CICD_OVERRIDE_VALUE value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.CICD_OVERRIDE_VALUE, 'TTTNewValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_OVERRIDE_VALUE correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct CICD_OVERRIDE_VALUE value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.CICD_SECRET_OVERRIDE_VALUE, 'TTTNewSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_SECRET_OVERRIDE_VALUE incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG CICD_SECRET_OVERRIDE_VALUE value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.CICD_SECRET_OVERRIDE_VALUE, 'TTTNewSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "CICD_SECRET_OVERRIDE_VALUE correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct CICD_SECRET_OVERRIDE_VALUE value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrary1, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary1 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary1 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrary1, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary1 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary1 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrary2, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary2 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary2 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrary2, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary2 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary2 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrary3, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary3 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrary3 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrary3, 'TTTValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrary3 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrary3 value</span>



          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrarySecret1, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret1 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret1 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrarySecret1, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret1 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret1 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrarySecret2, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret2 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret2 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrarySecret2, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret2 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret2 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLibrarySecret3, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret3 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLibrarySecret3 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLibrarySecret3, 'TTTSecretValue')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLibrarySecret3 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLibrarySecret3 value</span>



          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMAssigned1, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned1 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned1 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMAssigned1, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned1 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned1 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMAssigned2, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned2 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned2 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMAssigned2, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned2 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned2 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMAssigned3, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned3 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMAssigned3 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMAssigned3, 'TTTPipelineLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMAssigned3 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMAssigned3 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMMissing1, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing1 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing1 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMMissing1, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing1 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing1 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMMissing2, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing2 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing2 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMMissing2, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing2 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing2 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMMissing3, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing3 incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMMissing3 value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMMissing3, '')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMMissing3 correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMMissing3 value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMLiteral, 'TTTLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLiteral incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMLiteral value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMLiteral, 'TTTLiteral')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMLiteral correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMLiteral value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMEmpty, ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMEmpty incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMEmpty value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMEmpty, ' ')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMEmpty correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMEmpty value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMParam, 'TTTUI')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMParam incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMParam value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMParam, 'TTTUI')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMParam correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMParam value</span>


          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if ne(parameters.PARAMDefaulted, 'TTTDefault')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMDefaulted incorrect value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">WRONG PARAMDefaulted value</span>
          <span class="pi">-</span> <span class="pi">?</span> <span class="s">${{ if eq(parameters.PARAMDefaulted, 'TTTDefault')}}</span>
            <span class="pi">:</span> <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
                  <span class="s">echo "PARAMDefaulted correct value"</span>
                <span class="na">displayName</span><span class="pi">:</span> <span class="s">correct PARAMDefaulted value</span>



<span class="c1">#- ? ${{ if notin(parameters.CICD_GCP_PROJECT, '', ' ')}}</span>
<span class="c1">#            : - bash: echo "not empty"</span>
<span class="c1">#                displayName: correct </span>

</code></pre></div></div>

<h3 id="analysis">Analysis</h3>

<p>Logs from this run show the inconsistency of variable population between
runtime and compiletime, and analysis will reveal the best approach: 
<a href="/data/ado_pipeline_var_logs_90792.zip">click here to download ado_pipeline_var_logs_90792.zip</a></p>

<p>Analysis excel worksheet producted from this: <a href="/data/AzurePipelineVarsAnalysis.xlsx">click here to download AzurePipelineVarsAnalysis.xlsx</a>.</p>

<h3 id="thanks">Thanks</h3>

<p>Some partly-useful docs at:</p>

<ul>
  <li><a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;tabs=yaml%2Cbatch#runtime-expression-syntax">Define variables - Azure Pipelines</a></li>
  <li><a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&amp;tabs=script">Use runtime and type-safe parameters - Azure Pipelines</a></li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="azure" /><category term="devops" /><category term="pipelines" /><category term="variables" /><summary type="html"><![CDATA[How to access Azure devops pipelines variables and parameters in a way that is reliable both in a script and in template conditions]]></summary></entry><entry><title type="html">azure devops pipelines var access</title><link href="https://www.kolossi.co.uk/azure-devops-pipelines-var-access/" rel="alternate" type="text/html" title="azure devops pipelines var access" /><published>2022-10-21T00:00:00+00:00</published><updated>2022-10-21T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/azure-devops-pipelines-var-access</id><content type="html" xml:base="https://www.kolossi.co.uk/azure-devops-pipelines-var-access/"><![CDATA[<p>How to access Azure devops pipelines variables set with a
<code class="language-plaintext highlighter-rouge">##vso[task.setvariable ...</code> output from other tasks, jobs, deployments and
stages…
<!--more--></p>

<h2 id="intro">Intro</h2>

<p>Variables can be set in Azure Devops Pipelines (aka ADP) by outputing lines of the
following form to stdout during a task (here bash but can be powershell,
external program etc):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    <span class="nb">echo</span> <span class="s1">'##vso[task.setvariable variable=MyVar;isOutput=true]'</span>MyValue
    <span class="nb">echo</span> <span class="s1">'##vso[task.setvariable variable=MyVarNotOutput]'</span>MyOtherValue
</code></pre></div></div>

<p>Variables set with <code class="language-plaintext highlighter-rouge">isOutput=true</code> can be used in other jobs, deployments and
stages.  Without it, they can only be used in tasks in the same job/deployment.</p>

<p>The format used to access the variable varies - sometimes completely, sometimes
subtly - depending on whether:</p>
<ul>
  <li>isOutput is used,</li>
  <li>whether the step that <em>defined</em> the variable is in a job or a deployment</li>
  <li>whether the accessing step is in the same job/deployment or further afield.</li>
</ul>

<h2 id="suggested-solutions">Suggested Solutions</h2>

<p>To use an ADP variable in a script, pass it to the script by way of an
environment variable (see <a href="#deep-dive">Deep dive</a>).</p>

<p>If the variable is set in another job, deployment, or stage, then it will first
need to declare this as a dependecy, and then retrieve the value from the
dependency into a variable within the current job or deployment.</p>

<p>With these approaches, it shouldn’t matter whether or not  the variable
definition is performed in a template.</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th>defined <em>without</em> <code class="language-plaintext highlighter-rouge">isoutput=true</code></th>
      <th>defined with <code class="language-plaintext highlighter-rouge">isoutput=true</code> in a job step</th>
      <th>defined with <code class="language-plaintext highlighter-rouge">isoutput=true</code> in a deployment step</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Access in another task in same job or deployment</td>
      <td><code class="language-plaintext highlighter-rouge">$(MyVar)</code></td>
      <td><code class="language-plaintext highlighter-rouge">$(SetValueStepName.MyVar)</code></td>
      <td><code class="language-plaintext highlighter-rouge">$(SetVarStepName.MyVar)</code></td>
    </tr>
    <tr>
      <td>Access in another job/deployment</td>
      <td>:x:</td>
      <td>set job/deployment <code class="language-plaintext highlighter-rouge">dependsOn: SetValueJobName</code><br /><br />create a job/deployment variable with<br /><code class="language-plaintext highlighter-rouge">MyNewVar: $[ dependencies.SetValueJobName</code><br /><code class="language-plaintext highlighter-rouge">.outputs['SetValueStepName.MyVar'] ]</code></td>
      <td>set job/deployment <code class="language-plaintext highlighter-rouge">dependsOn: SetValueDeployName</code><br /><br />create a job/deployment variable with<br /><code class="language-plaintext highlighter-rouge">MyNewVar: $[ dependencies.SetValueDeployName</code><br /><code class="language-plaintext highlighter-rouge">.outputs['SetValueDeployName.SetValueStepName.MyVar'] ]</code></td>
    </tr>
    <tr>
      <td>Access in another stage</td>
      <td>:x:</td>
      <td>set stage <code class="language-plaintext highlighter-rouge">dependsOn: SetValueStageName</code><br /><br />create a stage/job/deployment variable with<br /><code class="language-plaintext highlighter-rouge">MyNewVar: $[ stageDependencies.SetValueStageName.SetValueJobName</code><br /><code class="language-plaintext highlighter-rouge">.outputs['SetValueStepName.MyVar'] ]</code></td>
      <td>set stage <code class="language-plaintext highlighter-rouge">dependsOn: SetValueStageName</code><br /><br />create a stage/job/deployment variable with<br /><code class="language-plaintext highlighter-rouge">MyNewVar: $[ stageDependencies.SetValueStageName.SetValueDeployName</code><br /><code class="language-plaintext highlighter-rouge">.outputs['SetValueDeployName.SetValueStepName.MyVar'] ]</code></td>
    </tr>
  </tbody>
</table>

<p>Notes:</p>
<ol>
  <li>
    <p>when the value is defined in a deployment step, the retrieval from dependency needs the deploy name both before AND within the <code class="language-plaintext highlighter-rouge">.outputs</code> section.</p>
  </li>
  <li>
    <p>the change from <code class="language-plaintext highlighter-rouge">dependencies.</code> to <code class="language-plaintext highlighter-rouge">stageDependencies.</code> when the value is defined in a separate stage</p>
  </li>
</ol>

<p>The (kinda) logic for the change of syntax for deployments is that if a deployment strategy other than “run_once” is used, there might be multiple runs of that deployment, and each might have a different variable value, so they need to be specified.  It is what it is.</p>

<h2 id="deep-dive">Deep dive</h2>

<p>In order to access values in bash scripts, it’s possible to have ADP replace
the values into inline scripts before they are executed, but this can be
problematic and should be avoided, favour passing the values to the
script using environment variables, which are in turn populated from ADP
variables.</p>

<p>One of the problems with the in-script replacement is the way ADP deals with the
replacements if the variable is not found.</p>

<p>One format for declaring a value to be replaced by ADP is <code class="language-plaintext highlighter-rouge">$(variableName)</code>.
However bash uses this same format to mean “execute the command(s) in brackets
and use the output as the result”. e.g.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">filesHere</span><span class="o">=</span><span class="si">$(</span><span class="nb">ls</span> <span class="nt">-1</span><span class="si">)</span>
</code></pre></div></div>

<p>So in order to not break existing scripts, if ADP can’t find a matching
variable, it leaves this expression untouched, otherwise replacing it.
This is fine for</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'Hello $(name)'</span>
</code></pre></div></div>

<p>It will just give an error if <code class="language-plaintext highlighter-rouge">name</code> is underfined.  But what if a script author
decided to initiate a reboot only if varaible <code class="language-plaintext highlighter-rouge">reboot</code> is set to true? :</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[[</span> <span class="si">$(</span>reboot<span class="si">)</span> <span class="o">==</span> <span class="s2">"true"</span> <span class="o">]]</span> <span class="o">&amp;&amp;</span> reboot
</code></pre></div></div>

<p>Unfortunately, if there is no ADP variable <code class="language-plaintext highlighter-rouge">reboot</code> then the script will be
unchanged and in order to evaluate <code class="language-plaintext highlighter-rouge">$(reboot)</code> bash will execute the reboot
command on the agent.  An extreme example and still likely to fail due to
perms, but shows the problems with this approach.  It’s also why if the variable
does not exist, the error from a bash script <code class="language-plaintext highlighter-rouge">echo $(MyVar)</code> can be something
along the lines of <code class="language-plaintext highlighter-rouge">MyVar: Command not found</code>.</p>

<p>Other syntax for variable replacement exist such as <code class="language-plaintext highlighter-rouge">${{ variables.reboot }}</code> or
<code class="language-plaintext highlighter-rouge">$[ variables.reboot ]</code> but these have their own inconsistencies, including
whether they resolve at “compile time” (when a pipeline is being prepared to
run) or “runtime”, and whether they are intended for conditions &amp; expressions
or other uses such as scripts and other variable values. In fact they are
sometimes actually replace with <code class="language-plaintext highlighter-rouge">$(reboot)</code> “under the hood” on a first pass
before acting as above.</p>

<p>See <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;tabs=yaml%2Cbatch">Define variables</a> for more details.</p>

<h2 id="example">Example</h2>

<p>So the proposed way to use a value from say another job in a script is:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">jobs</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">SetValueJob</span>
  <span class="na">tasks</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
      <span class="s">echo '##vso[task.setvariable variable=MyVar;isOutput=true]'MyValue</span>
    <span class="na">name</span><span class="pi">:</span> <span class="s">SetValueTask</span>
<span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">DisplayValueJob</span>
  <span class="na">dependencies</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="s">SetValueJob</span>
  <span class="na">variables</span><span class="pi">:</span>
    <span class="na">MyGotVar</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJob.outputs['SetValueStep.MyVar'] ]</span>
  <span class="na">steps</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
      <span class="s">set -euo pipefail</span>
      <span class="s">echo "I got the value ${Env_MyGotVar}"</span>
    <span class="na">env</span><span class="pi">:</span>
      <span class="na">Env_MyGotVar</span><span class="pi">:</span> <span class="s">$(MyGotVar)</span>
</code></pre></div></div>

<p>This way, the problems with the <code class="language-plaintext highlighter-rouge">$(...)</code> syntax are avoided as they are not
within the script only in the world of ADP. The use of the defensive
<code class="language-plaintext highlighter-rouge">set -euo pipefail</code> at the top of the script will raise an error in a number of
cases, including if the envirnoment var reffered to is not set -
e.g. due to typo.</p>

<p>If the variable is not set in ADP, it won’t perform a replacement, so the value 
will be literal <code class="language-plaintext highlighter-rouge">$(MyGotVar)</code> but importantly, bash will not try to
further evaluate it.</p>

<p>Naming conventions for “got” vars from other stages/jobs/deployments, and the
env version of the var, should probably be formalised, and the choices above 
made just to clarify what is where.</p>

<h2 id="investigation-example">Investigation Example</h2>

<p>Here’s a complete (and slightly mad) pipeline used to find and confirm the
 above answers for all of this:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">#--------------------------------------------</span>
<span class="na">parameters</span><span class="pi">:</span>
<span class="c1">#---------------defaulted--------------------</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">myJobValue</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
  <span class="na">default</span><span class="pi">:</span> <span class="s2">"</span><span class="s">MyJobPropogationValue"</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">myDeployValue</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
  <span class="na">default</span><span class="pi">:</span> <span class="s2">"</span><span class="s">MyDeployPropogationValue"</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">env</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
  <span class="na">default</span><span class="pi">:</span> <span class="s2">"</span><span class="s">dv"</span>
<span class="c1">#--------------------------------------------</span>

<span class="na">trigger</span><span class="pi">:</span> <span class="s">none</span>

<span class="na">name</span><span class="pi">:</span> <span class="s">1.0$(Rev:.r)</span>

<span class="na">pool</span><span class="pi">:</span> <span class="s">vmss-agentpool-linux-v2</span>

<span class="na">stages</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">stage</span><span class="pi">:</span> <span class="s">SetValueStageName</span>
  <span class="na">jobs</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">deployment</span><span class="pi">:</span> <span class="s">SetValueDeployName</span>
    <span class="na">environment</span><span class="pi">:</span> <span class="s">$</span>
    <span class="na">strategy</span><span class="pi">:</span>
      <span class="na">runOnce</span><span class="pi">:</span>
        <span class="na">deploy</span><span class="pi">:</span>
          <span class="na">steps</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">set -euo pipefail</span>
              <span class="s">echo "MyDeployValue=&gt;${MyDeployValue}&lt;"</span>
              <span class="s">echo '##vso[task.setvariable variable=MyDeploySetValue;isOutput=true]'${MyDeployValue}</span>
              <span class="s">echo '##vso[task.setvariable variable=MyDeploySetValueNotOutput]'${MyDeployValue}</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">MyDeployValue</span><span class="pi">:</span> <span class="s">$</span>
            <span class="na">name</span><span class="pi">:</span> <span class="s">setValueDeployStepName</span>
            <span class="na">displayName</span><span class="pi">:</span> <span class="s">Set Deploy Value</span>

          <span class="pi">-</span> <span class="na">template</span><span class="pi">:</span> <span class="s">var_test_steps.yml</span>
            <span class="na">parameters</span><span class="pi">:</span>
               <span class="na">myValue</span><span class="pi">:</span> <span class="s">$Template</span>

          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">echo "MyDeployStepEnvValue=&gt;${MyDeployStepEnvValue}&lt;"</span>
              <span class="s">echo "MyDeployStepEnvValueNotOutput=&gt;${MyDeployStepEnvValueNotOutput}&lt;"</span>
              <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">MyDeployStepEnvValue</span><span class="pi">:</span> <span class="s">$(setValueDeployStepName.MyDeploySetValue)</span>
              <span class="na">MyDeployStepEnvValueNotOutput</span><span class="pi">:</span> <span class="s">$(MyDeploySetValueNotOutput)</span>
              <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(setValueTemplateStepName.MyTemplateSetValue)</span>
            <span class="na">name</span><span class="pi">:</span> <span class="s">getDeployValueStep</span>
            <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Deploy Value in another step</span>

  <span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">SetValueJobName</span>
    <span class="na">steps</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
        <span class="s">set -euo pipefail</span>
        <span class="s">echo "MyJobValue=&gt;${MyJobValue}&lt;"</span>
        <span class="s">echo '##vso[task.setvariable variable=MyJobSetValue;isOutput=true]'${MyJobValue}</span>
        <span class="s">echo '##vso[task.setvariable variable=MyJobSetValueNotOutput]'${MyJobValue}</span>
      <span class="na">env</span><span class="pi">:</span>
        <span class="na">MyJobValue</span><span class="pi">:</span> <span class="s">$</span>
      <span class="na">name</span><span class="pi">:</span> <span class="s">setValueJobStepName</span>
      <span class="na">displayName</span><span class="pi">:</span> <span class="s">Set Job Value</span>

    <span class="pi">-</span> <span class="na">template</span><span class="pi">:</span> <span class="s">var_test_steps.yml</span>
      <span class="na">parameters</span><span class="pi">:</span>
         <span class="na">myValue</span><span class="pi">:</span> <span class="s">$Template</span>

    <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
        <span class="s">echo "MyJobStepEnvValue=&gt;${MyJobStepEnvValue}&lt;"</span>
        <span class="s">echo "MyJobStepEnvValueNotOutput=&gt;${MyJobStepEnvValueNotOutput}&lt;"</span>
        <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
      <span class="na">env</span><span class="pi">:</span>
        <span class="na">MyJobStepEnvValue</span><span class="pi">:</span> <span class="s">$(setValueJobStepName.MyJobSetValue)</span>
        <span class="na">MyJobStepEnvValueNotOutput</span><span class="pi">:</span> <span class="s">$(MyJobSetValueNotOutput)</span>
        <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(setValueTemplateStepName.MyTemplateSetValue)</span>
      <span class="na">name</span><span class="pi">:</span> <span class="s">getJobValueStep</span>
      <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Job Value in another step</span>

  <span class="pi">-</span> <span class="na">deployment</span><span class="pi">:</span> <span class="s">getDeployValueDeploy</span>
    <span class="na">dependsOn</span><span class="pi">:</span> <span class="s">SetValueDeployName</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyDeploySetDeployDepValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValue'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyDeploySetDeployDepNotOutputValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValueNotOutput'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyTemplateSetValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">environment</span><span class="pi">:</span> <span class="s">$</span>
    <span class="na">strategy</span><span class="pi">:</span>
      <span class="na">runOnce</span><span class="pi">:</span>
        <span class="na">deploy</span><span class="pi">:</span>
          <span class="na">steps</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">echo "MyDeploySetDeployDepEnvValue=&gt;${MyDeploySetDeployDepEnvValue}&lt;"</span>
              <span class="s">echo "MyDeploySetDeployDepNotOutputEnvValue=&gt;${CICD_MyDeploySetDeployDepNotOutputEnvValue}&lt;"</span>
              <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">MyDeploySetDeployDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyDeploySetDeployDepValue)</span>
              <span class="na">MyDeploySetDeployDepNotOutputEnvValue</span><span class="pi">:</span> <span class="s">$(MyDeploySetDeployDepNotOutputValue)</span>
              <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(MyTemplateSetValue)</span>
            <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Deploy Value in another deployment</span>

  <span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">getDeployValueJob</span>
    <span class="na">dependsOn</span><span class="pi">:</span> <span class="s">SetValueDeployName</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyDeploySetValueJobDepValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValue'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyDeploySetValueJobDepNotOutputValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValueNotOutput'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyTemplateSetValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueDeployName.outputs['SetValueDeployName.setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">steps</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
        <span class="s">echo "MyDeploySetJobDepEnvValue=&gt;${MyDeploySetJobDepEnvValue}&lt;"</span>
        <span class="s">echo "MyDeploySetJobDepNotOutputEnvValue=&gt;${MyDeploySetJobDepNotOutputEnvValue}&lt;"</span>
        <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
      <span class="na">env</span><span class="pi">:</span>
        <span class="na">MyDeploySetJobDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyDeploySetValueJobDepValue)</span>
        <span class="na">MyDeploySetJobDepNotOutputEnvValue</span><span class="pi">:</span> <span class="s">$(MyDeploySetValueJobDepNotOutputValue)</span>
        <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(MyTemplateSetValue)</span>
      <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Deploy Value in another job</span>

  <span class="pi">-</span> <span class="na">deployment</span><span class="pi">:</span> <span class="s">getJobValueDeploy</span>
    <span class="na">dependsOn</span><span class="pi">:</span> <span class="s">SetValueJobName</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyJobSetValueDeployDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueJobStepName.MyJobSetValue'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyJobSetValueDeployDepNotOutput</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueJobStepName.MyJobSetValueNotOutput'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyTemplateSetValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">environment</span><span class="pi">:</span> <span class="s">$</span>
    <span class="na">strategy</span><span class="pi">:</span>
      <span class="na">runOnce</span><span class="pi">:</span>
        <span class="na">deploy</span><span class="pi">:</span>
          <span class="na">steps</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">echo "MyJobSetDeployDepEnvValue=&gt;${MyJobSetDeployDepEnvValue}&lt;"</span>
              <span class="s">echo "MyJobSetDeployDepNotOutputEnvValue=&gt;${MyJobSetDeployDepNotOutputEnvValue}&lt;"</span>
              <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">MyJobSetDeployDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyJobSetValueDeployDep)</span>
              <span class="na">MyJobSetDeployDepNotOutputEnvValue</span><span class="pi">:</span> <span class="s">$(MyJobSetValueDeployDepNotOutput)</span>
              <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(MyTemplateSetValue)</span>
            <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Job Value in another deployment</span>
            
  <span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">getJobValueJob</span>
    <span class="na">dependsOn</span><span class="pi">:</span> <span class="s">SetValueJobName</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyJobSetValueJobDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueJobStepName.MyJobSetValue'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyJobSetValueJobDepNotOutput</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueJobStepName.MyJobSetValueNotOutput'] ]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyTemplateSetValue</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[ dependencies.SetValueJobName.outputs['setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">steps</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
        <span class="s">echo "MyJobSetJobDepEnvValue=&gt;${MyJobSetJobDepEnvValue}&lt;"</span>
        <span class="s">echo "MyJobSetJobDepNotOutputEnvValue=&gt;${MyJobSetJobDepNotOutputEnvValue}&lt;"</span>
        <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
      <span class="na">env</span><span class="pi">:</span>
        <span class="na">MyJobSetJobDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyJobSetValueJobDep)</span>
        <span class="na">MyJobSetJobDepNotOutputEnvValue</span><span class="pi">:</span> <span class="s">$(MyJobSetValueJobDepNotOutput)</span>
        <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(MyTemplateSetValue)</span>
      <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Job Value in another job</span>

<span class="pi">-</span> <span class="na">stage</span><span class="pi">:</span> <span class="s">GetValueStageName</span>
  <span class="na">dependsOn</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="s">SetValueStageName</span>
  <span class="na">variables</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeploySetValueStageDep</span>
    <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValue']]</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageJobSetValueStageDep</span>
    <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueJobName.outputs['setValueJobStepName.MyJobSetValue']]</span>
  <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeployTemplateSetValueStageDep</span>
    <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueTemplateStepName.MyTemplateSetValue'] ]</span>
  <span class="na">jobs</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">deployment</span><span class="pi">:</span> <span class="s">GetInDeployValueDeploy</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeploySetValueDeployDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValue']]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageJobSetValueDeployDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueJobName.outputs['setValueJobStepName.MyJobSetValue']]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeployTemplateSetValueDeployDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">environment</span><span class="pi">:</span> <span class="s">$</span>
    <span class="na">strategy</span><span class="pi">:</span>
      <span class="na">runOnce</span><span class="pi">:</span>
        <span class="na">deploy</span><span class="pi">:</span>
          <span class="na">steps</span><span class="pi">:</span>
          <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
              <span class="s">echo "MyDeploySetStageDepEnvValue=&gt;${MyDeploySetStageDepEnvValue}&lt;"</span>
              <span class="s">echo "MyJobSetStageDepEnvValue=&gt;${MyJobSetStageDepEnvValue}&lt;"</span>
              <span class="s">echo "MyDeployTemplateSetStageDepEnvValue=&gt;${MyDeployTemplateSetStageDepEnvValue}&lt;"</span>
              <span class="s">echo "MyDeploySetDeployDepEnvValue=&gt;${MyDeploySetDeployDepEnvValue}&lt;"</span>
              <span class="s">echo "MyJobSetDeployDepEnvValue=&gt;${MyJobSetDeployDepEnvValue}&lt;"</span>
              <span class="s">echo "MyDeployTemplateSetDeployDepEnvValue=&gt;${MyDeployTemplateSetDeployDepEnvValue}&lt;"</span>
            <span class="na">env</span><span class="pi">:</span>
              <span class="na">MyDeploySetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeploySetValueStageDep)</span>
              <span class="na">MyJobSetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageJobSetValueStageDep)</span>
              <span class="na">MyDeployTemplateSetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeployTemplateSetValueStageDep)</span>
              <span class="na">MyDeploySetDeployDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeploySetValueDeployDep)</span>
              <span class="na">MyJobSetDeployDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageJobSetValueDeployDep)</span>
              <span class="na">MyDeployTemplateSetDeployDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeployTemplateSetValueDeployDep)</span>

  <span class="pi">-</span> <span class="na">job</span><span class="pi">:</span> <span class="s">GetInJobValueJob</span>
    <span class="na">variables</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeploySetValueJobDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueDeployStepName.MyDeploySetValue']]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageJobSetValueJobDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueJobName.outputs['setValueJobStepName.MyJobSetValue']]</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">MyCrossStageDeployTemplateSetValueJobDep</span>
      <span class="na">value</span><span class="pi">:</span> <span class="s">$[stageDependencies.SetValueStageName.SetValueDeployName.outputs['SetValueDeployName.setValueTemplateStepName.MyTemplateSetValue'] ]</span>
    <span class="na">steps</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
        <span class="s">echo "MyDeploySetStageDepEnvValue=&gt;${MyDeploySetStageDepEnvValue}&lt;"</span>
        <span class="s">echo "MyJobSetStageDepEnvValue=&gt;${MyJobSetStageDepEnvValue}&lt;"</span>
        <span class="s">echo "MyDeployTemplateSetStageDepEnvValue=&gt;${MyDeployTemplateSetStageDepEnvValue}&lt;"</span>
        <span class="s">echo "MyDeploySetJobDepEnvValue=&gt;${MyDeploySetJobDepEnvValue}&lt;"</span>
        <span class="s">echo "MyJobSetJobDepEnvValue=&gt;${MyJobSetJobDepEnvValue}&lt;"</span>
        <span class="s">echo "MyDeployTemplateSetJobDepEnvValue=&gt;${MyDeployTemplateSetJobDepEnvValue}&lt;"</span>
      <span class="na">env</span><span class="pi">:</span>
        <span class="na">MyDeploySetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeploySetValueStageDep)</span>
        <span class="na">MyJobSetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageJobSetValueStageDep)</span>
        <span class="na">MyDeployTemplateSetStageDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeployTemplateSetValueStageDep)</span>
        <span class="na">MyDeploySetJobDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeploySetValueJobDep)</span>
        <span class="na">MyJobSetJobDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageJobSetValueJobDep)</span>
        <span class="na">MyDeployTemplateSetJobDepEnvValue</span><span class="pi">:</span> <span class="s">$(MyCrossStageDeployTemplateSetValueJobDep)</span>
</code></pre></div></div>

<p>The template it calls is:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">#--------------------------------------------</span>
<span class="na">parameters</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">myValue</span>
  <span class="na">type</span><span class="pi">:</span> <span class="s">string</span>
<span class="c1">#--------------------------------------------</span>

<span class="na">steps</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
    <span class="s">set -euo pipefail</span>
    <span class="s">echo "MyEnvValue=&gt;${MyEnvValue}&lt;"</span>
    <span class="s">echo '##vso[task.setvariable variable=MyTemplateSetValue;isOutput=true]'${MyEnvValue}</span>
    <span class="s">echo '##vso[task.setvariable variable=MyTemplateSetValueNotOutput]'${MyEnvValue}</span>
  <span class="na">env</span><span class="pi">:</span>
    <span class="na">MyEnvValue</span><span class="pi">:</span> <span class="s">$</span>
  <span class="na">name</span><span class="pi">:</span> <span class="s">setValueTemplateStepName</span>
  <span class="na">displayName</span><span class="pi">:</span> <span class="s">Set Value in template</span>
<span class="pi">-</span> <span class="na">bash</span><span class="pi">:</span> <span class="pi">|</span>
    <span class="s">set -euo pipefail</span>
    <span class="s">echo "MyTemplateSetEnvValue=&gt;${MyTemplateSetEnvValue}&lt;"</span>
    <span class="s">echo "MyTemplateSetNotOutputEnvValue=&gt;${MyTemplateSetNotOutputEnvValue}&lt;"</span>
  <span class="na">env</span><span class="pi">:</span>
    <span class="na">MyTemplateSetEnvValue</span><span class="pi">:</span> <span class="s">$(setValueTemplateStepName.MyTemplateSetValue)</span>
    <span class="na">MyTemplateSetNotOutputEnvValue</span><span class="pi">:</span> <span class="s">$(MyTemplateSetValueNotOutput)</span>
  <span class="na">name</span><span class="pi">:</span> <span class="s">getValueTemplateStepName</span>
  <span class="na">displayName</span><span class="pi">:</span> <span class="s">Get Value in another template step</span>

</code></pre></div></div>

<h2 id="update-april-2023">Update April 2023</h2>

<p>See also <a href="/azure-devops-pipelines-var-access-part-2/">azure-devops-pipelines-var-access-part-2</a> for how to access
Azure devops pipelines variables and parameters in a way that is reliable
both in a script and in template conditions.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="azure" /><category term="devops" /><category term="pipelines" /><category term="variables" /><summary type="html"><![CDATA[How to access Azure devops pipelines variables set with a ##vso[task.setvariable ... output from other tasks, jobs, deployments and stages…]]></summary></entry><entry><title type="html">Bash parameter expansion</title><link href="https://www.kolossi.co.uk/bash-parameter-expansion/" rel="alternate" type="text/html" title="Bash parameter expansion" /><published>2022-05-17T00:00:00+00:00</published><updated>2022-05-17T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/bash-parameter-expansion</id><content type="html" xml:base="https://www.kolossi.co.uk/bash-parameter-expansion/"><![CDATA[<p>To get details of how to handle parameter/variable expansion in bash,
using hard-to-google code like <code class="language-plaintext highlighter-rouge">${a:-default}</code> and <code class="language-plaintext highlighter-rouge">${a:?"required"}</code>…
<!--more--></p>

<p>See the bash manual about <a href="https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion">Shell Parameter Expansion</a></p>

<h3 id="thanks">Thanks</h3>

<p>I found the docs via <a href="https://stackoverflow.com/a/10520718/2738122">this stackoverflow response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="bash" /><category term="linux" /><category term="parameter" /><category term="variable" /><category term="expansion" /><category term="processing" /><summary type="html"><![CDATA[To get details of how to handle parameter/variable expansion in bash, using hard-to-google code like ${a:-default} and ${a:?"required"}…]]></summary></entry><entry><title type="html">Ansible omit value</title><link href="https://www.kolossi.co.uk/ansible-omit-value/" rel="alternate" type="text/html" title="Ansible omit value" /><published>2021-12-09T00:00:00+00:00</published><updated>2021-12-09T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/ansible-omit-value</id><content type="html" xml:base="https://www.kolossi.co.uk/ansible-omit-value/"><![CDATA[<p>The ansible special variable <code class="language-plaintext highlighter-rouge">omit</code> can be used to skip a task parameter …
<!--more--></p>

<p>It can also be though of as “noop” or “skip” directive.</p>

<p>If it’s ultimately given as the value of a parameter, ansible behaves as if
that parameter was not given.</p>

<p>Often used with <code class="language-plaintext highlighter-rouge">{{ myvar|default() }}</code>.</p>

<p>Example usage from <a href="https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html">ansible docs</a>
(search for “omit”) :</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>- user:
    name: bob
    home: "{{ bobs_home|default(omit) }}"
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="ansible" /><summary type="html"><![CDATA[The ansible special variable omit can be used to skip a task parameter …]]></summary></entry><entry><title type="html">Traefik config beginners guide</title><link href="https://www.kolossi.co.uk/traefik-config-beginners-guide/" rel="alternate" type="text/html" title="Traefik config beginners guide" /><published>2021-12-03T00:00:00+00:00</published><updated>2021-12-03T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/traefik-config-beginners-guide</id><content type="html" xml:base="https://www.kolossi.co.uk/traefik-config-beginners-guide/"><![CDATA[<p>Traefik configuration can be confusing for a newbie, to understand it, read this guide…
<!--more--></p>

<p>I posted the following <a href="https://stackoverflow.com/q/70158137">question on stackoverflow</a> and also on the <a href="https://community.traefik.io/t/please-help-traefik-newby-with-basic-default-config/12554">Traefik community site</a>:</p>

<blockquote>
  <h3 id="traefik-docker-config-path-based-routing-with-rewriting">Traefik docker config path-based routing with rewriting</h3>
  <p>2-day-old newbie to traefik, needing help with what istm is a basic first docker provider config in traefik v2…</p>

  <p>I’ve tried searching through the docs, but just can’t figure out how to do what I’m after.</p>

  <p>I’d like to have docker containers like</p>

  <ul>
    <li>app1</li>
    <li>app2</li>
    <li>app3</li>
  </ul>

  <p>And have these accessed through traefik via the urls</p>

  <ul>
    <li><code class="language-plaintext highlighter-rouge">http://app.mydomain.com/app1</code></li>
    <li><code class="language-plaintext highlighter-rouge">http://app.mydomain.com/app2</code></li>
    <li><code class="language-plaintext highlighter-rouge">http://app.mydomain.com/app3</code></li>
  </ul>

  <p>However the apps themselves don’t like these extra paths, so I’d like strip the prefix from the access paths so the apps don’t see them.</p>

  <p>If I access <code class="language-plaintext highlighter-rouge">http://app.mydomain.com/app2/foo</code> I’d like container <code class="language-plaintext highlighter-rouge">app2</code> to get the request <code class="language-plaintext highlighter-rouge">http://{container.ip.addr}}/foo</code></p>

  <p>As a repro, the config I do know partially works is having the following in my traefik <code class="language-plaintext highlighter-rouge">docker-compose.yml</code>:</p>

  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>version: "3"
services:
  traefik:
    image: "traefik:v2.5.4"
    command:
      - --entrypoints.web.address=:80
      - --providers.docker=true
      - --api
      - --api.insecure=true
      - --api.dashboard=true
      - --providers.file.directory=/etc/traefik/dynamic
      - --providers.docker.defaultRule=Host(`app.mydomain.com`) &amp;&amp; PathPrefix(`/`)
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  app1:
    image: containous/whoami:v1.3.0
  app2:
    image: containous/whoami:v1.3.0
  app3:
    image: containous/whoami:v1.3.0
</code></pre></div>  </div>

  <p>Having added <code class="language-plaintext highlighter-rouge">127.0.0.1 app.mydomain.com</code> to <code class="language-plaintext highlighter-rouge">\etc\hosts</code>, doing a curl to <code class="language-plaintext highlighter-rouge">http://app.mydomain.com/app{1,2,3}/foo</code> this routes to the correct service, but the request path they receive is <code class="language-plaintext highlighter-rouge">/app1/foo</code>, <code class="language-plaintext highlighter-rouge">/app2/foo</code>, <code class="language-plaintext highlighter-rouge">/app3/foo</code> whereas I’d like them all to get <code class="language-plaintext highlighter-rouge">/foo</code>.</p>

  <p>I feel like I’d like to be able to add the following to the command line params in the docker-compose:</p>

  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>--providers.docker.middleware.default-stripprefix.stripprefix.prefixes=`/`
</code></pre></div>  </div>
  <p>but it doesnt work (error: <code class="language-plaintext highlighter-rouge">command traefik error: failed to decode configuration from flags: field not found, node: middleware</code>)</p>

  <p>I can’t find any docs that indicate what the correct commandline param(s) might be.</p>

  <p>I’m thinking it might need to be in a dynamic config file (I’ve seen that too messing with tls config, but want to keep all that out of the repro at this stage!) but again can’t seem to find what the correct config would be for a default middleware.</p>

  <p>I can find lots of refs (and get it working) where I have to specify it in labels on each container, but I’d prefer just to default this out with one-time entries in the traefik config itself.</p>

  <p>I’ve been bashing my head against this for 2 days now. I’ve tried searching the docs site, this community and the googleverse but without luck.  It seems like such a “101” config to me! :-)</p>

  <p>Please would someone help me not only solve my issue but optionally teach me how I could have found the solution myself in the docs site.  I’ve seen plenty of mentions of the doc site being good, but they seem quite sparse to me for v2.</p>
</blockquote>

<p>Sadly I didn’t get any response (at time of writing this).</p>

<p>But I carried on digging and I think I’ve finally figured out what I needed.</p>

<p>The TL;DR to the question I posed was that the “default middleware” can only be defined in a Traefik v2 “dynamic configuration”, which means using a separate config file.</p>

<h3 id="static-vs-dynamic-configuration">Static vs Dynamic Configuration</h3>
<p>Traefik v2* has what it terms “static” configuration and “dynamic” configuration.</p>

<blockquote>
  <p>:information_source: *I’ve joined as a Traefik user only after v2, so the breaking changes between v1 and v2 are out of scope here, and nothing here can be taken as any relevance to v1.  Maybe some of it’s right in v1 too, but I have no idea!</p>
</blockquote>

<p>Dynamic configuration is determined by “providers”. These providers include ones like:</p>

<ul>
  <li>docker</li>
  <li>kubernetes</li>
  <li>file</li>
  <li>etc.</li>
</ul>

<p>Dynamic configuration seems obvious when it comes to things like determining all the available services - e.g.the docker provider inspects the docker environment to determine this, it’s dynamic configuration. Seems to make sense.</p>

<p>The file provider means that config can be set in a config file (or files), but that’s not the same as the static configuration.</p>

<p>This is important - Static vs Dynamic configuration is not an “either/or” approach in Traefik v2.  A given type of config value can be defined in only the correct one of Static or Dynamic configuration.</p>

<p>The Traefik diagram at the top of the <a href="https://doc.traefik.io/traefik/v2.5/getting-started/configuration-overview/">Configuration Introduction page</a> kinda hints at this but for me doesn’t make it clear at all. The diagram filename is even <code class="language-plaintext highlighter-rouge">static-dynamic-configuration.png</code>!</p>

<div class="share-links shadowtb">
  <p><img src="https://doc.traefik.io/traefik/assets/img/static-dynamic-configuration.png" alt="Static Dynamic Configuration" class="img-center" /></p>
</div>

<p>It shows that Static vs Dynamic is about whether it’s “startup time” or “while running”.</p>

<p>But to answer the problem in the question posted, what is needed is to define a “StripPrefix” middleware and then refer to this in the entrypoint configuration.</p>

<p>However as the diagram shows, any middleware definition must be in Dynamic configuration and the endpoint configuration is in the Static configuration.  (Just for added fun, ofc the dynamic config file needs to be referenced by an entry in the static configuration!)</p>

<p>In other words the “startup time” config includes references to things only created in the “while running” config.  Hmm.</p>

<h3 id="secret-sauce">Secret Sauce</h3>

<p>Even when finding a relevant bit of config in the <a href="https://doc.traefik.io/traefik/">Traefik docs</a>, it gives example config which always includes an example in yaml or toml file format, but it wasn’t obvious to me whether this is referring to static or dynamic config file, until I figured this “secret sauce” trick! …</p>

<p>I now realise that if it’s endpoint or “provider connection information” then it will be in static configuration, otherwise it will probably be dynamic configuration, but there is a better way:</p>

<p>Static configuration can be given by one of:</p>

<ul>
  <li><a href="https://doc.traefik.io/traefik/reference/static-configuration/env/">environment variables</a></li>
  <li>a config file</li>
  <li><a href="https://doc.traefik.io/traefik/reference/static-configuration/cli/">command line parameters</a> (aka CLI)</li>
</ul>

<p>This last one is the key - if the example formats to specify the value include “CLI” then it will be Static configuration, if not then it must be in a Dynamic configuration file.</p>

<p>There are quite a lot of places where the example config includes <code class="language-plaintext highlighter-rouge">## Static configuration</code> or <code class="language-plaintext highlighter-rouge">## Dynamic configuration</code> at the top but, certainly at time of writing, it is not consistent.  It’s also easy to miss the significance of this until you understand.</p>

<h2 id="the-answer-to-the-stripprefix-problem">The answer to the StripPrefix problem</h2>

<p>To solve the problem, a dynamic config file is needed.  Personal preference is that since everything can’t be command line args, I’d prefer not to use them for the static config, so I end up with 3 files:</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">docker-compose.yml</code></li>
  <li>Static configuration <code class="language-plaintext highlighter-rouge">traefik.yml</code> this is mounted in the standard Traefik location <code class="language-plaintext highlighter-rouge">/etc/traefik/traefik.yml</code> so is picked up without needing to be specified</li>
  <li>Dynamic configuration <code class="language-plaintext highlighter-rouge">dynamic.yml</code> this is referred to in the static configuration</li>
</ul>

<h3 id="docker-composeyml">docker-compose.yml</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>version: "3"
services:
  traefik:
    image: "traefik:v2.5.4"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "{path}/traefik.yml:/etc/traefik/traefik.yml:ro"
      - "{path}/dynamic.yml:/etc/traefik/dynamic.yml:ro"

  app1:
    image: containous/whoami:v1.3.0
  app2:
    image: containous/whoami:v1.3.0
  app3:
    image: containous/whoami:v1.3.0

</code></pre></div></div>

<h3 id="traefikyml">traefik.yml</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>api:
  insecure: true
  dashboard: true
providers:
  docker:
    defaultRule: "Host(`app.mydomain.com`) &amp;&amp; PathPrefix(`/`)"
  file:
    filename: "/etc/traefik/dynamic.yml"
entrypoints:
  web:
    address: ":80"
    http:
      middlewares:
        - root-stripprefix@file
</code></pre></div></div>

<h3 id="dynamicyml">dynamic.yml</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http:
  middlewares:
    root-stripprefix:
      stripPrefixRegex:
        regex:
          - "/[^/]+"
</code></pre></div></div>

<p>The dynamic configuration specifies a StripPrefix middleware - I’ve actually used StripPrefixRegex to grab whatever is in the first part of the path without having to specify it.</p>

<p>This middleware is then associated with the web endpoint so it applies to everything using it.</p>

<p>This solves the issue fairly simply but it was quite a journey of understanding the Traefik docs and config system before being able to get there.</p>

<h2 id="see-also">See also</h2>
<ul>
  <li><a href="https://www.kolossi.co.uk/traefik-docker-network-setup">Traefik Docker network setup</a>.</li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="traefik" /><category term="docker" /><summary type="html"><![CDATA[Traefik configuration can be confusing for a newbie, to understand it, read this guide…]]></summary></entry><entry><title type="html">Traefik docker network setup</title><link href="https://www.kolossi.co.uk/traefik-docker-network-setup/" rel="alternate" type="text/html" title="Traefik docker network setup" /><published>2021-12-03T00:00:00+00:00</published><updated>2021-12-03T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/traefik-docker-network-setup</id><content type="html" xml:base="https://www.kolossi.co.uk/traefik-docker-network-setup/"><![CDATA[<p>There’s a gotcha when setting up Traefik in docker to proxy for other docker containers …
<!--more--></p>

<p>Setting a test with traefik and a service in the same docker-compose file works fine because they can access each other. e.g.:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> version: "3"
 services:
   traefik:
     image: "traefik:v2.5.4"
     command:
       - --entrypoints.web.address=:80
       - --providers.docker=true
       - --providers.docker.defaultRule=Host(`app.mydomain.com`) &amp;&amp; PathPrefix(`/`)
     ports:
       - "80:80"
     volumes:
       - "/var/run/docker.sock:/var/run/docker.sock:ro"
 
   app1:
     image: containous/whoami:v1.3.0
</code></pre></div></div>

<p>However once in separate files, by default they can’t access each other.  Docker has (some) segregation between different workloads, this is generally a good thing.</p>

<p>To deal with this, a shared docker “network” must be specified in both docker compose files, e.g.:</p>

<h3 id="traefikdocker-composeyml">traefik\docker-compose.yml</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> version: "3"
 services:
   traefik:
     image: "traefik:v2.5.4"
     command:
       - --entrypoints.web.address=:80
       - --providers.docker=true
       - --providers.docker.defaultRule=Host(`app.mydomain.com`) &amp;&amp; PathPrefix(`/`)
     ports:
       - "80:80"
     volumes:
       - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - proxy
networks:
  proxy:
    name: proxy
</code></pre></div></div>

<h3 id="app1docker-composeyml">app1\docker-compose.yml</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> version: "3"
 services:
   app1:
     image: containous/whoami:v1.3.0
    networks:
      - proxy
networks:
  proxy:
    name: proxy
</code></pre></div></div>

<p>This will create a docker network “proxy” when the first container is started with <code class="language-plaintext highlighter-rouge">docker-compose up</code>, and when the second container is started, it will attach to the same network.  Traefik will be able to forward traffic to app1 - all good!:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/traefik# docker-compose up -d
Creating network "proxy" with the default driver
Creating traefik ... done
~/traefik# cd ../app1
~/app1# docker-compose up -d
Creating app1 ... done
</code></pre></div></div>

<p>However when doing a <code class="language-plaintext highlighter-rouge">docker-compose down</code> of a single container, either the network will get deleted, breaking things, for all workloads or more likely the command will raise an error saying that the network is in use:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/app1# docker-compose down
Stopping app1 ... done
Removing app1 ... done
Removing network proxy
ERROR: error while removing network: network proxy id 89fdb7c83df9bfc78461d541c79a937dc302236a6257213621f009ae558c2993 has active endpoints
</code></pre></div></div>

<p>To get around this the network needs to be flagged as “external”.  This does mean that it will not be auto-created and this has to be done as a seperate step.  Thankfully, the error message that results tells exactly what to do:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/traefik# docker-compose up -d
ERROR: Network proxy declared as external, but could not be found. Please create the network manually using `docker network create proxy` and try again.
</code></pre></div></div>

<h2 id="solution">Solution</h2>

<p>So the solution is to issue the following command, just one time ever, on a hosting system:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~\traefik# # docker network create proxy
514fd1c7ef8334fd68afce175656caa05f0785c0dd5141fa806ea2f1aead972a
</code></pre></div></div>
<p>The response is the docker network id, which can be found later if needed (it won’t be!) with <code class="language-plaintext highlighter-rouge">docker network ls --no-trunc</code></p>

<p>The compose files are then:</p>

<h3 id="traefikdocker-composeyml-1">traefik\docker-compose.yml</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> version: "3"
 services:
   traefik:
     image: "traefik:v2.5.4"
     command:
       - --entrypoints.web.address=:80
       - --providers.docker=true
       - --providers.docker.defaultRule=Host(`app.mydomain.com`) &amp;&amp; PathPrefix(`/`)
     ports:
       - "80:80"
     volumes:
       - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - proxy
networks:
  proxy:
    external: true
    name: proxy
</code></pre></div></div>

<h3 id="app1docker-composeyml-1">app1\docker-compose.yml</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> version: "3"
 services:
   app1:
     image: containous/whoami:v1.3.0
    networks:
      - proxy
networks:
  proxy:
    external: true
    name: proxy
</code></pre></div></div>

<p>and the startup goes like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/traefik# docker-compose up -d
Creating traefik ... done
~/traefik# cd ../app1
~/app1# docker-compose up -d
Creating app1 ... done
</code></pre></div></div>

<p>A shutdown can also proceed smoothly:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/app1# docker-compose down
Stopping app1 ... done
Removing app1 ... done
Network proxy is external, skipping
</code></pre></div></div>

<h2 id="thanks">Thanks</h2>

<p>The solution was arrived at based on this <a href="https://stackoverflow.com/q/38088279/2738122">stack overflow question</a>.</p>

<p>But none of the answers were quite right for me.</p>

<p><a href="https://stackoverflow.com/a/48024244/2738122">This answer</a> was probably closest and has the traefik container auto-creating the proxy network (it doesn’t have <code class="language-plaintext highlighter-rouge">external: true</code>) and the other containers just joining it (they do have <code class="language-plaintext highlighter-rouge">external: true</code>).</p>

<p>It makes some sense because without traefik running, external access to any of the services would be broken anyway.  However it wouldn’t be possible to restart traefik (e.g. to upgrade it) as it would try to remove the network which would be “in use”.  It also relies on traefik being the first container up and I’m not convinced that can always be guaranteed, thus the solution given solves these issues, at the “cost” of having to one-time run a simple extra command.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="traefik" /><category term="docker" /><summary type="html"><![CDATA[There’s a gotcha when setting up Traefik in docker to proxy for other docker containers …]]></summary></entry><entry><title type="html">Fix git bad line length character</title><link href="https://www.kolossi.co.uk/git-bad-line-length-char/" rel="alternate" type="text/html" title="Fix git bad line length character" /><published>2021-11-05T00:00:00+00:00</published><updated>2021-11-05T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-bad-line-length-char</id><content type="html" xml:base="https://www.kolossi.co.uk/git-bad-line-length-char/"><![CDATA[<p>The error <code class="language-plaintext highlighter-rouge">Git Remote: Error: fatal: protocol error: bad line length character: {some 4 chars}</code> indicates that the git ssh command has got back an invalid response, namely some characters where it was expecting a 4-byte length value.</p>

<p>This is probably due to an error and the 4 chars in the error message will be the first 4 chars of the error response.</p>

<p>To investigate the error further to find the fix needed …
<!--more--></p>

<ul>
  <li>Find the relevant remote url and repo path with <code class="language-plaintext highlighter-rouge">git remote -v</code>.  The value will likely be something like e.g. <code class="language-plaintext highlighter-rouge">git@ssh.dev.azure.com:v3/YouOrg/YourProject/YourRepo</code>.</li>
  <li>Before the <code class="language-plaintext highlighter-rouge">:</code> is the <code class="language-plaintext highlighter-rouge">host</code>, after it is the <code class="language-plaintext highlighter-rouge">repoPath</code>.</li>
  <li>issue the command <code class="language-plaintext highlighter-rouge">ssh {host} git-receive-pack {repoPath}</code> using the values from above</li>
  <li>this will reveal the true error message - likely something to do with auth or networking failure</li>
</ul>

<h4 id="thanks">Thanks</h4>

<p>Solution found in this <a href="https://stackoverflow.com/a/8175315">StackOverflow response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="git" /><category term="ssh" /><summary type="html"><![CDATA[The error Git Remote: Error: fatal: protocol error: bad line length character: {some 4 chars} indicates that the git ssh command has got back an invalid response, namely some characters where it was expecting a 4-byte length value. This is probably due to an error and the 4 chars in the error message will be the first 4 chars of the error response. To investigate the error further to find the fix needed …]]></summary></entry><entry><title type="html">Tmux connection hang</title><link href="https://www.kolossi.co.uk/tmux-connection-hang/" rel="alternate" type="text/html" title="Tmux connection hang" /><published>2021-07-06T00:00:00+00:00</published><updated>2021-07-06T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/tmux-connection-hang</id><content type="html" xml:base="https://www.kolossi.co.uk/tmux-connection-hang/"><![CDATA[<p>To prevent <a href="https://tmux.github.io/">Tmux</a> windows which spawn ssh 
connections from hanging due to connection drop…
<!--more--></p>

<p>Add the following properties to <code class="language-plaintext highlighter-rouge">~/.ssh/config</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    KeepAlive yes
    ServerAliveInterval 60
</code></pre></div></div>
<p>This will prevent the ssh connection dropping out.</p>

<blockquote>
  <p>:information_source: This probably shouldn’t be used for production hosts, being bad network etiquette.</p>
</blockquote>

<h3 id="thanks">Thanks</h3>

<p>Info from this <a href="https://serverfault.com/a/663626/547541">stackoverflow response</a>.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="wsl" /><category term="tmux" /><category term="ssh" /><category term="linux" /><summary type="html"><![CDATA[To prevent Tmux windows which spawn ssh connections from hanging due to connection drop…]]></summary></entry><entry><title type="html">Microsoft Store for Gaming Services error 0x8007139f</title><link href="https://www.kolossi.co.uk/xbox-store-error/" rel="alternate" type="text/html" title="Microsoft Store for Gaming Services error 0x8007139f" /><published>2021-07-06T00:00:00+00:00</published><updated>2021-07-06T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/xbox-store-error</id><content type="html" xml:base="https://www.kolossi.co.uk/xbox-store-error/"><![CDATA[<p>To reset the Microsoft Store for Gaming Services / Xbox app to get through
error 0x8007139f when trying to start or update a game…
<!--more--></p>

<p>At an <strong>Administator</strong> powershell prompt:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">Get-AppxPackage</span><span class="w"> </span><span class="o">*</span><span class="nx">gamingservices</span><span class="o">*</span><span class="w"> </span><span class="nt">-allusers</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">remove-appxpackage</span><span class="w"> </span><span class="nt">-allusers</span><span class="w">
</span><span class="n">Remove-Item</span><span class="w"> </span><span class="nt">-Path</span><span class="w"> </span><span class="s2">"HKLM:\System\CurrentControlSet\Services\GamingServices"</span><span class="w"> </span><span class="nt">-recurse</span><span class="w">
</span><span class="n">Remove-Item</span><span class="w"> </span><span class="nt">-Path</span><span class="w"> </span><span class="s2">"HKLM:\System\CurrentControlSet\Services\GamingServicesNet"</span><span class="w"> </span><span class="nt">-recurse</span><span class="w">
</span></code></pre></div></div>

<p>Reboot, then to reinstall the store at an <strong>Administator</strong> powershell prompt:</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">start</span><span class="w"> </span><span class="nx">ms-windows-store://pdp/</span><span class="nf">?</span><span class="nx">productid</span><span class="o">=</span><span class="nx">9MWPM2CQNLHN</span><span class="w">
</span></code></pre></div></div>

<h3 id="thanks">Thanks</h3>

<p>Info from this <a href="https://support.xbox.com/en-ZA/help/errors/error-code-0x8007139f">xbox support response</a>.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="windows" /><category term="xbox" /><summary type="html"><![CDATA[To reset the Microsoft Store for Gaming Services / Xbox app to get through error 0x8007139f when trying to start or update a game…]]></summary></entry><entry><title type="html">Wsl2 git slowdown fix</title><link href="https://www.kolossi.co.uk/wsl-git-slowdown-fix/" rel="alternate" type="text/html" title="Wsl2 git slowdown fix" /><published>2021-03-12T00:00:00+00:00</published><updated>2021-03-12T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/wsl-git-slowdown-fix</id><content type="html" xml:base="https://www.kolossi.co.uk/wsl-git-slowdown-fix/"><![CDATA[<p>To workaround the slowdown using git on windows filesystem under wsl …</p>

<!--more-->

<p>Define the following alias, which will choose to use <code class="language-plaintext highlighter-rouge">git.exe</code> when accessing
repos on windows drives (<code class="language-plaintext highlighter-rouge">/mnt/...</code> under wsl):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">alias </span><span class="nv">git</span><span class="o">=</span><span class="s1">'f(){ if [[ $PWD == /mnt/* ]] ;then git.exe "$@" ;else /usr/bin/git "$@" ;fi }; f'</span>
</code></pre></div></div>

<blockquote>
  <p><strong>Update 6-Aug-2021</strong> : 
new version above, previous version performed slow filesystem expansion:</p>

  <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">alias </span><span class="nv">git</span><span class="o">=</span><span class="s1">'f(){ case $PWD/ in  /mnt/*) git.exe "$@";; *) /usr/bin/git "$@";; esac }; f'</span>
</code></pre></div>  </div>
</blockquote>

<h3 id="git-settings">git settings</h3>

<p>If using a repository with a lot of submodules, consider using the following
which will stop it descending into submodule working dirs.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git config <span class="nt">--bool</span> bash.showDirtyState <span class="nb">false</span>
</code></pre></div></div>

<p>If using <a href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh">git-prompt.sh</a>
 aka <a href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh">__git_ps1</a>
consider turning off some of the setttings using environment variables such as:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">GIT_PS1_SHOWDIRTYSTATE</span><span class="o">=</span>1      <span class="c"># &lt;--- my pref to leave this on</span>
<span class="nb">export </span><span class="nv">GIT_PS1_SHOWUNTRACKEDFILES</span><span class="o">=</span>
</code></pre></div></div>

<p>Note that each option turned off reduces the usefulness of the prompt.</p>

<p>Some of the options are described in <a href="https://mjswensen.com/blog/git-status-prompt-options/">this post</a>.</p>

<h4 id="thanks">Thanks</h4>

<p>Given a steer by <a href="https://github.com/microsoft/WSL/issues/4401#issuecomment-670080585">this response</a>
on the related WSL github issue.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="wsl" /><category term="git" /><summary type="html"><![CDATA[To workaround the slowdown using git on windows filesystem under wsl …]]></summary></entry><entry><title type="html">Hosts file edit shortcut with gvim</title><link href="https://www.kolossi.co.uk/hosts-file-edit-gvim/" rel="alternate" type="text/html" title="Hosts file edit shortcut with gvim" /><published>2021-03-10T00:00:00+00:00</published><updated>2021-03-10T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/hosts-file-edit-gvim</id><content type="html" xml:base="https://www.kolossi.co.uk/hosts-file-edit-gvim/"><![CDATA[<p>To enable <code class="language-plaintext highlighter-rouge">hosts</code> file edit using a gvim shortcut, without breaking explorer
<code class="language-plaintext highlighter-rouge">Edit with vim</code> right-click action …</p>

<!--more-->

<ul>
  <li>create a shortcut with command:
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>"C:\Program Files (x86)\Vim\vim82\gvim.exe" "C:\windows\system32\drivers\etc\hosts"
</code></pre></div>    </div>
  </li>
  <li>on the shortcut property page, under the <code class="language-plaintext highlighter-rouge">Shortcut</code> tab, choose “Advanced” and check “Run as administrator”</li>
</ul>

<blockquote>
  <p>:warning: DO NOT go to shortcut <code class="language-plaintext highlighter-rouge">Compatability</code> tab and select “Run this program as an administrator” - this will make gvim ALWAYS run as admin and right-click “Edit with Vim…” option will be broken, reporting <code class="language-plaintext highlighter-rouge">gvimext.dll error creating process: check if gvim is in your path!</code></p>
</blockquote>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="windows" /><category term="vim" /><category term="gvim" /><summary type="html"><![CDATA[To enable hosts file edit using a gvim shortcut, without breaking explorer Edit with vim right-click action …]]></summary></entry><entry><title type="html">Cisco AnyConnect config storage location</title><link href="https://www.kolossi.co.uk/cisco-anyconnect-config-storage-location/" rel="alternate" type="text/html" title="Cisco AnyConnect config storage location" /><published>2021-02-25T00:00:00+00:00</published><updated>2021-02-25T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/cisco-anyconnect-config-storage-location</id><content type="html" xml:base="https://www.kolossi.co.uk/cisco-anyconnect-config-storage-location/"><![CDATA[<p>The Cisco AnyConnect VPN client stores its config info in …
<!--more--></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>%ProgramData%\Cisco\Cisco AnyConnect Secure Mobility Client\Profile
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="windows" /><summary type="html"><![CDATA[The Cisco AnyConnect VPN client stores its config info in …]]></summary></entry><entry><title type="html">Installing kubectl</title><link href="https://www.kolossi.co.uk/install-kubectl/" rel="alternate" type="text/html" title="Installing kubectl" /><published>2021-02-25T00:00:00+00:00</published><updated>2021-02-25T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/install-kubectl</id><content type="html" xml:base="https://www.kolossi.co.uk/install-kubectl/"><![CDATA[<p>To install the kubectl command in linux including WSL …
<!--more--></p>

<p>First choose the correct version number with reference to the target
cluster(s).</p>

<p>In the examples below, “v1.20.0” is used - change as necessary.</p>

<p>To download the binary, do</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># change "amd64" to "arm64" if required</span>
<span class="c"># change version number if required</span>
curl <span class="nt">-LO</span> https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl
</code></pre></div></div>

<h2 id="verify-sha">Verify sha</h2>

<p>To download the SHA to confirm valid download, issue the following to download
the checksum:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># change "amd64" to "arm64" if required</span>
<span class="c"># change version number if required</span>
curl <span class="nt">-LO</span> https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl
</code></pre></div></div>

<blockquote>
  <p>:information_source: This is not ideal sha comparison as any redirect of the download using dns spoofing can also supply a fake sha</p>
</blockquote>

<p>To do the compare:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"</span><span class="si">$(</span>&lt;kubectl.sha256<span class="si">)</span><span class="s2"> kubectl"</span> | <span class="nb">sha256sum</span> <span class="nt">--check</span>
</code></pre></div></div>

<h2 id="install">Install</h2>

<p>To install kubectl, do</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo install</span> <span class="nt">-o</span> root <span class="nt">-g</span> root <span class="nt">-m</span> 0755 kubectl /usr/local/bin/kubectl
</code></pre></div></div>

<h2 id="test">Test</h2>

<p>Confirm install with <code class="language-plaintext highlighter-rouge">kubectl version --client</code></p>

<h4 id="thanks">Thanks</h4>

<p>Info from the <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">kubernetes docs</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="kubernetes" /><category term="wsl" /><category term="linux" /><summary type="html"><![CDATA[To install the kubectl command in linux including WSL …]]></summary></entry><entry><title type="html">Storing dotfiles</title><link href="https://www.kolossi.co.uk/storing-dotfiles/" rel="alternate" type="text/html" title="Storing dotfiles" /><published>2021-02-24T00:00:00+00:00</published><updated>2021-02-24T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/storing-dotfiles</id><content type="html" xml:base="https://www.kolossi.co.uk/storing-dotfiles/"><![CDATA[<p>Here’s my take on how to store “dotfiles” in git with least pain…
<!--more--></p>

<h2 id="dotfiles">Dotfiles</h2>

<p>“dotfiles” are those files in a linux home dir that store setup, files like
<code class="language-plaintext highlighter-rouge">.bashrc</code>, <code class="language-plaintext highlighter-rouge">.gitconfig</code>, <code class="language-plaintext highlighter-rouge">.vimrc</code>.</p>

<p>This post is based largely on an <a href="https://www.atlassian.com/git/tutorials/dotfiles">Atlassian post</a>,
though cut down to the absolute basics.</p>

<h2 id="create-local-repo">Create local repo</h2>

<p>First setup an empty repo, and a <code class="language-plaintext highlighter-rouge">config</code> alias for git, just for this repo
(all existing git aliases will still work with <code class="language-plaintext highlighter-rouge">config</code>).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git init <span class="nt">--bare</span> <span class="nv">$HOME</span>/.cfg
<span class="nb">alias </span><span class="nv">config</span><span class="o">=</span><span class="s1">'/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'</span>
config config <span class="nt">--local</span> status.showUntrackedFiles no
<span class="nb">echo</span> <span class="s2">"alias config='/usr/bin/git --git-dir=</span><span class="nv">$HOME</span><span class="s2">/.cfg/ --work-tree=</span><span class="nv">$HOME</span><span class="s2">'"</span> <span class="o">&gt;&gt;</span> <span class="nv">$HOME</span>/.bash_aliases
</code></pre></div></div>

<p>Add all the files to be version controlled:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> <span class="nv">$HOME</span>
config add .profile
config add .bashrc
config add .bash_aliases
config add .vimrc
</code></pre></div></div>

<p>Some like <code class="language-plaintext highlighter-rouge">.ssh</code> and <code class="language-plaintext highlighter-rouge">.kube</code> dirs might need a little more work (and ONLY
do these if the remote repo will not be publically accessible):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="nt">-e</span> <span class="s1">'agents/\nagent.env'</span> <span class="o">&gt;</span> .ssh/.gitignore
config add .ssh
<span class="nb">echo</span> <span class="nt">-e</span> <span class="s1">'cache/\nhttp-cache/'</span> <span class="o">&gt;</span> .kube/.gitignore
config add .kube
</code></pre></div></div>

<p>This is just so doing e.g. <code class="language-plaintext highlighter-rouge">config add .ssh</code> won’t add the unwanted files.
Any untracked files are ignored due to the config that was set on the repo.</p>

<p>To prevent it being possible to recursively add the local repo:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'.cfg/'</span> <span class="o">&gt;&gt;</span> .gitignore
config add .gitignore
</code></pre></div></div>

<p>Any command or alias that can be issue with <code class="language-plaintext highlighter-rouge">git</code> can now be issued with
<code class="language-plaintext highlighter-rouge">config</code>, and can be issued from anywhere in the directory tree, but will always 
refer to the home dir e.g.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/home/me/myrepos/mywork<span class="nv">$ </span>config status
On branch master

No commits yet

Changes to be committed:
  <span class="o">(</span>use <span class="s2">"git rm --cached &lt;file&gt;..."</span> to unstage<span class="o">)</span>

        new file:   .ansible.cfg
        new file:   .bash_aliases
        new file:   .bash_logout
...
</code></pre></div></div>

<h2 id="create-remote-repo">Create remote repo</h2>

<p>Commit any pending changes with e.g.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>config commit <span class="nt">-m</span> <span class="s1">'first commit'</span>
</code></pre></div></div>

<p>Create a completely empty repo on a remote repository - suggested repo
naming <code class="language-plaintext highlighter-rouge">cfg_{machine-name}</code> or just <code class="language-plaintext highlighter-rouge">cfg</code>.</p>

<p>Add this as a remote to the config repo and push changes:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>config remote add origin ssh://git@bitbucket.myhost.com/~me/cfg_my-machine.git
config push <span class="nt">--set-upstream</span> origin master
</code></pre></div></div>

<p>If the repo is accessed via ssh, be sure to store the key file elsewhere so that
the data can be cloned from the repo on any new install.</p>

<h2 id="using-on-a-new-install">Using on a new install</h2>

<h3 id="alias">alias</h3>

<p>First setup a temporary version of the config alias</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">alias </span><span class="nv">config</span><span class="o">=</span><span class="s1">'/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'</span>
</code></pre></div></div>

<h3 id="ssh-creds">ssh creds</h3>

<p>If the repo requires ssh authentication, retrieve the key file onto the new
system, and make sure permissions are locked down.  Then start the ssh agent
and add the key:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cp</span> <span class="o">{</span>somewhere<span class="o">}</span>/my-key ~/.ssh
<span class="nb">chmod </span>600 ~/.ssh/my-key
<span class="nb">eval</span> <span class="si">$(</span>ssh-agent <span class="nt">-s</span><span class="si">)</span>
ssh-add ~/.ssh/my-key
</code></pre></div></div>

<h3 id="get-files">get files</h3>

<p>Clone the repo and checkout</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone <span class="nt">--bare</span> &lt;git-repo-url&gt; <span class="nv">$HOME</span>/.cfg
config checkout
</code></pre></div></div>

<p>Any existing files of the same name will cause errors so backup or remove
and repeat the checkout command.</p>

<p>Set the clone to ignore untracked files:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>config config <span class="nt">--local</span> status.showUntrackedFiles no
</code></pre></div></div>

<p>Logout and back in to pickup new <code class="language-plaintext highlighter-rouge">.bashrc</code>, <code class="language-plaintext highlighter-rouge">.profile</code>, aliases etc.</p>

<p>That should be it!</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="wsl" /><category term="bash" /><category term="linux" /><summary type="html"><![CDATA[Here’s my take on how to store “dotfiles” in git with least pain…]]></summary></entry><entry><title type="html">Git and ssh known_hosts population</title><link href="https://www.kolossi.co.uk/git-ssh-known-hosts/" rel="alternate" type="text/html" title="Git and ssh known_hosts population" /><published>2021-02-16T00:00:00+00:00</published><updated>2021-02-16T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-ssh-known-hosts</id><content type="html" xml:base="https://www.kolossi.co.uk/git-ssh-known-hosts/"><![CDATA[<p>Here’s a trick to get a host key automatically registered by ssh, particularly
when used by git as part of a build pipeline…
<!--more--></p>

<p>The main trick is to use the ssh <code class="language-plaintext highlighter-rouge">-o StrictHostKeyChecking=no</code> option:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-o</span> <span class="nv">StrictHostKeyChecking</span><span class="o">=</span>no user@server
</code></pre></div></div>

<p>If the relevant <code class="language-plaintext highlighter-rouge">known_hosts</code> file does not contain the server or even does not
exist, it will create the file and add the server key.</p>

<p>This is particularly useful when using ssh as part of git command via the 
<code class="language-plaintext highlighter-rouge">GIT_SSH_COMMAND</code> env var:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">GIT_SSH_COMMAND</span><span class="o">=</span>ssh <span class="nt">-o</span> <span class="nv">StrictHostKeyChecking</span><span class="o">=</span>no <span class="nt">-i</span> keyfile user@server
</code></pre></div></div>

<p>When this is run as part of a pipeline on a build server, and therefore is
running under a service user, it can be particularly difficult to locate the
<code class="language-plaintext highlighter-rouge">known_hosts</code> file.</p>

<p>For instance if running under LocalSystem, the file could be something like 
<code class="language-plaintext highlighter-rouge">C:\Windows\SysWOW64\config\systemprofile\.ssh\known_hosts</code>.</p>

<p>Errors relating to this may show something like <code class="language-plaintext highlighter-rouge">Host key verification failed</code>
but also maybe something as obscure as <code class="language-plaintext highlighter-rouge">read_passphrase: can't open /dev/tty: No such device or address</code>
(even though the key file has no passphrase!).</p>

<p>Once the <code class="language-plaintext highlighter-rouge">known_hosts</code> file has been update, the <code class="language-plaintext highlighter-rouge">-o StrictHostKeyChecking=no</code>
will no longer be needed and can be removed again.</p>

<h4 id="thanks">Thanks</h4>

<p>Info found on this <a href="https://unix.stackexchange.com/a/416186">StackExchange response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="git" /><category term="ssh" /><summary type="html"><![CDATA[Here’s a trick to get a host key automatically registered by ssh, particularly when used by git as part of a build pipeline…]]></summary></entry><entry><title type="html">LENS config storage location</title><link href="https://www.kolossi.co.uk/lens-config-storage-location/" rel="alternate" type="text/html" title="LENS config storage location" /><published>2021-02-05T00:00:00+00:00</published><updated>2021-02-05T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/lens-config-storage-location</id><content type="html" xml:base="https://www.kolossi.co.uk/lens-config-storage-location/"><![CDATA[<p>The <a href="https://k8slens.dev/">LENS // The Kuberenetes IDE</a> stores its config info in …
<!--more--></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>C:\Users\{username}\AppData\Roaming\Lens\lens-cluster-store.json
</code></pre></div></div>

<p>which can be shortened to</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>%AppData%\Lens\lens-cluster-store.json
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="kubernetes" /><category term="lens" /><summary type="html"><![CDATA[The LENS // The Kuberenetes IDE stores its config info in …]]></summary></entry><entry><title type="html">Escape backtick in markdown code block</title><link href="https://www.kolossi.co.uk/markdown-escape-backtick/" rel="alternate" type="text/html" title="Escape backtick in markdown code block" /><published>2021-01-25T00:00:00+00:00</published><updated>2021-01-25T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/markdown-escape-backtick</id><content type="html" xml:base="https://www.kolossi.co.uk/markdown-escape-backtick/"><![CDATA[<p>To use a backtick (<code class="language-plaintext highlighter-rouge">`</code>) within a markdown inline code block…</p>

<!--more-->
<p>Use double-backticks as code block delimitter rather than single to wrap the code, e.g.</p>

<p><code class="language-plaintext highlighter-rouge">``List`1``</code> in markdown will render as <code class="language-plaintext highlighter-rouge">List`1</code></p>

<p>The number of backticks can be increased as required, e.g. the markdown for the example above is actually</p>

<p><code class="language-plaintext highlighter-rouge">``` ``List`1`` ```</code></p>

<p>Which needed to be shown by wrapping the whole lot in 4-backticks etc… :slightly_smiling_face:</p>

<p>If there is a leading or trailing backtick, the code will need to be separated from the delimiters by a space, e.g. for <code class="language-plaintext highlighter-rouge">ctrl-`</code> use <code class="language-plaintext highlighter-rouge">`` ctrl-` ``</code>.</p>

<p>As long and both entering and trailing spaces are used to the delimeter, they will not be rendered.</p>

<h4 id="thanks">Thanks</h4>

<p>Info from this <a href="https://meta.stackexchange.com/a/82722/374981">stackoverflow response</a>.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="markdown" /><summary type="html"><![CDATA[To use a backtick (`) within a markdown inline code block…]]></summary></entry><entry><title type="html">VSCode preserve installed extensions</title><link href="https://www.kolossi.co.uk/vscode-preserve-extensions/" rel="alternate" type="text/html" title="VSCode preserve installed extensions" /><published>2021-01-25T00:00:00+00:00</published><updated>2021-01-25T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/vscode-preserve-extensions</id><content type="html" xml:base="https://www.kolossi.co.uk/vscode-preserve-extensions/"><![CDATA[<p>To export and recreate installed VSCode extentions…
<!--more--></p>

<p>Export the list of installed extensions from an existing VSCode with:</p>
<ul>
  <li>Open terminal, usually with <code class="language-plaintext highlighter-rouge">ctrl-`</code> or <code class="language-plaintext highlighter-rouge">ctrl-' </code></li>
  <li>then one of:
    <ul>
      <li>Powershell: <code class="language-plaintext highlighter-rouge">code --list-extensions | % { "code --install-extension $_" } &gt; vscode_extensions.ps1</code></li>
      <li>Bash: <code class="language-plaintext highlighter-rouge">code --list-extensions | xargs -L 1 echo code --install-extension &gt; vscode_extensions.sh</code></li>
    </ul>
  </li>
</ul>

<p>To recreate, run the script.</p>

<h4 id="thanks">Thanks</h4>

<p>Info from this <a href="https://stackoverflow.com/a/49398449/2738122">stackoverflow response</a>.</p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="vscode" /><summary type="html"><![CDATA[To export and recreate installed VSCode extentions…]]></summary></entry><entry><title type="html">Fix git plink unknown option error</title><link href="https://www.kolossi.co.uk/git-plink-unknown-option-o/" rel="alternate" type="text/html" title="Fix git plink unknown option error" /><published>2021-01-20T00:00:00+00:00</published><updated>2021-01-20T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-plink-unknown-option-o</id><content type="html" xml:base="https://www.kolossi.co.uk/git-plink-unknown-option-o/"><![CDATA[<p>The error <code class="language-plaintext highlighter-rouge">plink: unknown option "-o"</code> indicates that the git ssh command has been set to <code class="language-plaintext highlighter-rouge">plink.exe</code>, but git believes it is interacting with an OpenSSH command.</p>

<p>To fix the error, choose one of the following to set the ssh variant …
<!--more--></p>

<ul>
  <li>Set the following config in the appropriate (<code class="language-plaintext highlighter-rouge">--global</code>, <code class="language-plaintext highlighter-rouge">--system</code> or <code class="language-plaintext highlighter-rouge">--local</code>) git config e.g. by issuing <code class="language-plaintext highlighter-rouge">git config --global --edit</code> :
    <div class="language-config highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[<span class="n">ssh</span>]
  <span class="n">variant</span> = <span class="n">plink</span>
</code></pre></div>    </div>
  </li>
  <li>Do it all in one with:
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git config <span class="nt">--global</span> ssh.variant plink
</code></pre></div>    </div>
  </li>
  <li>If the <code class="language-plaintext highlighter-rouge">ssh.variant</code> is already explicitly set to <code class="language-plaintext highlighter-rouge">ssh</code>, then just removing this hard setting and allowing git to auto-detect may well be enough - e.g. <code class="language-plaintext highlighter-rouge">git config --global --unset ssh.variant</code></li>
  <li>Environment variables override git config, so if the ssh command has been set to plink via environment variable, set the following environment variable (use the same user/system scope as current <code class="language-plaintext highlighter-rouge">GIT_SSH</code> and <code class="language-plaintext highlighter-rouge">GIT_SSH_COMMAND</code> setting)
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">GIT_SSH_VARIANT</span><span class="o">=</span>plink
</code></pre></div>    </div>
  </li>
</ul>

<h4 id="thanks">Thanks</h4>

<p>Solution found due this <a href="https://stackoverflow.com/a/45576707">StackOverflow response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="git" /><category term="ssh" /><category term="plink" /><summary type="html"><![CDATA[The error plink: unknown option "-o" indicates that the git ssh command has been set to plink.exe, but git believes it is interacting with an OpenSSH command. To fix the error, choose one of the following to set the ssh variant …]]></summary></entry><entry><title type="html">Creating snippets and assigning to shortcut in VSCode</title><link href="https://www.kolossi.co.uk/vscode-create-assign-snippet/" rel="alternate" type="text/html" title="Creating snippets and assigning to shortcut in VSCode" /><published>2021-01-20T00:00:00+00:00</published><updated>2021-01-20T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/vscode-create-assign-snippet</id><content type="html" xml:base="https://www.kolossi.co.uk/vscode-create-assign-snippet/"><![CDATA[<p>To create code snippets in VSCode, and assign them to a key binding…
<!--more--></p>

<p>See this <a href="https://stackoverflow.com/a/56148339">Stackoverflow response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="vscode" /><summary type="html"><![CDATA[To create code snippets in VSCode, and assign them to a key binding…]]></summary></entry><entry><title type="html">Disconnecting an iscsi device in windows</title><link href="https://www.kolossi.co.uk/iscsi-windows-disconnect/" rel="alternate" type="text/html" title="Disconnecting an iscsi device in windows" /><published>2021-01-17T00:00:00+00:00</published><updated>2021-01-17T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/iscsi-windows-disconnect</id><content type="html" xml:base="https://www.kolossi.co.uk/iscsi-windows-disconnect/"><![CDATA[<p>To successfully disconnect an iscsi-mounted device in windows…
<!--more--></p>
<ul>
  <li>In disk manager, in lower portion of screen, right-click on the disk itself (on the left hand side, not the partitions on the right), and select <code class="language-plaintext highlighter-rouge">Offline</code></li>
  <li>in the iSCSI Initiator app:
    <ul>
      <li>in the <code class="language-plaintext highlighter-rouge">Favourite Targets</code> tab, select the item and choose <code class="language-plaintext highlighter-rouge">Remove</code></li>
      <li>in the <code class="language-plaintext highlighter-rouge">Targets</code> tab select the item and click <code class="language-plaintext highlighter-rouge">Disconnect</code></li>
    </ul>
  </li>
  <li>This may fail e.g. with the message:</li>
</ul>

<blockquote>
  <p>The session cannot be logged out since a device on that session is currently being used.</p>
</blockquote>

<ul>
  <li>if so, this may be due to windows Task Manager running which, if disk performance counters are enabled, holds the device open.
    <ul>
      <li>Close all open task manager instances</li>
      <li>If disk performance counters are not required, to prevent this happening again, at an <em>administrator</em> powershell/command prompt, issue <code class="language-plaintext highlighter-rouge">diskperf -N</code></li>
    </ul>
  </li>
</ul>

<h4 id="thanks">Thanks</h4>

<p>Useful info about task manager/performance counters was found <a href="https://linustechtips.com/topic/1008639-force-iscsi-disconnect/?do=findComment&amp;comment=12962632">here</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="iscsi" /><category term="windows" /><summary type="html"><![CDATA[To successfully disconnect an iscsi-mounted device in windows…]]></summary></entry><entry><title type="html">Using Jekyll markdown in divs</title><link href="https://www.kolossi.co.uk/jekyll-use-markdown-in-divs/" rel="alternate" type="text/html" title="Using Jekyll markdown in divs" /><published>2021-01-17T00:00:00+00:00</published><updated>2021-01-17T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/jekyll-use-markdown-in-divs</id><content type="html" xml:base="https://www.kolossi.co.uk/jekyll-use-markdown-in-divs/"><![CDATA[<p>To allow Jekyll (Liquid) to parse markup in page blocks like divs, add the folowing at the top of the page…
<!--more--></p>
<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{::options parse_block_html="true" /}
</code></pre></div></div>

<h4 id="thanks">Thanks</h4>

<p>Info found on <a href="https://www.reddit.com/r/Jekyll/comments/31rg4g/using_markdown_in_divs/cq4asit">this r/Jekyll response</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="jekyll" /><summary type="html"><![CDATA[To allow Jekyll (Liquid) to parse markup in page blocks like divs, add the folowing at the top of the page…]]></summary></entry><entry><title type="html">Using Paint.Net Alpha Paste plugin to create a shadow</title><link href="https://www.kolossi.co.uk/paint-net-use-alpha-copy/" rel="alternate" type="text/html" title="Using Paint.Net Alpha Paste plugin to create a shadow" /><published>2021-01-17T00:00:00+00:00</published><updated>2021-01-17T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/paint-net-use-alpha-copy</id><content type="html" xml:base="https://www.kolossi.co.uk/paint-net-use-alpha-copy/"><![CDATA[<p>An short walkthrough of creating a shadow using the BoltBain alpha paste plugin for Paint.Net…
<!--more--></p>

<h2 id="alpha-paste-plugin-install">Alpha Paste plugin install</h2>

<p>To add the Alpha Paste plugin to the free windows image manipulation program <a href="https://www.getpaint.net/">Paint.Net</a>:</p>

<ul>
  <li>download <a href="https://forums.getpaint.net/topic/113220-boltbaits-plugin-pack-for-pdn-v4212-and-beyond-updated-july-16-2020/">BoltBait’s plugin pack</a>.</li>
  <li>unzip the file and run the <code class="language-plaintext highlighter-rouge">.exe</code> inside</li>
  <li>exit any running Paint.Net</li>
  <li>agree to the T’s &amp; C’s then click <code class="language-plaintext highlighter-rouge">Install everything!</code> (or choose less if desried)</li>
</ul>

<h2 id="using-the-alpha-paste-plugin">Using the Alpha Paste plugin</h2>

<p>I want to change the following <a href="https://i.emlfiles4.com/cmpimg/0/0/1/1/8/files/10615314_shadows2.png">shadow image</a> I saw in an email …</p>

<hr />

<p><img src="/assets/img/grey-shadow-down.png" alt="Grey shadow" /></p>

<hr />

<p>… into a blue-ish version for use in my website.</p>

<p>I’ve got this in just a few simple steps:</p>
<ul>
  <li>load the shadow up in Paint.Net</li>
  <li>add a new layer</li>
  <li>fill the new layer with the solid blue colour (use rectangle tool)</li>
  <li>select the existing shadow layer image, and copy the whole image (<code class="language-plaintext highlighter-rouge">ctrl-a</code> <code class="language-plaintext highlighter-rouge">ctrl-c</code>).</li>
  <li>select the blue layer and choose <code class="language-plaintext highlighter-rouge">Effects</code> -&gt; <code class="language-plaintext highlighter-rouge">Object</code> -&gt; <code class="language-plaintext highlighter-rouge">Paste Alpha...</code></li>
  <li>make sure <code class="language-plaintext highlighter-rouge">Replace current alpha with...</code> and <code class="language-plaintext highlighter-rouge">Shades of grey on clipboard...</code> are selected and <code class="language-plaintext highlighter-rouge">Invert calculation</code> is checked</li>
  <li>click <code class="language-plaintext highlighter-rouge">OK</code></li>
  <li>select the orginal shadow layer, and fill it with white</li>
  <li>save the image as a png (accept the warning that the layers will be “flattened”).</li>
  <li>flip vertically and save again.</li>
</ul>

<p>The up and down image versions can now be used :</p>

<p><img src="/assets/img/blue-shadow-up.png" alt="up shadow" /></p>

<p>This is the message which I want to draw attention to, but not too much!</p>

<p><img src="/assets/img/blue-shadow-down.png" alt="down shadow" /></p>

<p>That was easy, and looks pretty sweet I think.</p>]]></content><author><name>Paul Sweeney</name></author><category term="paint.net" /><summary type="html"><![CDATA[An short walkthrough of creating a shadow using the BoltBain alpha paste plugin for Paint.Net…]]></summary></entry><entry><title type="html">VSCode settings file location</title><link href="https://www.kolossi.co.uk/vscode-settings/" rel="alternate" type="text/html" title="VSCode settings file location" /><published>2021-01-15T00:00:00+00:00</published><updated>2021-01-15T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/vscode-settings</id><content type="html" xml:base="https://www.kolossi.co.uk/vscode-settings/"><![CDATA[<p>The global VSCode settings file (where things like msssql extension connection profiles are stored) is at…
<!--more--></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>C:\Users\{username}\AppData\Roaming\Code\User\settings.json
</code></pre></div></div>

<p>which can be shortened to</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>%AppData%\Code\User\settings.json
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="vscode" /><summary type="html"><![CDATA[The global VSCode settings file (where things like msssql extension connection profiles are stored) is at…]]></summary></entry><entry><title type="html">Clearing chrome site data</title><link href="https://www.kolossi.co.uk/chrome-clear-site-data/" rel="alternate" type="text/html" title="Clearing chrome site data" /><published>2021-01-13T00:00:00+00:00</published><updated>2021-01-13T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/chrome-clear-site-data</id><content type="html" xml:base="https://www.kolossi.co.uk/chrome-clear-site-data/"><![CDATA[<p>To clear all the data chrome has for a site:</p>

<ul>
  <li>open dev tools (<code class="language-plaintext highlighter-rouge">F12</code>)</li>
  <li>go to <code class="language-plaintext highlighter-rouge">Application</code> tab</li>
  <li>choose <code class="language-plaintext highlighter-rouge">Clear storage</code> in the left menu bar</li>
  <li>click <code class="language-plaintext highlighter-rouge">Clear site data</code>
<!--more--></li>
</ul>

<p>This can help when chrome has cached a redirect, cert details or other details not solved by doing a simple cookie clear with <a href="https://www.editthiscookie.com/">EditThisCookie</a> plugin.</p>

<h4 id="thanks">Thanks</h4>

<p>Info found on <a href="https://www.addictivetips.com/windows-tips/clear-site-data-chrome/">https://www.addictivetips.com/windows-tips/clear-site-data-chrome/</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="chrome" /><summary type="html"><![CDATA[To clear all the data chrome has for a site: open dev tools (F12) go to Application tab choose Clear storage in the left menu bar click Clear site data]]></summary></entry><entry><title type="html">A Git auto push for Windows or Linux</title><link href="https://www.kolossi.co.uk/git-auto-push-win-nix/" rel="alternate" type="text/html" title="A Git auto push for Windows or Linux" /><published>2021-01-12T00:00:00+00:00</published><updated>2021-01-12T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-auto-push-win-nix</id><content type="html" xml:base="https://www.kolossi.co.uk/git-auto-push-win-nix/"><![CDATA[<p>To add a <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks">post commit git webhook</a> that can work on windows or *nix, create a file in the local repo clone directory <code class="language-plaintext highlighter-rouge">./.git/hooks/post-commit</code> with the content…
<!--more--></p>

<ul>
  <li>On <a href="https://www.tygertec.com/git-hooks-practical-uses-windows/">windows</a> (search for the correct <code class="language-plaintext highlighter-rouge">#!</code> path on the local system if this doesnt work):</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!C:/Program\ Files/Git/bin/sh.exe</span>
git push origin main
</code></pre></div></div>

<ul>
  <li>On *nix:</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
git push origin main
</code></pre></div></div>

<p>:information_source: The <code class="language-plaintext highlighter-rouge">./.git/hooks/post-commit</code> file is just on the local environment, so:</p>
<ul>
  <li>it won’t get pushed to upstream repo</li>
  <li>this will need to be redone for each environment/repo clone</li>
</ul>

<h2 id="automate-commit-message">Automate commit message</h2>

<p>To ease things further, <a href="https://www.kolossi.co.uk/quicktips/git-pre-fill-commit-message.html">pre-fill the commit message</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="git" /><category term="windows" /><category term="linux" /><summary type="html"><![CDATA[To add a post commit git webhook that can work on windows or *nix, create a file in the local repo clone directory ./.git/hooks/post-commit with the content…]]></summary></entry><entry><title type="html">Setting up a fully featured Github Pages site</title><link href="https://www.kolossi.co.uk/github-pages-site-setup/" rel="alternate" type="text/html" title="Setting up a fully featured Github Pages site" /><published>2021-01-12T00:00:00+00:00</published><updated>2021-01-12T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/github-pages-site-setup</id><content type="html" xml:base="https://www.kolossi.co.uk/github-pages-site-setup/"><![CDATA[<p>This post will explain how to use <a href="https://pages.github.com/">Github pages</a> to create a powerful but easy to use content site, and to add Google Analytics, Ads and a Paypal donate button to that site to monetise and monitor it.
<!--more--></p>

<h2 id="setup-a-github-pages-site">Setup a Github pages site</h2>

<p><a href="https://pages.github.com/">Github pages</a> are websites created from Github repositories (aka “repos”) using markdown files committed to the site.</p>

<p>There are 2 key types of <a href="https://pages.github.com/">Github pages</a> site:</p>
<ul>
  <li>what we’ll refer to here as a “root” site
    <ul>
      <li>this will have a url like <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io</code></li>
      <li>it is created from a repo also named <code class="language-plaintext highlighter-rouge">{username}.github.io</code></li>
    </ul>
  </li>
  <li>per-repository sites
    <ul>
      <li>these will have a url like <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io\{repo-name}</code></li>
      <li>these can be created from any repo</li>
    </ul>
  </li>
</ul>

<p>If needed, <a href="https://github.com/join">create a (free) Github user</a>.</p>

<p>Create a repository for the site - make one for the root site called <code class="language-plaintext highlighter-rouge">{username}.github.io</code> if not already done.</p>

<p>To enable the Github pages site to be created from the repository,</p>
<ul>
  <li>go to the repository in github, the url will be like <code class="language-plaintext highlighter-rouge">https://github.com/{username}/{repo-name}</code>
→ Settings (<code class="language-plaintext highlighter-rouge">https://github.com/{username}/{repo-name}/settings</code>)
→ scroll right down to the “Github pages” section
→ under “Source”, where it shows <code class="language-plaintext highlighter-rouge">None v</code> select the branch to use for the site and click “save”
→ Click <code class="language-plaintext highlighter-rouge">Choose a theme</code> and pick one</li>
</ul>

<p>Now any files named <code class="language-plaintext highlighter-rouge">*.md</code> committed and pushed to the repo will be (after a delay of up to a couple of minutes) rendered and available on the web.</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">index.md</code> will be available as <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io\{repo-name}</code> or just <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io</code> for the root site</li>
  <li>any other <code class="language-plaintext highlighter-rouge">{filename}.md</code> will be available as <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io\{repo-name}\{filename}.html</code> or <code class="language-plaintext highlighter-rouge">https:\\{username}.github.io\{filename}.html</code>.  Notice that the <code class="language-plaintext highlighter-rouge">*.md</code> filename turned into <code class="language-plaintext highlighter-rouge">*.html</code> for browsing.</li>
</ul>

<p>The <code class="language-plaintext highlighter-rouge">*.md</code> <a href="https://github.github.com/gfm/">Markdown</a> files are rendered into html automatically by Github each time changes are pushed, using the <a href="https://jekyllrb.com/">Jekyll</a> engine.</p>

<p>These <a href="https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md">github emojis</a> are supported, provided <a href="https://docs.github.com/en/enterprise/2.13/user/articles/emoji-on-github-pages#setting-up">the following is added</a> to the site <code class="language-plaintext highlighter-rouge">_config.yml</code>:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">plugins</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="s">jemoji</span>
</code></pre></div></div>

<p>Read <a href="https://docs.github.com/en/github-ae@latest/github/working-with-github-pages/about-github-pages-and-jekyll">About GitHub Pages and Jekyll</a> and <a href="https://pages.github.com/versions/">the list of available plugins</a>. for more details.</p>

<p>This is a useful <a href="https://learn.cloudcannon.com/jekyll-cheat-sheet/">Jekyll cheatsheet</a></p>

<p>Once any kind of test content is being published to the Github pages url, move on.</p>

<h2 id="collections">Collections</h2>

<p>Jekyll <a href="https://jekyllrb.com/docs/collections/">Collections</a> are ways to group together similar types of content and/or sharing the same layout. This saves piling all the content pages into the repo root.  There’s <a href="https://jekyllrb.com/docs/step-by-step/09-collections/">quick guide</a> on the Jekyll site.</p>

<p>There are two special types of collections - “Posts” and “Pages”.  <a href="https://ben.balter.com/2015/02/20/jekyll-collections/">This</a> page and <a href="https://stackoverflow.com/questions/15095625/what-are-the-differences-between-a-post-and-a-page-in-jekyll">this</a> one explain the differences quite well.  We will stick with general “collections” for now.</p>

<p>To support content being in e.g. an “articles” collection:</p>

<ul>
  <li>Add a directory <code class="language-plaintext highlighter-rouge">_articles</code> to the root of the repo</li>
  <li>create a file <code class="language-plaintext highlighter-rouge">_articles\index.md</code></li>
  <li><a href="https://jekyllrb.com/docs/liquid/">Jekyll/Liquid templating</a> can be used to give a table of contents of all articles in the index page by giving it in the content:</li>
</ul>

<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh"># My Articles</span>

{% for article in site.articles %}
<span class="p">*</span> <span class="p">[</span><span class="nv">{{article.title}}</span><span class="p">](</span><span class="sx">{{article.url}}</span><span class="p">)</span>
{% endfor %}
</code></pre></div></div>

<ul>
  <li>(such code can also be included in the main site <code class="language-plaintext highlighter-rouge">index.md</code> to add “articles” content there)</li>
  <li>create <code class="language-plaintext highlighter-rouge">*.md</code> content files in this directory. The <code class="language-plaintext highlighter-rouge">{{article.url}}</code> item is one supported automatically, but the “title” is not.  To add this data to a content page, we add it in a yaml “front matter” block in the page, e.g. <code class="language-plaintext highlighter-rouge">_articles\front-matter.md</code>:</li>
</ul>

<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
<span class="na">title</span><span class="pi">:</span> <span class="s">A page about front matter</span>
<span class="na">modified</span><span class="pi">:</span> <span class="s">2021-01-12T18:17:00+00.00</span>
<span class="nn">---</span>

<span class="gh"># A page about front matter</span>

These are some details about yaml front matter.
</code></pre></div></div>

<ul>
  <li>The lookup code can be used within the page itself, for instance to reuse the front matter title as the initial heading:</li>
</ul>

<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
<span class="na">title</span><span class="pi">:</span> <span class="s">A page about front matter</span>
<span class="na">modified</span><span class="pi">:</span> <span class="s">2021-01-12T18:17:00+00.00</span>
<span class="nn">---</span>

<span class="gh"># {{ page.title }}</span>

These are some details about yaml front matter.
</code></pre></div></div>

<ul>
  <li>The <code class="language-plaintext highlighter-rouge">*.md</code> files will be processed and available to the loop codes, but the pages themselves won’t be added as content.  To arrange this, add the following to the root file <code class="language-plaintext highlighter-rouge">_config.yml</code>:</li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">collections</span><span class="pi">:</span>
  <span class="na">articles</span><span class="pi">:</span>
    <span class="na">output</span><span class="pi">:</span> <span class="no">true</span>
</code></pre></div></div>

<ul>
  <li>The files will now be created, but will be without layout (and theme/style).
    <ul>
      <li>To use the default layout for this collection, add the following to <code class="language-plaintext highlighter-rouge">_config.yml</code></li>
    </ul>
  </li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">defaults</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">scope</span><span class="pi">:</span>
      <span class="na">path</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
      <span class="na">type</span><span class="pi">:</span> <span class="s2">"</span><span class="s">articles"</span>
    <span class="na">values</span><span class="pi">:</span>
      <span class="na">layout</span><span class="pi">:</span> <span class="s2">"</span><span class="s">default"</span>
  <span class="pi">-</span> <span class="na">scope</span><span class="pi">:</span>
      <span class="na">path</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
    <span class="na">values</span><span class="pi">:</span>
      <span class="na">layout</span><span class="pi">:</span> <span class="s2">"</span><span class="s">default"</span>
</code></pre></div></div>

<ul>
  <li>To use a different layout, add a relevant file to the <code class="language-plaintext highlighter-rouge">_layouts</code> directory and refer to it in the <code class="language-plaintext highlighter-rouge">_config.yml</code> layout item, e.g. add <code class="language-plaintext highlighter-rouge">_layouts\my-article-layout.html</code> then use the following in <code class="language-plaintext highlighter-rouge">_config.yml</code>:</li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">defaults</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">scope</span><span class="pi">:</span>
      <span class="na">path</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
      <span class="na">type</span><span class="pi">:</span> <span class="s2">"</span><span class="s">articles"</span>
    <span class="na">values</span><span class="pi">:</span>
      <span class="na">layout</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my-article-layout"</span>
<span class="nn">...</span>
</code></pre></div></div>

<h2 id="add-google-advertising-to-the-site">Add Google Advertising to the site</h2>

<h3 id="first-will-google-adsense-or-google-ads-be-used">First will Google AdSense or Google Ads be used?</h3>

<p>It took me a while to clarify this in my mind, but <a href="https://www.urbandictionary.com/define.php?term=tl%3Bdr" title="Too Long; Didn't Read (so here's a brief summary):">TL;DR</a> :</p>
<ul>
  <li>Google Ads is where manufacturers/vendors pay google to display their site in search result when their chosen keywords are used in a search</li>
  <li>Google AdSense is where content creators put adverts on their site to get revenue from clicks</li>
</ul>

<p>So Google AdSense is what will be used.</p>

<h3 id="add-google-adsense-to-the-site">Add Google AdSense to the site</h3>

<p><a href="https://www.google.com/adsense/signup">Sign up for Google AdSense</a> using a new or existing google account.</p>

<p>If there are multiple github pages sites under the github account, it’s the root one <code class="language-plaintext highlighter-rouge">https://{username}.github.io</code> that must be specified during signup.  The Google Ads signup says subdomains aren’t allowed as the url to be signed up for, but it seems fine with an account github.io subdomain.  It does reject individual repo github pages sites like <code class="language-plaintext highlighter-rouge">https://{username}.github.io/MyRepo</code> though.</p>

<p>Once signed up though, individual repo sites can have ads added, it’s just that the signup/verification has to be the root site.</p>

<p>Once this is given, there will be a request at some point to add some html to the <code class="language-plaintext highlighter-rouge">HEAD</code> section of each page of the (Github pages user) root site html.</p>

<h3 id="adding-head-code-to-the-site">Adding HEAD code to the site</h3>

<p>When simply using the default themes for Github pages, this isn’t editable, but a very small change allows it (and the analytics changes required shortly).</p>

<p>First, find the layout page of the site’s chosen theme. If using a custom theme this will just need a bit of googling.</p>

<p>For default themes, it will likely just be of the form <code class="language-plaintext highlighter-rouge">https://github.com/pages-themes/{theme name}/blob/master/_layouts/default.html</code></p>

<p>e.g. for the slate theme : <code class="language-plaintext highlighter-rouge">https://github.com/pages-themes/slate/blob/master/_layouts/default.html</code></p>

<p>Download the source of this file (click the <code class="language-plaintext highlighter-rouge">Raw</code> button top-right above the content), and save in the site repo as <code class="language-plaintext highlighter-rouge">./_layouts/default.html</code>.</p>

<p>In the head section of this file (my suggestion, immediately before the closing <code class="language-plaintext highlighter-rouge">&lt;\head&gt;</code>), add the code requested by Google AdSense signup, it should look like this (but with a unique client id):</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    <span class="nt">&lt;script </span><span class="na">data-ad-client=</span><span class="s">"ca-pub-1234567890123456"</span> <span class="na">async</span> 
        <span class="na">src=</span><span class="s">"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"</span><span class="nt">&gt;&lt;/script&gt;</span>
</code></pre></div></div>

<p>Save the file, add and commit to git and push to the github repo.</p>

<p>Once the site has been republished, take a look at the page source to check that the code is there in the <code class="language-plaintext highlighter-rouge">&lt;HEAD&gt;</code> code.</p>

<h3 id="complete-google-adsense-signup">Complete Google AdSense signup</h3>

<p>Once the site has been republished with the necessary <code class="language-plaintext highlighter-rouge">&lt;HEAD&gt;</code> code in place, confirm to Google AdSense signon thatit’s there.</p>

<p>The Google AdSense page should confirm that the content was found and say Google will go off and have a good think about the application for a few <strong>days or even weeks</strong>…</p>

<p>In the meantime, move on to setting up Google Analytics</p>

<h2 id="add-google-analytics-to-the-site">Add Google Analytics to the site</h2>

<p><a href="https://analytics.google.com/">Sign up with Google Analytics</a> using a new or existing google account - there’s some logic in using the same account for AdSense and Analytics.</p>

<p>Google Analytics has changed recently from using “Universal Analytics” (aka UA) to Google Analytics 4 (aka GA4).</p>

<p>We’ll use GA4 here, but need to be aware of old UA references and code which may appear in the existing themes.</p>

<p>Unless default options are changed, only <abbr title="Google Analytics 4">GA4</abbr> will be set up and not <abbr title="Universal Analytics">UA</abbr>.  For new sites this is probably the best option.</p>

<h3 id="create-an-analytics-account-and-property">Create an Analytics account and Property</h3>

<p>Analytics accounts can have many properties under them.</p>

<ul>
  <li>Go to the <a href="https://analytics.google.com/">Google Analytics homepage</a></li>
  <li>click <code class="language-plaintext highlighter-rouge">Admin</code> (with the cog icon) at the bottom of the left toolbar.</li>
  <li>If no account has yet been created:
→ click <code class="language-plaintext highlighter-rouge">+ Create Account</code>
→ Give the account a name (perhaps include the Github username)
→ choose data sharing options (I only selected “Technical Support”)
→ click <code class="language-plaintext highlighter-rouge">Next</code></li>
  <li>If an account does already exists:
→  select it in the dropdown at the top of the left hand column
→ click <code class="language-plaintext highlighter-rouge">+ Create Property</code></li>
  <li>Give the new property a name (the website name seems a good approach)</li>
  <li>Set the regional attributes</li>
  <li>click <code class="language-plaintext highlighter-rouge">Next</code></li>
  <li>Set the industry category, size and usage types</li>
  <li>click <code class="language-plaintext highlighter-rouge">Create</code></li>
</ul>

<h3 id="find-setup-info">Find setup info</h3>

<p>The</p>
<ul>
  <li>Go to the <a href="https://analytics.google.com/">Google Analytics homepage</a></li>
  <li>click <code class="language-plaintext highlighter-rouge">Admin</code> (with the cog icon) at the bottom of the left toolbar.</li>
  <li>select the correct account in the dropdown at the top of the left column</li>
  <li>select the correct property in the dropdown at the top of the next (middle) column</li>
  <li>click <code class="language-plaintext highlighter-rouge">Setup Assistant</code> at the top of the property column</li>
  <li>under the “Collection” section, click the <code class="language-plaintext highlighter-rouge">&gt;</code> at the right of the “Tag installation” line</li>
  <li>click the <code class="language-plaintext highlighter-rouge">&gt;</code> at the right of the “data stream” line</li>
</ul>

<p>The Measurment ID is shown top-right with a copy-to-clipboard icon to the right of it.  It will be of the form “G-xxxxxxxxxx”.</p>

<p>Make a note of this, but to get the full code we need:</p>

<ul>
  <li>in the second section “Tagging instructions”
→ make sure the “Add new on-page tag” tab is selected
→ click the <code class="language-plaintext highlighter-rouge">v</code> downarrow on the left of the “Global Site Tag (gtag.js)” line</li>
</ul>

<h3 id="copy-analytics-setup-info">Copy Analytics setup info</h3>

<p>Copy the <code class="language-plaintext highlighter-rouge">&lt;head&gt;</code> tag code shown, it should be very simlar to this (unless the code has been updated since this was written):</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Global site tag (gtag.js) - Google Analytics --&gt;</span>
<span class="nt">&lt;script </span><span class="na">async</span> <span class="na">src=</span><span class="s">"https://www.googletagmanager.com/gtag/js?id=G-xxxxxxxxxx"</span><span class="nt">&gt;&lt;/script&gt;</span>
<span class="nt">&lt;script&gt;</span>
  <span class="nb">window</span><span class="p">.</span><span class="nx">dataLayer</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">dataLayer</span> <span class="o">||</span> <span class="p">[];</span>
  <span class="kd">function</span> <span class="nx">gtag</span><span class="p">(){</span><span class="nx">dataLayer</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">arguments</span><span class="p">);}</span>
  <span class="nx">gtag</span><span class="p">(</span><span class="dl">'</span><span class="s1">js</span><span class="dl">'</span><span class="p">,</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">());</span>

  <span class="nx">gtag</span><span class="p">(</span><span class="dl">'</span><span class="s1">config</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">G-xxxxxxxxxx</span><span class="dl">'</span><span class="p">);</span>
<span class="nt">&lt;/script&gt;</span>
</code></pre></div></div>

<h3 id="adding-analytics-head-code-to-the-site">Adding Analytics HEAD code to the site</h3>

<p>See the <a href="#adding-head-code-to-the-site">AdSense section</a> about how to add the <code class="language-plaintext highlighter-rouge">&lt;HEAD&gt;</code> code to the site, but using the <a href="#copy-adsense-setup-info">AdSense code</a> found above.</p>

<h3 id="test-analytics">Test Analytics</h3>

<p>The site should now be doing analytics tracking.  Visit the site - but make sure to use an incognito browser tab if ad/tracking block plugins are installed !!!!</p>

<p>Click some links and scroll the page around too.</p>

<p>To see that data:</p>

<ul>
  <li>visit the <a href="https://analytics.google.com/">Google Analytics homepage</a></li>
  <li>click <code class="language-plaintext highlighter-rouge">Realtime</code> in the left hand sidebar</li>
  <li>make sure the correct account and property are selected at the very top of the page, to the right of the “Analytics” logo and text.</li>
  <li>your recent visit should be showing up in the stats and and map!</li>
</ul>

<h2 id="add-a-cookie-privacy-managment-page">Add a cookie privacy managment page</h2>

<p>This is crucial for GDRP / DPA but I’ll come back to this another day!</p>

<h2 id="add-a-paypal-donate-button">Add a paypal donate button</h2>

<p>This was way easier than I though it would be!</p>

<p>Follow this link to <a href="https://www.paypal.com/donate/buttons">Create a paypal donate button</a>.</p>

<p>Once created, if the html to include wasn’t shown, go to</p>
<ul>
  <li><a href="https://www.paypal.com/myaccount/settings">Settings</a>
→ <a href="https://www.paypal.com/myaccount/profile/seller-tools">Seller tools</a>
→ <a href="https://www.paypal.com/buttons/">Paypal buttons / Manage</a>
→ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_button-management">View your saved buttons</a> (top right)
→ On the line for the correct button: Action → View code</li>
</ul>

<p>The code will look something like this but with a unique <code class="language-plaintext highlighter-rouge">hosted_button_id</code>:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;form</span> <span class="na">action=</span><span class="s">"https://www.paypal.com/donate"</span> <span class="na">method=</span><span class="s">"post"</span> <span class="na">target=</span><span class="s">"_top"</span><span class="nt">&gt;</span>
<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"hidden"</span> <span class="na">name=</span><span class="s">"hosted_button_id"</span> <span class="na">value=</span><span class="s">"ABCDE12345XYZ"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"image"</span> <span class="na">src=</span><span class="s">"https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif"</span>
    <span class="na">border=</span><span class="s">"0"</span> <span class="na">name=</span><span class="s">"submit"</span> <span class="na">title=</span><span class="s">"PayPal - The safer, easier way to pay online!"</span>
    <span class="na">alt=</span><span class="s">"Donate with PayPal button"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;img</span> <span class="na">alt=</span><span class="s">""</span> <span class="na">border=</span><span class="s">"0"</span> <span class="na">src=</span><span class="s">"https://www.paypal.com/en_GB/i/scr/pixel.gif"</span> <span class="na">width=</span><span class="s">"1"</span> <span class="na">height=</span><span class="s">"1"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/form&gt;</span>
</code></pre></div></div>

<p>Just add this html straight in the page markdown, but on its own set of lines (not inline with text).</p>

<h1 id="site-authoring-workflow">Site authoring workflow</h1>

<h2 id="git-auto-push">Git auto push</h2>

<p>To make things easier, add a <a href="https://www.kolossi.co.uk\quicktips\git-auto-push-win-nix.html">git auto push webhook</a>.</p>

<h2 id="test-site-locally-from-vscode">Test site locally from VSCode</h2>

<p>To run the site from within VSCode:</p>
<ul>
  <li>Installing Jekyll following <a href="https://jekyllrb.com/docs/installation/windows/">Jekyll windows install docs</a>:
    <ul>
      <li>Download and run recommended installer (including devkit) from <a href="https://rubyinstaller.org/downloads/">rubyinstall.org</a></li>
      <li>make sure to leave checked the <code class="language-plaintext highlighter-rouge">ridk install</code> step on the last page of the install and choose <code class="language-plaintext highlighter-rouge">1</code> (base install of msys2) when prompted in the console window</li>
      <li>if vscode was already open before install, restart it</li>
      <li>in the VSCode terminal window, issue <code class="language-plaintext highlighter-rouge">gem install jekyll bundler</code></li>
      <li>confirm install by issuing <code class="language-plaintext highlighter-rouge">bundle exec jekyll -v</code>.  If this fails, <a href="https://jekyllrb.com/docs/installation/windows/">Jekyll windows install docs</a> suggests rebooting.</li>
    </ul>
  </li>
  <li>In the root of the site, add a file named <code class="language-plaintext highlighter-rouge">Gemfile</code> with the following content:
    <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">source</span> <span class="s2">"https://rubygems.org"</span>
<span class="n">gem</span> <span class="s2">"github-pages"</span><span class="p">,</span> <span class="ss">group: :jekyll_plugins</span>
</code></pre></div>    </div>
  </li>
  <li>in the VSCode terminal window, issue:</li>
</ul>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">bundle</span><span class="w"> </span><span class="nx">install</span><span class="w">              </span><span class="c"># &lt;- will take several minutes first time on PC</span><span class="w">
</span><span class="n">bundle</span><span class="w"> </span><span class="nx">update</span><span class="w"> </span><span class="nx">github-pages</span><span class="w">
</span></code></pre></div></div>

<ul>
  <li>Following <a href="https://jekyllrb.com/tutorials/using-jekyll-with-bundler/">Jekyll bundler docs</a>, to prevent the generated site being added to source control, add the following to the <code class="language-plaintext highlighter-rouge">.gitignore</code> file in the root of the site (create if necessary):</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Ignore metadata generated by Jekyll
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Ignore folders generated by Bundler
.bundle/
vendor/
</code></pre></div></div>

<ul>
  <li>Following <a href="https://devhints.io/jekyll#configuration">this Jekyll cheatsheet</a>, add the following to <code class="language-plaintext highlighter-rouge">_config.yml</code>:</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>exclude:
- Gemfile
- Gemfile.lock
- .gitignore
- .vscode
</code></pre></div></div>

<ul>
  <li>add to source control:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">Gemfile</code></li>
      <li><code class="language-plaintext highlighter-rouge">Gemfile.lock</code></li>
      <li><code class="language-plaintext highlighter-rouge">.gitignore</code></li>
    </ul>
  </li>
  <li>Now install the <a href="https://marketplace.visualstudio.com/items?itemName=Dedsec727.jekyll-run">VSCode Jekyll Run extension</a></li>
  <li>in the Jekyll run extension settings for the workspace, add <code class="language-plaintext highlighter-rouge">--watch</code> to the command-line arguments so that a running server will update if any of the files are edited (live rebuild)</li>
  <li>to match the build used by github pages, also add <code class="language-plaintext highlighter-rouge">--safe</code> in the extension workspace settings command-line arguments</li>
  <li>once the settings have been added with the VSCode ui, they can then be found (and editted) in <code class="language-plaintext highlighter-rouge">./.vscode/settings.json</code> in the site repo</li>
  <li>the site can now be run with <code class="language-plaintext highlighter-rouge">CTRL-F5</code> or clicking “Jekyll Run” in the left section of the VSCode status bar</li>
  <li>to allow a preview of the Markdown content (buit without Jekyll/Liquid expansion), install the <a href="https://marketplace.visualstudio.com/items?itemName=bierner.markdown-preview-github-styles">Markdown Preview Github Styling extension</a> and to support emojis, checklist etc, also install the extension pack in the <a href="https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview">Github Markdown Preview extension</a></li>
</ul>

<h3 id="usage-tip">Usage tip</h3>

<p>Sometimes the server gets stuck and even if stopped, attempting to run again reports port 4000 already being used. Exiting and restarting VSCode should solve this.  For easier reload, install the <a href="https://marketplace.visualstudio.com/items?itemName=natqe.reload">reload extension</a> which adds a “reload” item to the right of the VSCode status bar.</p>

<h2 id="editing-on-a-mobile">Editing on a mobile</h2>

<p>Highly recommended apps on an android phone to interact with the site repo are:</p>

<ul>
  <li><a href="https://play.google.com/store/apps/details?id=com.foxdebug.acodefree">Acode</a></li>
  <li><a href="https://play.google.com/store/apps/details?id=io.gitjournal.gitjournal">GitJournal</a></li>
</ul>

<p>Both offer markdown (though not Jekyll/Liquid) preview, and easily commit and push, which will trigger a GitHub pages rebuild.</p>

<h1 id="content-coding">Content coding</h1>

<h2 id="add-a-random-item">Add a random item</h2>

<p>To add a random item from a collection to a page (e.g. a random quicktip), include something like this in the layout page source:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
<span class="c">&lt;!-- ... other page content as required ... --&gt;</span>

<span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">"random-quicktip"</span><span class="nt">&gt;&lt;/div&gt;</span>

<span class="c">&lt;!-- ... other page content as required ... --&gt;</span>

<span class="nt">&lt;script&gt;</span>
    <span class="kd">var</span> <span class="nx">targetSelector</span><span class="o">=</span><span class="dl">"</span><span class="s2">#random-quicktip</span><span class="dl">"</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">items</span><span class="o">=</span><span class="p">[</span> 
        <span class="p">{</span><span class="o">%</span> <span class="k">for</span> <span class="nx">item</span> <span class="k">in</span> <span class="nx">site</span><span class="p">.</span><span class="nx">quicktips</span> <span class="o">%</span><span class="p">}</span> 
            <span class="p">{</span>
                <span class="dl">"</span><span class="s2">content</span><span class="dl">"</span><span class="p">:</span> <span class="p">{{</span> <span class="nx">item</span><span class="p">.</span><span class="nx">content</span> <span class="o">|</span> <span class="nx">markdownify</span> <span class="o">|</span> <span class="nx">jsonify</span> <span class="p">}},</span>
                <span class="dl">"</span><span class="s2">url</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">{{ site.url }}{{ item.url }}</span><span class="dl">"</span>
            <span class="p">},</span>
        <span class="p">{</span><span class="o">%</span> <span class="nx">endfor</span> <span class="o">%</span><span class="p">}</span>
    <span class="p">]</span>
    <span class="kd">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">querySelector</span><span class="p">(</span><span class="nx">targetSelector</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">target</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">chosenItem</span> <span class="o">=</span> <span class="nx">items</span><span class="p">[</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">()</span><span class="o">*</span><span class="nx">items</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">];</span>
        <span class="nx">target</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">chosenItem</span><span class="p">.</span><span class="nx">content</span><span class="p">;</span>
        <span class="nx">target</span><span class="p">.</span><span class="nx">onclick</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="nb">document</span><span class="p">.</span><span class="nx">local</span><span class="p">.</span><span class="nx">href</span><span class="o">=</span> <span class="nx">chosenItem</span><span class="p">.</span><span class="nx">url</span> <span class="p">}</span>
    <span class="p">}</span>
<span class="nt">&lt;/script&gt;</span>
</code></pre></div></div>

<p>Something to note - the random choice must be done client-side from all the content sent down to the browser.  Even if Jekyll/Liquid supported random item choosing in its markup, this would only change things once on each page build and not on each page view.</p>

<h3 id="add-just-teaser-content">Add just teaser content</h3>

<p>If the whole content of the item is too much, change the “content” line of the javascript to use Jekyll/Lyquid’s <code class="language-plaintext highlighter-rouge">item.excerpt</code> instead:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code>...
<span class="nt">&lt;script&gt;</span>
<span class="p">...</span>
                <span class="dl">"</span><span class="s2">content</span><span class="dl">"</span><span class="p">:</span> <span class="p">{{</span> <span class="nx">item</span><span class="p">.</span><span class="nx">excerpt</span> <span class="o">|</span> <span class="nx">markdownify</span> <span class="o">|</span> <span class="nx">jsonify</span> <span class="p">}},</span>
</code></pre></div></div>

<p>By default, Jekyll uses the first para (usually the first heading) as the exceprt, however this can be customised as follows:</p>
<ul>
  <li>in the page front matter, set the <code class="language-plaintext highlighter-rouge">excerpt_seperator</code></li>
  <li>in the page content, use this separator to mark the end of the excerpt.</li>
</ul>

<p>Here’s an example:</p>

<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
<span class="na">excerpt_separator</span><span class="pi">:</span> <span class="s">&lt;!--more--&gt;</span>
<span class="na">title</span><span class="pi">:</span> <span class="s">My long article</span>
<span class="nn">---</span>

{{ page.title }}

This is the content which I'd like to be shown:
<span class="p">*</span> in the page
and
<span class="p">*</span> in the excerpt
<span class="c">&lt;!--more--&gt;</span>

Let's get on with the rest of the article in the page only.....
</code></pre></div></div>

<h4 id="thanks">Thanks</h4>

<p>This content was inspired by</p>
<ul>
  <li>this <a href="https://stackoverflow.com/a/59575439/2738122">stackoverflow response</a> with the javascript approach</li>
  <li>this whole <a href="https://stackoverflow.com/questions/16422933/how-do-i-use-markdownify-in-jekyll-to-show-an-excerpt-on-the-index">stackoverflow question</a> referring in various ways to <code class="language-plaintext highlighter-rouge">excerpt_separator</code>.</li>
  <li>this took me to the Jekyll docs about <a href="https://jekyllrb.com/docs/posts/#post-excerpts">posting excerpts</a></li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="github pages" /><summary type="html"><![CDATA[This post will explain how to use Github pages to create a powerful but easy to use content site, and to add Google Analytics, Ads and a Paypal donate button to that site to monetise and monitor it.]]></summary></entry><entry><title type="html">Raspberry Pi Storage Throughput Testing</title><link href="https://www.kolossi.co.uk/pi-throughput-testing/" rel="alternate" type="text/html" title="Raspberry Pi Storage Throughput Testing" /><published>2021-01-09T00:00:00+00:00</published><updated>2021-01-09T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/pi-throughput-testing</id><content type="html" xml:base="https://www.kolossi.co.uk/pi-throughput-testing/"><![CDATA[<p>Having tested various options, I’ll be using <code class="language-plaintext highlighter-rouge">****</code> as the permanent backing store for my Raspberry Pi Kubernetes cluster workloads and <code class="language-plaintext highlighter-rouge">****</code> for working storage. Here’s why…</p>

<!--more-->

<h2 id="test-setup">Test setup</h2>

<p>%%% INSERT drawing.net picture here %%%</p>

<p>I use:</p>
<ul>
  <li>a “server” (2GB) and a “client” (8GB) <a href="https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/">Raspberry Pi 4 Model B</a></li>
  <li>the Pis are running off a microSD Card on either a
    <ul>
      <li><a href="https://shop.westerndigital.com/en-gb/products/memory-cards/sandisk-ultra-uhs-i-microsd#SDSQUA4-032G-GN6MA">SanDisk Ultra 32GB U1 Class 10 </a></li>
      <li><a href="https://www.samsung.com/uk/memory-storage/memory-card/evo-plus-microsd-card-with-sd-adapter-64gb-mb-mc64ga-eu/">Samsung EVO Plus 64GB Grade3(U3) Class 10</a></li>
    </ul>
  </li>
  <li>… and using one of
    <ul>
      <li>Raspberry Pi OS Lite (32-bit)</li>
      <li>Raspberry Pi OS (64-bit) beta (no lite version available)</li>
      <li>Ubuntu Server 20.04.1 LTS (32-bit)</li>
      <li>Ubuntu Server 20.04.1 LTS (64-bit)</li>
    </ul>
  </li>
  <li>… and both without and with (Ubuntu only) <a href="https://en.wikipedia.org/wiki/ISCSI_Extensions_for_RDMA">iscsi iSER</a></li>
  <li>The server Pi has a <a href="https://www.kingston.com/unitedkingdom/en/memory/search/discontinuedmodels?partId=SUV500M8%2F120G">Kingston 120GB M.2 SSD</a> attached to it via either a:
    <ul>
      <li><a href="https://geekworm.com/products/for-raspberry-pi-4-x862-m-2-ngff-sata-ssd-storage-expansion-board">Geekwork X862 M.2 SSD USB 3.1 adapter “shield”</a></li>
      <li><a href="https://www.sabrent.com/product/EC-M2MC/m-2-ssd-ngff-to-usb-3-0-aluminum-enclosure">Sabrent M.2 SSD [NGFF] USB 3.0 aluminum Enclosure</a></li>
    </ul>
  </li>
  <li>the pis are linked together via a <a href="https://www.netgear.co.uk/images/datasheet/switches/GS305_GS308_GS305P_GS308P.pdf">Netgear GS305 gigabit switch</a></li>
  <li>the pi network is then linked to a NAS via a <a href="https://www.netgear.co.uk/images/datasheet/switches/GS305_GS308_GS305P_GS308P.pdf">Netgear GS308 gigabit switch</a></li>
  <li>the NAS is a <a href="https://global.download.synology.com/download/Document/Hardware/DataSheet/DiskStation/15-year/DS415+/enu/Synology_DS415_Plus_Data_Sheet_enu.pdf">Synology DS415+</a> with a 3x <a href="https://www.seagate.com/gb/en/internal-hard-drives/hdd/ironwolf/">Seagate Ironwolf 7200rpm 6TB</a> raid backing store</li>
</ul>

<h2 id="trying-it-out-yourself">Trying it out yourself</h2>

<blockquote>
  <p>:information_source: Familiarity with ansible itself is required to run this, it won’t be detailed here.</p>
</blockquote>

<blockquote>
  <p>:information_source: First, make sure to get some fresh microSD cards for the Pis, there’s no automatic rollback to the “before” state, and shutdown seems to be problematic after installing this due to the iscsi mounts.  You have been cautioned!</p>
</blockquote>

<p>Download and install <a href="raspberrypi.org/blog/raspberry-pi-imager-imaging-utility/">Raspberry Pi Imager</a>.</p>

<p>Install two sd cards with either of:</p>

<ul>
  <li>Raspberry Pi OS (other) -&gt; Raspberry Pi OS Lite (32-bit)</li>
  <li>Ubuntu -&gt; Ubuntu Server 20.04.2 LTS (RPi 3/4/400)</li>
</ul>

<p>Once clean cards are installed, OS-specific setup steps are needed:</p>

<h3 id="raspberry-pi-os-setup">Raspberry Pi OS Setup</h3>

<p>Login to each pi using the default username <code class="language-plaintext highlighter-rouge">pi</code>, password <code class="language-plaintext highlighter-rouge">raspberry</code>, then allow ssh login by doing:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo touch</span> /boot/ssh
<span class="nb">sudo </span>reboot
</code></pre></div></div>

<h3 id="ubuntu-setup">Ubuntu Setup</h3>

<p>Login to each pi using the default username <code class="language-plaintext highlighter-rouge">ubuntu</code>, password <code class="language-plaintext highlighter-rouge">ubuntu</code>.</p>

<p>Change the password when prompted (suggest <code class="language-plaintext highlighter-rouge">raspberry</code> for ease of interop with Raspberry Pi OS test setups)</p>

<h3 id="ssh-setup">SSH setup</h3>

<p>Ensure that the ansible <code class="language-plaintext highlighter-rouge">hosts</code> file has the correct username and password for each pi.</p>

<p>Clear out ssh host key cache on ansible host machine by doing:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen <span class="nt">-R</span> <span class="o">{</span>pi-ip-address<span class="o">}</span>
</code></pre></div></div>
<p>Update the ECSDA key fingerprint by doing:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="o">{</span>pi-ip-address<span class="o">}</span>
...
Are you sure you want to <span class="k">continue </span>connecting <span class="o">(</span><span class="nb">yes</span>/no/[fingerprint]<span class="o">)</span>? <span class="nb">yes</span>
</code></pre></div></div>

<p>There’s no need to actually do the ssh login after this, ansible is now good to go.</p>

<h2 id="ansible-setup">Ansible Setup</h2>

<h3 id="ansible-config">Ansible config</h3>

<p>To test on Rasperry Pi OS x64 (as of Jan 2021), ensure the following section is in your <code class="language-plaintext highlighter-rouge">~/.ansible.cfg</code>:</p>

<div class="language-config highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[<span class="n">ssh_connection</span>]
<span class="n">scp_if_ssh</span>=<span class="n">True</span>
</code></pre></div></div>

<h3 id="ansible-role">Ansible role</h3>

<p>The ansible role is <a href="https://github.com/Kolossi/ansible-role-utils">on github</a>, and an <a href="https://github.com/Kolossi/ansible-role-utils/blob/main/use_cases/pi-throughput-test.yml">example playbook</a> is provided.</p>

<p>Be sure to change the playbook vars header:</p>
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="pi">-</span> <span class="na">vars</span><span class="pi">:</span>
    <span class="na">ssd_pi_hostname</span><span class="pi">:</span>      <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">server</span><span class="nv"> </span><span class="s">pi</span><span class="nv"> </span><span class="s">(with</span><span class="nv"> </span><span class="s">ssd)</span><span class="nv"> </span><span class="s">hostname</span><span class="nv"> </span><span class="s">known</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">ansible</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">client_pi_hostname</span><span class="pi">:</span>   <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">client</span><span class="nv"> </span><span class="s">pi</span><span class="nv"> </span><span class="s">hostname</span><span class="nv"> </span><span class="s">known</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">ansible</span><span class="nv"> </span><span class="s">hosts</span><span class="nv"> </span><span class="s">file</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">nas_nfs_target</span><span class="pi">:</span>       <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">nas</span><span class="nv"> </span><span class="s">nfs</span><span class="nv"> </span><span class="s">target</span><span class="nv"> </span><span class="s">({ip</span><span class="nv"> </span><span class="s">address}:{path})</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">nas_iscsi_target_iqn</span><span class="pi">:</span> <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">nas</span><span class="nv"> </span><span class="s">iscsi</span><span class="nv"> </span><span class="s">target</span><span class="nv"> </span><span class="s">iqn</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">nas_iscsi_target_ip</span><span class="pi">:</span>  <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">nas</span><span class="nv"> </span><span class="s">iscsi</span><span class="nv"> </span><span class="s">target</span><span class="nv"> </span><span class="s">ip</span><span class="nv"> </span><span class="s">address</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">pi_nfs_serve_network</span><span class="pi">:</span> <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">an</span><span class="nv"> </span><span class="s">ip</span><span class="nv"> </span><span class="s">network</span><span class="nv"> </span><span class="s">spec</span><span class="nv"> </span><span class="s">that</span><span class="nv"> </span><span class="s">includes</span><span class="nv"> </span><span class="s">server</span><span class="nv"> </span><span class="s">&amp;</span><span class="nv"> </span><span class="s">client</span><span class="nv"> </span><span class="s">pis</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">test_dir</span><span class="pi">:</span>             <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">dir</span><span class="nv"> </span><span class="s">on</span><span class="nv"> </span><span class="s">pi</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">use</span><span class="nv"> </span><span class="s">for</span><span class="nv"> </span><span class="s">workings</span><span class="nv"> </span><span class="s">(e.g.</span><span class="nv"> </span><span class="s">/media/test)</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">ssd_device</span><span class="pi">:</span>           <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">pi</span><span class="nv"> </span><span class="s">ssd</span><span class="nv"> </span><span class="s">device</span><span class="nv"> </span><span class="s">(e.g.</span><span class="nv"> </span><span class="s">/dev/sda)</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
    <span class="na">pi_ntp_servers</span><span class="pi">:</span>       <span class="s2">"</span><span class="s">CHANGE_ME:</span><span class="nv"> </span><span class="s">space-separated</span><span class="nv"> </span><span class="s">ntp</span><span class="nv"> </span><span class="s">servers</span><span class="nv"> </span><span class="s">:CHANGE_ME"</span>
</code></pre></div></div>

<p>Then run with</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ansible-playbook ./pi-throughput-test.yml
</code></pre></div></div>

<p>… and then wait … :clock1: … about an hour, possibly more!</p>

<p>The ansible output will end with a message giving the local temp filename that the results are stored in.</p>

<h2 id="results">Results</h2>

<p>Underlying the ansible role it uses <a href="https://github.com/TheRemote/PiBenchmarks">Pi Benchmark script</a> by <a href="https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/">James A Chambers</a>.</p>

<p>This script gives an overall score for each storage target.  In the score results below, the score is divided by one thousand and rounded to give an <code class="language-plaintext highlighter-rouge">x.x</code> figure in each case, which is a little easier to “see”.</p>

<p>The score is the most comprehensive script output given for a target, but it isn’t available for a <code class="language-plaintext highlighter-rouge">/tmp</code> target addressing ram, so for comparison, the simpler DDwrites result is given to be able to compare to ram. TL;DR : the ram is twice as fast as the ssd.</p>

<h3 id="score-results">Score Results</h3>
<div id="pi_score_table"></div>
<script type="text/javascript">
if (jsit_options !== null && typeof jsit_options == 'undefined') var jsit_options={};
var options = {
    <!-- scrollable: true, -->
    <!-- fitHeight: true, -->
    <!-- headercells: true, -->
    rowPerUniqueValue: {
        datafield: "platform",
        sortCompare: function(a,b) { return a.localeCompare(b);} // alpha sort
    },
    columns: [
        { title: "platform", datafield: "platform" },        
        { 
            fromUniqueValues: {
                datafield: "target",
                sortCompare: function(a,b) { 
                    function targetIndex(x)
                    {
                        // thanks: https://stackoverflow.com/a/1535650/2738122
                        if ( typeof targetIndex.lookup == 'undefined' ) {
                            targetIndex.lookup={
                                "ram": 1,
                                "ssd": 2,
                                "nas_nfs": 3,
                                "nas_iscsi": 4,
                                "self_iscsi": 5,
                                "self_nfs": 6,
                                "pi_iscsi": 7,
                                "pi_nfs": 8,
                                "sdcard": 9
                            }
                        }
                        return targetIndex.lookup[x];
                    };

                    return targetIndex(a)-targetIndex(b);
                }
            },
            view: function ( cellData ) { 
                var av=cellData.scores.reduce((sum,curr) => sum+Number(curr), 0)/cellData.scores.length;
                var itemview = (Math.round(av/100)/10).toFixed(1)
                return itemview;
            }
        },
    ]
};
jsit_options['pi_score_table'] = options;
if (!!options.data)
{
    $('#pi_score_table').JSIronTable(options);
}
else
{
    $.getJSON( "/data/pi-throughput/pi-throughput.json", function( data ) {
        var options = jsit_options['pi_score_table'];
        options.data = data;
        var dataFilter = eval("(x) => x.target != 'ram';");
        if (dataFilter) options.data = data.filter(dataFilter);
        $('#pi_score_table').JSIronTable(options);
    })
    .fail(function() {
        console.error("Error loading json from /data/pi-throughput/pi-throughput.json");
    });
}
</script>

<h3 id="ddwrite-results">DDWrite Results</h3>
<div id="pi_ddwrite_table"></div>
<script type="text/javascript">
if (jsit_options !== null && typeof jsit_options == 'undefined') var jsit_options={};
var options = {
    <!-- scrollable: true, -->
    <!-- fitHeight: true, -->
    <!-- headercells: true, -->
    rowPerUniqueValue: {
        datafield: "platform",
        sortCompare: function(a,b) { return a.localeCompare(b);} // alpha sort
    },
    columns: [
        { title: "platform", datafield: "platform" },        
        { 
            fromUniqueValues: {
                datafield: "target",
                sortCompare: function(a,b) { 
                    function targetIndex(x)
                    {
                        // thanks: https://stackoverflow.com/a/1535650/2738122
                        if ( typeof targetIndex.lookup == 'undefined' ) {
                            targetIndex.lookup={
                                "ram": 1,
                                "ssd": 2,
                                "nas_nfs": 3,
                                "nas_iscsi": 4,
                                "self_iscsi": 5,
                                "self_nfs": 6,
                                "pi_iscsi": 7,
                                "pi_nfs": 8,
                                "sdcard": 9
                            }
                        }
                        return targetIndex.lookup[x];
                    };

                    return targetIndex(a)-targetIndex(b);
                }
            },
            view: function ( cellData ) { 
                var av=cellData.ddwrites.reduce((sum,curr) => sum+Number(curr), 0)/cellData.ddwrites.length;
                var itemview = av.toFixed(1);
                return itemview;
            }
        },
    ]
};
jsit_options['pi_ddwrite_table'] = options;
if (!!options.data)
{
    $('#pi_ddwrite_table').JSIronTable(options);
}
else
{
    $.getJSON( "/data/pi-throughput/pi-throughput.json", function( data ) {
        var options = jsit_options['pi_ddwrite_table'];
        options.data = data;
        var dataFilter = eval("");
        if (dataFilter) options.data = data.filter(dataFilter);
        $('#pi_ddwrite_table').JSIronTable(options);
    })
    .fail(function() {
        console.error("Error loading json from /data/pi-throughput/pi-throughput.json");
    });
}
</script>

<style>
    #pi_score_table .jsit_cell:nth-child(1),
    #pi_score_table .jsit_head:nth-child(1),
    #pi_ddwrite_table .jsit_cell:nth-child(1),
    #pi_ddwrite_table .jsit_head:nth-child(1) {
        flex-grow: 2;
    }
</style>]]></content><author><name>Paul Sweeney</name></author><category term="raspberrypi" /><summary type="html"><![CDATA[Having tested various options, I’ll be using **** as the permanent backing store for my Raspberry Pi Kubernetes cluster workloads and **** for working storage. Here’s why…]]></summary></entry><entry><title type="html">VSCode Git SSH setup</title><link href="https://www.kolossi.co.uk/vscode-git-ssh-setup/" rel="alternate" type="text/html" title="VSCode Git SSH setup" /><published>2021-01-09T00:00:00+00:00</published><updated>2021-01-09T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/vscode-git-ssh-setup</id><content type="html" xml:base="https://www.kolossi.co.uk/vscode-git-ssh-setup/"><![CDATA[<p>To enable vscode git extension to use pageant-served ssh certificates…
<!--more--></p>
<ul>
  <li>download and install <a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">PuTTY</a></li>
  <li>find the installed path of <code class="language-plaintext highlighter-rouge">plink.exe</code> - usually <code class="language-plaintext highlighter-rouge">C:\Program Files\PuTTY\plink.exe</code></li>
  <li>set <code class="language-plaintext highlighter-rouge">GIT_SSH</code> and <code class="language-plaintext highlighter-rouge">GIT_SSH_COMMAND</code> environment variables to this path:</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">GIT_SSH</span><span class="o">=</span><span class="s2">"C:</span><span class="se">\P</span><span class="s2">rogram Files</span><span class="se">\P</span><span class="s2">uTTY</span><span class="se">\p</span><span class="s2">link.exe"</span>
<span class="nv">GIT_SSH_COMMAND</span><span class="o">=</span><span class="s2">"C:</span><span class="se">\P</span><span class="s2">rogram Files</span><span class="se">\P</span><span class="s2">uTTY</span><span class="se">\p</span><span class="s2">link.exe"</span>
</code></pre></div></div>

<hr />
<blockquote>
  <p>:information_source: Most programs use <code class="language-plaintext highlighter-rouge">GIT_SSH</code> and VSCode picks this up but gives an error that it can’t spawn <code class="language-plaintext highlighter-rouge">plink.exe</code> due to permission denied.</p>

  <p>To get VSCode working, also set <code class="language-plaintext highlighter-rouge">GIT_SSH_COMMAND</code></p>
</blockquote>

<blockquote>
  <p>:exclamation: If the error <code class="language-plaintext highlighter-rouge">plink: unknown option "-o"</code> occurs, see <a href="https://www.kolossi.co.uk\quicktips\git-plink-unknown-option-o.html">Fix git plink unknown option error</a>.</p>
</blockquote>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="vscode" /><category term="git" /><category term="ssh" /><summary type="html"><![CDATA[To enable vscode git extension to use pageant-served ssh certificates…]]></summary></entry><entry><title type="html">Git get file modification times</title><link href="https://www.kolossi.co.uk/git-get-file-modification-times/" rel="alternate" type="text/html" title="Git get file modification times" /><published>2020-02-10T00:00:00+00:00</published><updated>2020-02-10T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-get-file-modification-times</id><content type="html" xml:base="https://www.kolossi.co.uk/git-get-file-modification-times/"><![CDATA[<p>To list the last git modification time of each source controlled file in the current directory …
<!--more-->
Use:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git ls-tree <span class="nt">-r</span> <span class="nt">--name-only</span> HEAD | <span class="k">while </span><span class="nb">read </span>filename<span class="p">;</span> <span class="k">do
  </span><span class="nb">echo</span> <span class="s2">"</span><span class="si">$(</span>git log <span class="nt">-1</span> <span class="nt">--format</span><span class="o">=</span><span class="s2">"%ad"</span> <span class="nt">--</span> <span class="nv">$filename</span><span class="si">)</span><span class="s2"> </span><span class="nv">$filename</span><span class="s2">"</span>
<span class="k">done</span>
</code></pre></div></div>

<p>Less readable one-liner:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git ls-tree <span class="nt">-r</span> <span class="nt">--name-only</span> HEAD | <span class="k">while </span><span class="nb">read </span>filename<span class="p">;</span> <span class="k">do </span><span class="nb">echo</span> <span class="s2">"</span><span class="si">$(</span>git log <span class="nt">-1</span> <span class="nt">--format</span><span class="o">=</span><span class="s2">"%ad"</span> <span class="nt">--</span> <span class="nv">$filename</span><span class="si">)</span><span class="s2"> </span><span class="nv">$filename</span><span class="s2">"</span><span class="p">;</span> <span class="k">done</span>
</code></pre></div></div>

<h4 id="thanks">Thanks</h4>

<p>Info from this <a href="https://serverfault.com/a/401450">serverfault response</a>.</p>]]></content><author><name>Paul Sweeney</name></author><category term="git" /><summary type="html"><![CDATA[To list the last git modification time of each source controlled file in the current directory …]]></summary></entry><entry><title type="html">Pre-fill git commit message</title><link href="https://www.kolossi.co.uk/git-pre-fill-commit-message/" rel="alternate" type="text/html" title="Pre-fill git commit message" /><published>2020-01-20T00:00:00+00:00</published><updated>2020-01-20T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/git-pre-fill-commit-message</id><content type="html" xml:base="https://www.kolossi.co.uk/git-pre-fill-commit-message/"><![CDATA[<p>To have the git commit message pre-populated with a standard value…
<!--more--></p>
<ul>
  <li>Create a file in the repo <code class="language-plaintext highlighter-rouge">.git</code> directory named e.g. <code class="language-plaintext highlighter-rouge">.git/.gitmessage.txt</code> containing the required message, e.g. a template for the dev to follow such as that given in <a href="https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_commit_template">the git docs</a> or just a generic:
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>update
</code></pre></div>    </div>
  </li>
  <li>add the following content to <code class="language-plaintext highlighter-rouge">.git/config</code>
    <div class="language-config highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[<span class="n">commit</span>]
  <span class="n">template</span> = .<span class="n">git</span>/.<span class="n">gitmessage</span>.<span class="n">txt</span>
</code></pre></div>    </div>
  </li>
</ul>

<p>:information_source: The <code class="language-plaintext highlighter-rouge">.git/config</code> and <code class="language-plaintext highlighter-rouge">.git/.gitmessage.txt</code> files are just on the local environment, so:</p>
<ul>
  <li>they won’t get pushed to upstream repo</li>
  <li>this will need to be redone for each environment/repo clone</li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="quicktips" /><category term="git" /><summary type="html"><![CDATA[To have the git commit message pre-populated with a standard value…]]></summary></entry><entry><title type="html">Create kubernetes job from cronjob</title><link href="https://www.kolossi.co.uk/create-kubernetes-job/" rel="alternate" type="text/html" title="Create kubernetes job from cronjob" /><published>2019-12-11T00:00:00+00:00</published><updated>2019-12-11T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/create-kubernetes-job</id><content type="html" xml:base="https://www.kolossi.co.uk/create-kubernetes-job/"><![CDATA[<p>To create a onetime kubernetes job from an existing cronjob…
<!--more--></p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">kubectl create job --from=cronjob/{exisiting-kubernetes-cron-job} {manual-job-name}</code></li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="kubernetes" /><summary type="html"><![CDATA[To create a onetime kubernetes job from an existing cronjob…]]></summary></entry><entry><title type="html">Ansible setup</title><link href="https://www.kolossi.co.uk/ansible-setup/" rel="alternate" type="text/html" title="Ansible setup" /><published>2019-09-04T00:00:00+00:00</published><updated>2019-09-04T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/ansible-setup</id><content type="html" xml:base="https://www.kolossi.co.uk/ansible-setup/"><![CDATA[<p>To install on WSL Ubuntu, follow:</p>

<ul>
  <li><a href="https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html?extIdCarryOver=true&amp;sc_cid=701f2000001OH7YAAW#installing-ansible-on-ubuntu">This ansible docs page</a> …
<!--more--></li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="ansible" /><category term="windows" /><category term="wsl ubuntu" /><summary type="html"><![CDATA[To install on WSL Ubuntu, follow: This ansible docs page …]]></summary></entry><entry><title type="html">Linux cgroup cfs issues</title><link href="https://www.kolossi.co.uk/cgroup-cfs-data/" rel="alternate" type="text/html" title="Linux cgroup cfs issues" /><published>2019-08-15T00:00:00+00:00</published><updated>2019-08-15T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/cgroup-cfs-data</id><content type="html" xml:base="https://www.kolossi.co.uk/cgroup-cfs-data/"><![CDATA[<p>The CFS (“completely fair scheduler”) in unix uses cgroups as part of
limiting memory and resources.</p>

<p>There are issues with the way the linux kernel deals with spiky
workloads, with a fix put in linux kernel 4.18 and later.
<!--more--></p>

<h2 id="cfs-issues">CFS issues</h2>

<p>See <a href="https://github.com/kubernetes-monitoring/kubernetes-mixin/issues/108">https://github.com/kubernetes-monitoring/kubernetes-mixin/issues/108</a> &amp;
<a href="https://github.com/kubernetes/kubernetes/issues/67577">https://github.com/kubernetes/kubernetes/issues/67577</a>. We run Ubuntu 16.04
which originally came with Linux kernel 4.4. Later versions of Ubunutu 16.04.4
have up to at least kernel version 4.13 according to
<a href="https://en.wikipedia.org/wiki/Ubuntu_version_history">https://en.wikipedia.org/wiki/Ubuntu_version_history</a>.</p>

<p>As of writing, we still have the stock 4.4 kernel.</p>

<p>It seems from the discussion on the <a href="https://github.com/kubernetes/kubernetes/issues/67577#issuecomment-466609030">2nd github issue</a> &amp; contributions
there from chiluk, that a fix for a method of detecting “clock skew”, which has
an effect on cpu throttling of spiky loads such as prometheues node-exporer,
is possibly included from kernel v4.18. However the earliest Ubuntu to have
 this is 18.10 (not LTS).</p>

<h3 id="youtube-talk-by-henning-jacobs">Youtube talk by Henning Jacobs</h3>

<p>See also Henning Jacobs talk on the subject - <a href="https://youtu.be/4QyecOoPsGU">https://youtu.be/4QyecOoPsGU</a>
mentioned on <a href="https://twitter.com/tpeitz_dus/status/1133648291332263936">https://twitter.com/tpeitz_dus/status/1133648291332263936</a> in the
github discussion above.</p>

<h3 id="how-to-view-cfs-data">How to view CFS data</h3>

<p>See <a href="https://youtu.be/4QyecOoPsGU?t=422">https://youtu.be/4QyecOoPsGU?t=422</a> about requests:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl run --requests=cpu=10m/5m ..sha512()..
# 10m means 10millicores, ie 0.01 core
# 
cat /sys/fs/cgroup/cpu/kubepods/burstable/pod5d5..0d/cpu.shares
10 # relative share of cpu time

cat /sys/fs/cgroup/cpu/kubepods/burstable/pod6e0..0d/cpu.shares
5 # relative share of cpu time

cat /sys/fs/cgroup/cpuacct/kubepods/burstable/pod5d5..0d/cpuacct.usage
    /sys/fs/cgroup/cpuacct/kubepods/burstable/pod6e0..0d/cpuacct.usage
13432815283 # total CPU time in nanoseconds
7528759332 # total CPU time in nanoseconds
</code></pre></div></div>

<p>So the cpu fraction split is reflected in the total cpu time.</p>

<p>Similarly, see <a href="https://youtu.be/4QyecOoPsGU?t=747">https://youtu.be/4QyecOoPsGU?t=747</a> re limits, example:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run -- cpus 1 -m 200m -it busybox

cat /sys/fs/cgroup/cpu/docker/8ab25..1c/cpu.{shares,cfs_*}
1024    # cpu.shares (default value)
100000 # cpu.cfs_period_us (100ms period length)
100000 # cpu.cfs_quota_us (total CPU time in us consumable per period)

cat /sys/fs/cgroup/memory/docker/8ab25..1c/memory.limit_in_bytes
209715200  #200MB as requested
</code></pre></div></div>

<p>CFS quota period was hardcoded to 100ms in Kubernetes,
as of Kubernetes 1.12 now configurable - <a href="https://github.com/kubernetes/kubernetes/pull/63437">https://github.com/kubernetes/kubernetes/pull/63437</a></p>

<h3 id="view-kubelet-configuraion">View kubelet configuraion</h3>

<p>See <a href="/view-kubelet-config/">view-kubelet-config</a></p>]]></content><author><name>Paul Sweeney</name></author><category term="linux" /><category term="kubernetes" /><summary type="html"><![CDATA[The CFS (“completely fair scheduler”) in unix uses cgroups as part of limiting memory and resources. There are issues with the way the linux kernel deals with spiky workloads, with a fix put in linux kernel 4.18 and later.]]></summary></entry><entry><title type="html">View kubelet config</title><link href="https://www.kolossi.co.uk/view-kubelet-config/" rel="alternate" type="text/html" title="View kubelet config" /><published>2019-08-15T00:00:00+00:00</published><updated>2019-08-15T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/view-kubelet-config</id><content type="html" xml:base="https://www.kolossi.co.uk/view-kubelet-config/"><![CDATA[<p>The file used to configure the kubelet can be found at
<code class="language-plaintext highlighter-rouge">/var/lib/kubelet/config.yaml</code> on the node …
<!--more--></p>

<p>However this may not match the currently running config if the instructions
at <a href="https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/">Generate the (Kubelet) configuration file</a> have been followed.</p>

<h2 id="view-running-configuration-of-the-kubelet">View running configuration of the kubelet</h2>

<ul>
  <li>Set up $KUBECONFIG</li>
  <li>start a proxy to cluster port 8001
    <ul>
      <li><code class="language-plaintext highlighter-rouge">kubectl proxy --port=8001 &amp;</code></li>
    </ul>
  </li>
  <li>extract the config from the api, setting appropriate node name, e.g.:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">NODE_NAME="k8s-s-grn-g-m1"; curl -sSl "http://localhost:8001/api/v1/nodes/${NODE_NAME}/proxy/configz" | jq '.kubeletconfig|.kind="KubeletConfiguration"|.apiVersion="kubelet.config.k8s.io/v1beta1"'</code></li>
    </ul>
  </li>
  <li>kill the proxy
    <ul>
      <li>check the output of <code class="language-plaintext highlighter-rouge">jobs</code>, e.g.
        <ul>
          <li>‘[1]+ Running    kubectl proxy –port=8001 &amp;’</li>
        </ul>
      </li>
      <li>the job id is in the “[x]”, and needs to be prefixed with ‘%’, so above is:
        <ul>
          <li><code class="language-plaintext highlighter-rouge">kill %1</code></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>]]></content><author><name>Paul Sweeney</name></author><category term="kubernetes" /><category term="quicktips" /><summary type="html"><![CDATA[The file used to configure the kubelet can be found at /var/lib/kubelet/config.yaml on the node …]]></summary></entry><entry><title type="html">Dark terminal bash and vim colours setup</title><link href="https://www.kolossi.co.uk/dark-terminal-bash-and-vim-colours-setup/" rel="alternate" type="text/html" title="Dark terminal bash and vim colours setup" /><published>2019-07-09T00:00:00+00:00</published><updated>2019-07-09T00:00:00+00:00</updated><id>https://www.kolossi.co.uk/dark-terminal-bash-and-vim-colours-setup</id><content type="html" xml:base="https://www.kolossi.co.uk/dark-terminal-bash-and-vim-colours-setup/"><![CDATA[<p>When using a dark terminal, bash and vim colours can work badly.  To correct this set them up like this…
<!--more--></p>

<h3 id="vim-colours">vim colours</h3>

<p>To temporarily fix:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>set bg=dark
</code></pre></div></div>

<p>To permanently fix:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"set background=dark"</span> <span class="o">&gt;&gt;</span> ~/.vimrc
</code></pre></div></div>

<p>Thanks to <a href="https://blog.programster.org/fix-font-colors-in-windows-10-bash">this post</a></p>

<h3 id="bash-colours">bash colours</h3>

<p>Add the following to the end of <code class="language-plaintext highlighter-rouge">.bashrc</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">LS_COLORS</span><span class="o">=</span><span class="s1">'rs=0:di=00;36:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=01;36:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'</span><span class="p">;</span>
<span class="nb">export </span>LS_COLORS
</code></pre></div></div>]]></content><author><name>Paul Sweeney</name></author><category term="linux" /><category term="bash" /><category term="vim" /><summary type="html"><![CDATA[When using a dark terminal, bash and vim colours can work badly. To correct this set them up like this…]]></summary></entry></feed>