forked from s464914/ium_464914
docker args
This commit is contained in:
parent
1ba161a6b4
commit
6419ff3dc9
@ -1,7 +1,8 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
ENV KAGGLE_USERNAME=alicjaszulecka
|
||||
ENV KAGGLE_KEY=default_key
|
||||
# Dockerfile
|
||||
ARG KAGGLE_USERNAME
|
||||
ARG KAGGLE_KEY
|
||||
|
||||
RUN apt update && apt install -y python3-pip
|
||||
RUN apt install unzip
|
||||
|
37
Jenkinsfile
vendored
37
Jenkinsfile
vendored
@ -1,27 +1,30 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile true
|
||||
dockerfile {
|
||||
args '-v /var/run/docker.sock:/var/run/docker.sock'
|
||||
}
|
||||
}
|
||||
parameters {
|
||||
string(name: 'KAGGLE_USERNAME', defaultValue: 'alicjaszulecka', description: 'Kaggle username')
|
||||
password(name: 'KAGGLE_KEY', defaultValue:'', description: 'Kaggle Key')
|
||||
string(name: 'CUTOFF', defaultValue: '100', description: 'cut off number')
|
||||
string(name: 'KAGGLE_USERNAME', defaultValue: 'alicjaszulecka', description: 'Kaggle username')
|
||||
password(name: 'KAGGLE_KEY', defaultValue:'', description: 'Kaggle Key')
|
||||
string(name: 'CUTOFF', defaultValue: '100', description: 'cut off number')
|
||||
}
|
||||
stages {
|
||||
stage('Git Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
||||
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
||||
|
||||
sh 'bash ./get_dataset.sh $CUTOFF'
|
||||
archiveArtifacts artifacts: 'artifacts/*', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
def customImage = docker.build("my-custom-image:${BUILD_NUMBER}", "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} .")
|
||||
customImage.inside {
|
||||
sh 'bash ./get_dataset.sh ${params.CUTOFF}'
|
||||
}
|
||||
}
|
||||
archiveArtifacts artifacts: 'artifacts/*', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user