Skip to content

Commit

Permalink
changes to pipeline template
Browse files Browse the repository at this point in the history
  • Loading branch information
epassaro committed Jun 17, 2021
1 parent b69b093 commit 9747662
Showing 1 changed file with 51 additions and 16 deletions.
67 changes: 51 additions & 16 deletions azure-pipelines/templates/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,41 @@
# 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'
condition: eq(variables['Agent.OS'], 'Linux')

- 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'
Expand All @@ -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'
Expand All @@ -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)'

0 comments on commit 9747662

Please sign in to comment.