Update Jenkinsfile3
This commit is contained in:
parent
696f04ae7d
commit
51236af46f
37
Jenkinsfile3
37
Jenkinsfile3
@ -24,15 +24,25 @@ pipeline {
|
||||
stages {
|
||||
stage('Build image'){
|
||||
steps {
|
||||
script {
|
||||
checkout scm
|
||||
//Pierwszy argument to tag, który zostania nadany zbudowanemu obrazowi
|
||||
//Jeśli chcemy użyć Dockerfile z innej ścieżki niż ./Dockerfile, możemy ją podać jako drugi argument
|
||||
def testImage = docker.build("test-image", "./Dockerfile")
|
||||
// First argument is the tag assigned to the built image
|
||||
// If you want to use a Dockerfile from a different path than ./Dockerfile, you can specify it as the second argument
|
||||
def testImage = docker.build("test-image", ".")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run in container'){
|
||||
steps {
|
||||
script {
|
||||
docker.image('test-image').inside {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
// Step: Clone the git repository
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
@ -44,35 +54,28 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
// Krok: Sklonowanie repozytorium git
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Execute Shell Script') {
|
||||
steps {
|
||||
withEnv(["CUTOFF=${params.CUTOFF}" ]) {
|
||||
// Krok: Wywołanie skryptu shella
|
||||
// Step: Invoke the shell script
|
||||
script {
|
||||
sh 'chmod +x data_processing_script.sh' // Nadaj uprawnienia do wykonania skryptu
|
||||
sh './data_processing_script.sh $CUTOFF' // Wykonaj skrypt
|
||||
sh 'chmod +x data_processing_script.sh' // Grant permissions to execute the script
|
||||
sh './data_processing_script.sh $CUTOFF' // Execute the script
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
// Krok: Zarchiwizowanie artefaktów
|
||||
// Step: Archive artifacts
|
||||
archiveArtifacts artifacts: 'processed_data.csv', fingerprint: true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user