-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
41 lines (40 loc) · 1.22 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
environment {
PATH = "$WORKSPACE/conda/bin:$PATH"
CONDA_UPLOAD_TOKEN = credentials('terradue-conda')
}
pipeline {
agent {
docker { image 'docker.terradue.com/conda-build:latest' }
}
stages {
stage('Test') {
steps {
sh '''#!/usr/bin/env bash
conda build --version
conda --version
mamba clean -a -y
'''
}
}
stage('Build') {
steps {
sh '''#!/usr/bin/env bash
mkdir -p /home/jovyan/conda-bld/work
cd $WORKSPACE
mamba build .
'''
}
}
stage('Deploy') {
steps {
withCredentials([string(credentialsId: 'terradue-conda', variable: 'ANACONDA_API_TOKEN')]) {
sh '''#!/usr/bin/env bash
export PACKAGENAME=snap
label=main
if [ "$GIT_BRANCH" = "develop" ]; then label=dev; fi
anaconda upload --no-progress --force --user Terradue --label $label /srv/conda/envs/env_conda/conda-bld/*/$PACKAGENAME-*.tar.bz2
'''}
}
}
}
}