Re: Poll git removes build artifacts/clean repository on node workspace

2023-01-18 Thread Vladimir Zak
Hello,

It deletes the files even if the polling did not find any change and the
job did not start. So the step Clean should not be executed (in current
Jenkins it is like that).

Thank you.

Vladimir



st 18. 1. 2023 v 8:35 odesílatel 'Björn Pedersen' via Jenkins Users <
jenkinsci-users@googlegroups.com> napsal:

>
>
> zakyn schrieb am Dienstag, 17. Januar 2023 um 16:57:45 UTC+1:
> Hello,
> thank you.
>
> The job is defined as a jenkinsfile with the polling and git checkout and
> other build steps.
> The snippet of jenkinsfile is below.
>
> After deeper investigation just at the time when polling is executed
> (every hour) the build files from the workspace on the node
> are removed and the repository stays there.
>
> We are using the artifacts but sometimes you need some intermediate files
> that's why we do not delete workspace after job but before.
>
> We are migrating from jenkins2.222.3 (everything works)  -> 2.375.2
>
> Thank you for your help.
>
> Vladimir
>
> ---
> Jenkinsfile part:
>
> triggers{
> pollSCM('@hourly')
> }
>
>stage('Clean workspace'){
>
> steps{
> cleanWs deleteDirs: true, patterns: [[pattern:
> '**/.git/**', type: 'EXCLUDE']]
> }
> }
>
>
> I guess the polling triggers the job and then the deletion is expected.
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/5bb24922-02c7-462c-9725-3411e47f966fn%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/d76cbd1d-31c9-4923-bd9d-c1f9ab6600f5n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAHRFW7j%2B3%3Dr8eVSRhmRHDXvpL%2B%3DTOs%3DTjqds_poB0kXQ41JCew%40mail.gmail.com.


Re: Poll git removes build artifacts/clean repository on node workspace

2023-01-17 Thread 'Björn Pedersen' via Jenkins Users


zakyn schrieb am Dienstag, 17. Januar 2023 um 16:57:45 UTC+1:
Hello,
thank you.

The job is defined as a jenkinsfile with the polling and git checkout and 
other build steps.
The snippet of jenkinsfile is below.

After deeper investigation just at the time when polling is executed (every 
hour) the build files from the workspace on the node
are removed and the repository stays there. 

We are using the artifacts but sometimes you need some intermediate files 
that's why we do not delete workspace after job but before.

We are migrating from jenkins2.222.3 (everything works)  -> 2.375.2   

Thank you for your help.

Vladimir

---
Jenkinsfile part:

triggers{
pollSCM('@hourly') 
}

   stage('Clean workspace'){
   
steps{
cleanWs deleteDirs: true, patterns: [[pattern: 
'**/.git/**', type: 'EXCLUDE']]
}
}


I guess the polling triggers the job and then the deletion is expected. 
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5bb24922-02c7-462c-9725-3411e47f966fn%40googlegroups.com
 

.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d76cbd1d-31c9-4923-bd9d-c1f9ab6600f5n%40googlegroups.com.


Re: Poll git removes build artifacts/clean repository on node workspace

2023-01-17 Thread Vladimir Zak
Hello,
thank you.

The job is defined as a jenkinsfile with the polling and git checkout and
other build steps.
The snippet of jenkinsfile is below.

After deeper investigation just at the time when polling is executed (every
hour) the build files from the workspace on the node
are removed and the repository stays there.

We are using the artifacts but sometimes you need some intermediate files
that's why we do not delete workspace after job but before.

We are migrating from jenkins2.222.3 (everything works)  -> 2.375.2

Thank you for your help.

Vladimir

---
Jenkinsfile part:

triggers{
pollSCM('@hourly')
}

   stage('Clean workspace'){

steps{
cleanWs deleteDirs: true, patterns: [[pattern:
'**/.git/**', type: 'EXCLUDE']]
}
}

stage('Checkout Git'){
steps{
checkout(
[$class: 'GitSCM',
branches: [[name: "remotes/origin/${BUILD_BRANCH}"]],
browser: [
$class: 'GitWeb',
repoUrl: 'URL'],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'DisableRemotePoll'],
[$class: 'CleanBeforeCheckout'],
[$class: 'CheckoutOption', timeout: 120]],
submoduleCfg: [],
userRemoteConfigs: [
[url: 'URL']
]
]
)
}
}

stage('another setp'){
.









út 17. 1. 2023 v 16:23 odesílatel 'Björn Pedersen' via Jenkins Users <
jenkinsci-users@googlegroups.com> napsal:

>
>
> zakyn schrieb am Dienstag, 17. Januar 2023 um 10:13:21 UTC+1:
> Hello,
> we have a problem that polling git clean the repository in workspace on
> the node.
>
> Steps:
> 1. clone git repository  and  build
> 2. build artifacts are in workspace on the node
> 3. press poll smc button -> build artifacts are removed from workspace on
> the node and the clean repository is still available.
>
> Could you please help me how to get a rid of this behavior?
>
>
> First:
> You should always consider workspaces ephemeral (they can get
> cleaned/removed by jenkins at anytime(if not in use).
> If you want to keep artifacts then use an archive artifacts step or push
> them to some other repo (by scp, upload, whatever...) as appropriate.
>
> If you want more help, please specify exactly how your job is configured.
>
> Thank you.
>
> Vladimir
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/5bb24922-02c7-462c-9725-3411e47f966fn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAHRFW7in_%2BYoV1kFydpBobrzJca5B%2BRjbU8ouWuXfpsTepUZOA%40mail.gmail.com.


Re: Poll git removes build artifacts/clean repository on node workspace

2023-01-17 Thread 'Björn Pedersen' via Jenkins Users


zakyn schrieb am Dienstag, 17. Januar 2023 um 10:13:21 UTC+1:
Hello,
we have a problem that polling git clean the repository in workspace on the 
node.

Steps:
1. clone git repository  and  build
2. build artifacts are in workspace on the node
3. press poll smc button -> build artifacts are removed from workspace on 
the node and the clean repository is still available.

Could you please help me how to get a rid of this behavior?


First:
You should always consider workspaces ephemeral (they can get 
cleaned/removed by jenkins at anytime(if not in use).
If you want to keep artifacts then use an archive artifacts step or push 
them to some other repo (by scp, upload, whatever...) as appropriate.

If you want more help, please specify exactly how your job is configured.
 
Thank you.

Vladimir 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5bb24922-02c7-462c-9725-3411e47f966fn%40googlegroups.com.


Poll git removes build artifacts/clean repository on node workspace

2023-01-17 Thread zakyn
Hello,
we have a problem that polling git clean the repository in workspace on the 
node.

Steps:
1. clone git repository  and  build
2. build artifacts are in workspace on the node
3. press poll smc button -> build artifacts are removed from workspace on 
the node and the clean repository is still available.

Could you please help me how to get a rid of this behavior?

Thank you.

Vladimir 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a9f5e626-26da-4ab0-ac62-57ccd16684e0n%40googlegroups.com.