Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVOPS-203 add Jenkinsfile #97

Open
wants to merge 5 commits into
base: develoment
Choose a base branch
from

Conversation

gkirok
Copy link

@gkirok gkirok commented Dec 5, 2018

No description provided.

}
}
}
}

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: """

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()}"

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"

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

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 ) {

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}

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

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."

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."

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants