-
Notifications
You must be signed in to change notification settings - Fork 14
DEVOPS-203 add Jenkinsfile #97
base: develoment
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n in eof is missing
| git_deploy_user_token = "iguazio-prod-git-user-token" | ||
|
|
||
| properties([pipelineTriggers([[$class: 'PeriodicFolderTrigger', interval: '2m']])]) | ||
| podTemplate(label: "${git_project}-${label}", yaml: """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the yaml should be read from a file
as this is code & should not contain too much
for the variable inside you can have something like <git_project> and then do replace('<git_project>', var)
or even better the name can be configured through the params (not sure if yaml and params work together)
| @@ -0,0 +1,128 @@ | |||
| label = "${UUID.randomUUID().toString()}" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write: UUID.randomUUID().toString()
also the variable name is in correct as its label_suffix
but i think you should have a var label = "${git_project}-${label_suffix}" - as you do this twice in the code
| @@ -0,0 +1,128 @@ | |||
| label = "${UUID.randomUUID().toString()}" | |||
| BUILD_FOLDER = "/go" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you using absolute path instead of workspace subdir?
i know its a container but still
| - name: docker-sock | ||
| mountPath: /var/run | ||
| - name: go-shared | ||
| mountPath: /go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mount path is duplication of the var
| } | ||
| } | ||
|
|
||
| if ( TAG_VERSION && PUBLISHED_BEFORE < 240 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what the 240 mean
| container('jnlp') { | ||
| sh """ | ||
| cd ${BUILD_FOLDER} | ||
| git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${git_project_user}/${git_project}.git src/github.com/v3io/${git_project} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for git clone there is a plugin that do that for you
| stage('build in dood') { | ||
| container('docker-cmd') { | ||
| sh """ | ||
| cd ${BUILD_FOLDER}/src/github.com/v3io/${git_project}/netops_demo/golang/src/github.com/v3io/demos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of cd you can use the pipeline dir(path) {
}
| } else { | ||
| stage('warning') { | ||
| if (PUBLISHED_BEFORE >= 240) { | ||
| echo "Tag too old, published before $PUBLISHED_BEFORE minutes." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure you want a warning that no one will see instead of failing the job
or atleast mark the stage skipped - you can use the conditional_Stage in pipelinex
| if (PUBLISHED_BEFORE >= 240) { | ||
| echo "Tag too old, published before $PUBLISHED_BEFORE minutes." | ||
| } else if (AUTO_TAG.startsWith("Autorelease")) { | ||
| echo "Autorelease does not trigger this job." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again .. check it in the start iand maybe fail it, although i don't understand something in the logic, i guess i need some explanations
No description provided.