diff --git a/Jenkinsfile.txt b/Jenkinsfile.txt index bd71437..d2ddf46 100644 --- a/Jenkinsfile.txt +++ b/Jenkinsfile.txt @@ -1,25 +1,27 @@ node { - stage('Preparation') { - properties([ - parameters([ - string( - defaultValue: 'Hello World!', - description: 'Tekst do wyświetlenie', - name: 'INPUT_TEXT', - trim: false - ) - ]) - ]) - } - stage('Hello') { - //Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!) - echo "INPUT_TEXT: ${INPUT_TEXT}" - //Wywołaj w konsoli komendę "figlet", która generuje ASCI-art - sh "figlet \"${INPUT_TEXT}\" | tee output.txt" - } - stage('Goodbye') { - echo 'Goodbye!' - //Zarchiwizuj wynik - archiveArtifacts 'output.txt' - } + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'jaszwajcar', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ), + password( + defaultValue: '', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + ]) + ]) + } + stage('Build') { + // Run the maven build + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + } } \ No newline at end of file