title: Anaconda in Jenkinsfile
body: <p>Since the tests we are running are getting longer and longer, I thought it would be a good idea to switch from Travis CI to Jenkins (on my local computer). Setting up Jenkins was relatively straightforward, however getting my Jenkinsfile to 'work' not so much. I am trying to download miniconda -> install miniconda -> install an environment -> activate the environment -> run commands from that environment. This is what I got so far:</p>
  
  <pre><code>  environment {
      PATH = "$WORKSPACE/miniconda/bin:$PATH"
    }
  
    stages {
      stage('setup miniconda') {
          steps {
              sh '''#!/usr/bin/env bash
              wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
              bash miniconda.sh -b -p $WORKSPACE/miniconda
              hash -r
              conda config --set always_yes yes --set changeps1 no
              conda update -q conda
  
              # Useful for debugging any issues with conda
              conda info -a
              conda config --add channels defaults
              conda config --add channels conda-forge
              conda config --add channels bioconda
  
              # create snakemake-workflows env
              conda init bash
              conda env create -f envs/snakemake-workflows.yaml
              '''
          }
      }
      stage('Test downloading') {
          steps {
              sh '''#!/usr/bin/env bash
              conda init bash
              conda activate miniconda/envs/snakemake-workflows/
              snakemake -s workflows/download_fastq/Snakefile --directory workflows/download_fastq -n -j 48 --quiet
              '''
          }
      }
  </code></pre>
  
  <p>The installation of miniconda seems to work, however the next step in stage test downloading results in the error:</p>
  
  <pre><code>CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
  To initialize your shell, run
  
      $ conda init &lt;SHELL_NAME&gt;
  
  Currently supported shells are:
    - bash
    - fish
    - tcsh
    - xonsh
    - zsh
    - powershell
  
  See 'conda init --help' for more information and options.
  
  IMPORTANT: You may need to close and restart your shell after running 'conda init'.
  </code></pre>
  
  <p>How do I proceed from this? I need to init my conda, however it seems to have no effect (I do it when creating the environment, and when trying to activate it). </p>