diff --git a/azure-pipelines/templates/default.yml b/azure-pipelines/templates/default.yml index d30060dceee..efb1e8f484b 100644 --- a/azure-pipelines/templates/default.yml +++ b/azure-pipelines/templates/default.yml @@ -2,22 +2,33 @@ # http://tardis-sn.github.io/tardis/development/continuous_integration.html parameters: - - name: fetchDepth - type: number - default: 0 - - - name: fetchRefdata + - name: useMamba type: boolean default: false - - name: useMamba + - name: tardisEnv + type: boolean + default: true + + - name: carsusEnv type: boolean default: false - - name: skipInstall + - name: fetchRefdata type: boolean default: false + - name: refdataRepo + type: string + default: azure + values: + - azure + - github + + - name: fetchDepth + type: number + default: 0 + steps: - bash: echo "##vso[task.setvariable variable=shellopts]errexit" displayName: 'Force BASH exit on error' @@ -25,6 +36,7 @@ steps: - bash: | echo "##vso[task.setvariable variable=tardis.dir]$(Build.SourcesDirectory)/tardis" + echo "##vso[task.setvariable variable=carsus.dir]$(Build.SourcesDirectory)/carsus" echo "##vso[task.setvariable variable=refdata.dir]$(Build.SourcesDirectory)/tardis-refdata" displayName: 'Set environment variables' @@ -38,14 +50,24 @@ steps: echo "##vso[task.setvariable variable=package.manager]mamba" displayName: 'Set package manager' - - checkout: self - path: s/tardis - fetchDepth: ${{ parameters.fetchDepth }} + - ${{ if eq(parameters.tardisEnv, true) }}: + - checkout: self + path: s/tardis + fetchDepth: ${{ parameters.fetchDepth }} + + - ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'azure')) }}: + - checkout: git://TARDIS/tardis-refdata + lfs: true + displayName: 'Fetch reference data' + + - ${{ if and(eq(parameters.fetchRefdata, true), eq(parameters.refdataRepo, 'github')) }}: + - bash: | + git clone https://github.com/tardis-sn/tardis-refdata.git $(refdata.dir) + cd $(refdata.dir); git lfs fetch - - ${{ if eq(parameters.fetchRefdata, true) }}: - - checkout: git://TARDIS/tardis-refdata - lfs: true - displayName: 'Fetch reference data' + - ${{ if eq(parameters.carsusEnv, true) }}: + - checkout: git://Carsus/carsus + path: s/carsus - bash: echo "##vso[task.prependpath]$CONDA/bin" displayName: 'Add conda to PATH' @@ -58,15 +80,28 @@ steps: - bash: conda install mamba -c conda-forge -y displayName: 'Install Mamba' - - ${{ if eq(parameters.skipInstall, false) }}: + - ${{ if eq(parameters.tardisEnv, true) }}: - bash: | cd $(tardis.dir) $(package.manager) env create -f tardis_env3.yml displayName: 'Setup environment' - - ${{ if eq(parameters.skipInstall, false) }}: + - ${{ if eq(parameters.tardisEnv, true) }}: - bash: | cd $(tardis.dir) source activate tardis python setup.py install displayName: 'Install package' + + - ${{ if eq(parameters.carsusEnv, true) }}: + - bash: | + cd $(carsus.dir) + $(package.manager) env create -f carsus_env3.yml + displayName: 'Setup environment (carsus)' + + - ${{ if eq(parameters.carsusEnv, true) }}: + - bash: | + cd $(carsus.dir) + source activate carsus + python setup.py install + displayName: 'Install package (carsus)'