updated and added docker image
This commit is contained in:
parent
c7ff03a1c9
commit
267b38934c
55
Jenkinsfile2
55
Jenkinsfile2
@ -1,55 +0,0 @@
|
||||
pipeline{
|
||||
agent any
|
||||
parameters{
|
||||
choice(
|
||||
choices: ['lastSuccessful()','lastCompleted()','latestSavedBuild()'],
|
||||
description: 'Which build to user for copying artifacts',
|
||||
name: 'BUILD_SELECTOR'
|
||||
)
|
||||
}
|
||||
stages{
|
||||
stage('clear_all'){
|
||||
steps{
|
||||
// removing data
|
||||
sh 'rm -rf ium_458023'
|
||||
}
|
||||
}
|
||||
stage('checkout'){
|
||||
steps{
|
||||
// cloning repository
|
||||
sh ' git clone https://git.wmi.amu.edu.pl/s458023/ium_458023'
|
||||
}
|
||||
}
|
||||
stage('copy_artifacts'){
|
||||
steps{
|
||||
copyArtifacts filter: 'salaries_test.csv,salaries_dev.csv,salaries_train.csv', fingerprintArtifacts: true, projectName: 'z-s458023-create-dataset', selector: workspace()
|
||||
}
|
||||
}
|
||||
stage('docker'){
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'second.dockerfile'
|
||||
dir 'ium_458023'
|
||||
reuseNode true
|
||||
}
|
||||
}
|
||||
steps{
|
||||
sh 'ls -a'
|
||||
sh 'python ium_458023/dataset-stats.py'
|
||||
echo 'koniec'
|
||||
archiveArtifacts 'salaries_test.csv'
|
||||
archiveArtifacts 'salaries_dev.csv'
|
||||
archiveArtifacts 'salaries_train.csv'
|
||||
}
|
||||
}
|
||||
stage('Goodbye!') {
|
||||
steps {
|
||||
echo 'Goodbye!'
|
||||
|
||||
archiveArtifacts 'dataset.csv'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
46
JenkinsfileDatasetStats
Normal file
46
JenkinsfileDatasetStats
Normal file
@ -0,0 +1,46 @@
|
||||
pipeline{
|
||||
agent any
|
||||
|
||||
parameters{
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
description: 'Which build to use for copying artifacts',
|
||||
name: 'BUILD_SELECTOR'
|
||||
)
|
||||
}
|
||||
stages{
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scmGit(
|
||||
branches: [[name: '*/master']],
|
||||
extensions: [cleanBeforeCheckout()],
|
||||
userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s458023/ium_458023.git']]
|
||||
)
|
||||
}
|
||||
}
|
||||
stage('Prepare image and stats') {
|
||||
agent{
|
||||
dockerfile{
|
||||
filename: 'lab4.dockerfile',
|
||||
reuseNode: true,
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
copyArtifacts filter: 'wines_test.csv,wines_dev.csv,wines_train.csv', fingerprintArtifacts: true, projectName: 'z-s458023-create-dataset', selector: workspace()
|
||||
// pobranie obrazu dockera
|
||||
docker.image('s458023/ium:1').pull()
|
||||
|
||||
// testowanie kodu
|
||||
docker.withRegistry('https://registry.hub.docker.com', 'credentials-id') {
|
||||
// Zbuduj kontener Dockerowy
|
||||
docker.image('s458023/ium').inside {
|
||||
// Wykonaj kolejne polecenia w kontenerze
|
||||
sh 'ls -la'
|
||||
sh 'echo "done"'
|
||||
// itd.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user