Jenkins Console Output: declarative pipeline + sh + python line-buffered

6 views
Skip to first unread message

Danny Trunk

unread,
Oct 18, 2020, 10:10:22 AM10/18/20
to jenkin...@googlegroups.com
Hello everybody,

I've set up a declarative pipeline job using the sh step to run repo (which is a tool written in python - more information: https://source.android.com/setup/develop#repo)
But I can't get stdout to be line-buffered.

I've already tried the following:
* `export PYTHONUNBUFFERED=1` in the sh block before calling repo.
* setting PYTHONUNBUFFERED=1 in the environment block
* using `stdbuf -i0 -e0 -o0 repo sync ...` instead of calling `repo sync ...` directly
* combined all of the above

I can't see any repo progress in the build console.

By running the command manually in a bash I'm getting this output:
```
root@jenkins-lineage:/var/jenkins_home/workspace/lineage# repo sync -j 2 --force-sync
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   0% (1/774) LineageOS/android_artremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   0% (2/774) LineageOS/androidremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   0% (3/774) LineageOS/android_bionicremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   0% (5/774) platform/build/katiremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   0% (6/774) LineageOS/android_build_blueprintremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching projects:   1% (10/774) platform/developers/build^Caborted by user
```

Here's an example of how I call repo:
```
sh """#!/bin/bash
repo init -u ${REPOSITORY_URL} -b ${params.BRANCH} --depth=1
repo sync -j ${params.SYNC_THREADS} --force-sync
"""
```


So how I can get more information from repo in the Jenkins build console?

Danny.

Baptiste Mathus

unread,
Oct 18, 2020, 10:12:36 AM10/18/20
to Jenkins Developers
Hi,

Please use the users mailing list for such questions.

This list is dedicated to Jenkins development itself. Developing plugins or Jenkins Core itself 

Thank you

Thank you

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/M3FEIQ.X40JKJN2UW843%40gmail.com.
Reply all
Reply to author
Forward
0 new messages