Hello there
I have a freestyle job that works well; it’s a combination of shell commands, gradle
commands and gh
commands.
As I did not want to loose the history of my modifications, I decided to create a Jenkinsfile on my GitHub repo, and move my freestyle job to a pipeline.
It’s my first pipeline ever, and I can’t get it to be validated with the Jenkins linter.
What I’m doing wrong must be obvious, but not to me unfortunately:
pipeline {
agent any
stages {
stage('Static Analysis') {
steps {
echo 'Run the static analysis to the code'
}
}
stage('Compile') {
steps {
script {
echo 'Compile the source code'
chmod +x ./gradlew
./gradlew build
./gradlew :app:bundleDebug :app:bundleRelease
./gradlew tasks --group publishing
}
}
}
stage('Security Check') {
steps {
echo 'Run the security check against the application'
}
}
stage('Run Unit Tests') {
steps {
echo 'Run unit tests from the source code'
}
}
stage('Run Integration Tests') {
steps {
echo 'Run only crucial integration tests from the source code'
}
}
stage('Publish Artifacts') {
steps {
echo 'Save the assemblies generated from the compilation'
}
}
}
}
The linter says:
WorkflowScript: 14: expecting '}', found 'gradlew' @ line 14, column 23.
Can anyone spot what I’ve done wrong?
Thanks.