[CLOSED][Guide] How-to Automate Your ROM Build Process Using Jenkins - Setup Nightlies

Status
Not open for further replies.
Search This thread
A

AndroidSlave

Guest
I am at work atm.. I will post everything when I have a little more time.. Next week I have much free time to use for setting up everything at all.. But maybe I can post some things like the build script tomorrow after work.
BTW. Big big the for helping me!

EDIT:

This is the rom-build.sj script:

http://pastebin.com/UzFFKqYM

EDIT2:

Now everything is clean.. i fetched my repo stuff and finished syncing.
Job is also clean.. any help for how to do next ?



Kaaaaaaaaatsching... Tapatalked!

I will look in the morning when I get to work. I'll get back to you asap.

Sent from my GT-N7000 using Tapatalk 2
 

dschense

Senior Member
Sep 26, 2009
230
138
Please also post your 'execute shell' Jenkins config section
I want to see a screenshot of that. I think that's where the issue is.
Sent from my GT-N7000 using Tapatalk 2

I put the build script (copy past) into my shell and changed some parameters. Screenshot is coming..

EDIT1:

The script I put inso the jenkins shell:

http://pastebin.com/BKcif2aZ


EDIT2:

The Screenshots


a2u9u3eq.jpg


a2evades.jpg


yry2eba6.jpg


vuru4ema.jpg



I hope this helps you to help me ;)



Kaaaaaaaaatsching.... Tapatalked!
 
Last edited:
A

AndroidSlave

Guest
I put the build script (copy past) into my shell and changed some parameters. Screenshot is coming..

EDIT1:

The script I put inso the jenkins shell:

http://pastebin.com/BKcif2aZ


EDIT2:

The Screenshots


a2u9u3eq.jpg


a2evades.jpg


yry2eba6.jpg


vuru4ema.jpg



I hope this helps you to help me ;)



Kaaaaaaaaatsching.... Tapatalked!

OK, so I'm not sure this will resolve your issue without us working through it a little more, but right off the bat you are doing something fundamentally on disagreement with my guide.
Do not paste the build script in your execute shell section in Jenkins. You just CALL it from Jenkins.

Your execute shell section should ONLY have something like this
Code:
#!/bin/bash
cd ~/var/lib/jenkins/ParanoidAndroidFolder
source rom-build.sh i9300

That's ALL your execute shell section should have. The execute shell section doesn't work properly with full scripts, that's why we care CALLING to your actual shell script from the folder.

Try that and get back to me, but that is STEP 1 to fixing this.

If this doesn't work, its because we can't call the script with the i9300 parameter from Jenkins. To fix that we will have to make another local (not Jenkins) script to call the ROM build script.

I can help you do all this. But first let me know if this gets the build any further.

If not, we will have Jenkins call a local shell script that runs the build script with the i9300 parameter separately

I know this gets complex, but you have to do this type of stuff to get Jenkins to work.

Then once we get all this done we can setup auto upload.


Sent from my GT-N7000 using Tapatalk 2
 
Last edited:

dschense

Senior Member
Sep 26, 2009
230
138
The First Step did not fix the issue.. I took the build script now and changed the parameters inside to i9300.. With this I don't have to rund the script with parameters. Just run the script.. Everything works fine till the end.. But I get the same error every time.. I will post this error when I am back home.

Kaaaaaaaaatsching... Tapatalked!
 
A

AndroidSlave

Guest
The First Step did not fix the issue.. I took the build script now and changed the parameters inside to i9300.. With this I don't have to rund the script with parameters. Just run the script.. Everything works fine till the end.. But I get the same error every time.. I will post this error when I am back home.

Kaaaaaaaaatsching... Tapatalked!

ok...

if its getting hung up on something inside the P.A. script, we may have to copy that last segment of the P.A. script as an additional script, and do a separate execute shell function.

I know this is a pain in the butt, but jenkins is really really really finicky...

especially with something like PA that uses a build script, as opposed to just using "brunch" command

my build scripts are literally 10 lines... the PA script is long so leaves more room for error
 
A

AndroidSlave

Guest
I forgot:
also, is your error at a different place in the process than the original error you were getting before?
 

dschense

Senior Member
Sep 26, 2009
230
138
OK. Post the console log when u can.

Okay mate, this is the log of my last build....

http://www.file-upload.net/download-8168867/log.html

everything seems to be good till the end:

error:

Code:
Running releasetool
/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-eng.jenkins.zip doesn't exist!
make: *** [/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip] Error 1
make: *** Deleting file `/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip'


EDIT:

This is my rom-build.sh --- path: /var/lib/jenkins/pa43-modded/rom-build.sh chmod a+x

http://pastebin.com/tidVD6m0

I changed the path parameters and the default to i9300



EDIT2:

This is the jenkins shell input:

Code:
#!/bin/bash
cd ~/pa43-modded/
source rom-build.sh
 
Last edited:
A

AndroidSlave

Guest
Okay mate, this is the log of my last build....

http://www.file-upload.net/download-8168867/log.html

everything seems to be good till the end:

error:

Code:
Running releasetool
/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-eng.jenkins.zip doesn't exist!
make: *** [/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip] Error 1
make: *** Deleting file `/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip'


EDIT:

This is my rom-build.sh --- path: /var/lib/jenkins/pa43-modded/rom-build.sh chmod a+x

http://pastebin.com/tidVD6m0

I changed the path parameters and the default to i9300



EDIT2:

This is the jenkins shell input:

Code:
#!/bin/bash
cd ~/pa43-modded/
source rom-build.sh

Hey I'll be back in town tomorrow and take a look at this.

Sent from my GT-N7000 using Tapatalk 2
 
A

AndroidSlave

Guest
Okay mate, this is the log of my last build....

http://www.file-upload.net/download-8168867/log.html

everything seems to be good till the end:

error:

Code:
Running releasetool
/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-eng.jenkins.zip doesn't exist!
make: *** [/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip] Error 1
make: *** Deleting file `/var/lib/jenkins/pa43-modded/out/target/product/i9300/pa_i9300-ota-8.zip'


EDIT:

This is my rom-build.sh --- path: /var/lib/jenkins/pa43-modded/rom-build.sh chmod a+x

http://pastebin.com/tidVD6m0

I changed the path parameters and the default to i9300



EDIT2:

This is the jenkins shell input:

Code:
#!/bin/bash
cd ~/pa43-modded/
source rom-build.sh

Is there a particular reason you need to use this script? It doesn't look like it does anything special...
I am wondering why you can't use a shell script to run a brunch i9300
I feel like one of the 'if' may be part of the issue.. Also build dir isn't clean
Its trying to move a file as part of the make script... I am wondering if brunch would avoid that

It looks like its trying to move the ota file but its getting confused because the files during the Jenkins process get put in a DyNamic workspace that is not that path

If we brunch and don't use the makefile it may avoid this

Also is Jenkins set to empty the workspace after every build?
 
Last edited:

dschense

Senior Member
Sep 26, 2009
230
138
Is there a particular reason you need to use this script? It doesn't look like it does anything special...
I am wondering why you can't use a shell script to run a brunch i9300
I feel like one of the 'if' may be part of the issue.. Also build dir isn't clean
Its trying to move a file as part of the make script... I am wondering if brunch would avoid that

It looks like its trying to move the ota file but its getting confused because the files during the Jenkins process get put in a DyNamic workspace that is not that path

If we brunch and don't use the makefile it may avoid this

Also is Jenkins set to empty the workspace after every build?

Okay.. i did nano i9300.sh to working direktoy:


Code:
#!/bin/bash
#cd ~/omnirom/
#make i9300
cd ~/pa43-modded/out/target/product/
rm -rf i9300
cd ~/pa43-modded/
export PATH=~/bin:$PATH
export USE_CCACHE=1
repo sync -j16
source build/envsetup.sh && time brunch i9300

My input for the jenkins shell:

Code:
#!/bin/bash
cd ~/pa43-modded/
source i9300.sh


but after starting job, i get this :

Code:
Building in workspace /var/lib/jenkins/workspace/pa43-modded
[pa43-modded] $ /bin/bash /tmp/hudson3386003669716487767.sh
fatal: duplicate project TheMuppets/proprietary_vendor_samsung in /var/lib/jenkins/pa43-modded/.repo/manifest.xml
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including vendor/pa/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/pa/bash_completion/git.bash
including vendor/pa/bash_completion/repo.bash
[B]i9300.sh: line 10: brunch: command not found[/B]

real	0m0.001s
user	0m0.000s
sys	0m0.000s
Build step 'Execute shell' marked build as failure
Finished: FAILURE
 
A

AndroidSlave

Guest
I think You need to add /vendor/pa/get-prebuilts

A make clobber at the beginning may help too instead of the rm -rf i9300

After your repo sync

Let's see what happens then
 

dschense

Senior Member
Sep 26, 2009
230
138
I think You need to add /vendor/pa/get-prebuilts

A make clobber at the beginning may help too instead of the rm -rf i9300

After your repo sync

Let's see what happens then


MY Log :

http://pastebin.com/7vz3193M

and what i put to the jenkins shell i9300.sh:

Code:
#!/bin/bash
cd ~/pa43/
make clobber
cd ~/pa43/
export PATH=~/bin:$PATH
export USE_CCACHE=1
repo sync
vendor/pa/get-prebuilts
source build/envsetup.sh && time brunch i9300

-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------

EDIT:

I think i know what the error was:

Code:
#!/bin/bash
cd ~/pa43/
make clobber
cd ~/pa43/
export PATH=~/bin:$PATH
export USE_CCACHE=1
#repo sync
source build/envsetup.sh
[B]lunch pa_i9300-userdebug && mka bacon[/B]

I changed brunch i9300 to:

Code:
[B]lunch pa_i9300-userdebug && mka bacon[/B]
 
Last edited:
A

AndroidSlave

Guest
MY Log :

http://pastebin.com/7vz3193M

and what i put to the jenkins shell i9300.sh:

Code:
#!/bin/bash
cd ~/pa43/
make clobber
cd ~/pa43/
export PATH=~/bin:$PATH
export USE_CCACHE=1
repo sync
vendor/pa/get-prebuilts
source build/envsetup.sh && time brunch i9300

-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------

EDIT:

I think i know what the error was:

Code:
#!/bin/bash
cd ~/pa43/
make clobber
cd ~/pa43/
export PATH=~/bin:$PATH
export USE_CCACHE=1
#repo sync
source build/envsetup.sh
[B]lunch pa_i9300-userdebug && mka bacon[/B]

I changed brunch i9300 to:

Code:
[B]lunch pa_i9300-userdebug && mka bacon[/B]

I want some bacon
Did it work? Or still seeing

Sent from my GT-N7000 using Tapatalk 2
 

dschense

Senior Member
Sep 26, 2009
230
138
I want some bacon
Did it work? Or still seeing

Sent from my GT-N7000 using Tapatalk 2


NOOOOO ... :(

still the same Error:

Code:
Running releasetool
/var/lib/jenkins/pa43/out/target/product/i9300/pa_i9300-ota-eng.jenkins.zip doesn't exist!
make: *** [/var/lib/jenkins/pa43/out/target/product/i9300/pa_i9300-ota-24.zip] Error 1
make: *** Deleting file `/var/lib/jenkins/pa43/out/target/product/i9300/pa_i9300-ota-24.zip'
Build step 'Execute shell' marked build as failure
Finished: FAILURE

this was the script i used:

Code:
#!/bin/bash
cd ~/pa43/
make clobber
cd ~/pa43/
export PATH=~/bin:$PATH
export USE_CCACHE=1
#repo sync
source build/envsetup.sh
lunch pa_i9300-userdebug && mka bacon
 

tigger2014

Senior Member
Nov 23, 2012
136
123
London
Im working with dschense, what about if we were to move jenkins working directory which can be specified to where it would normally be on an android build, if thats an option where would it normally be say our sync is all in pa4.3

THanks
 
A

AndroidSlave

Guest
Im working with dschense, what about if we were to move jenkins working directory which can be specified to where it would normally be on an android build, if thats an option where would it normally be say our sync is all in pa4.3

THanks

I'm not sure what's going on with your guys' build. There are some settings to modify the working directory. I have never built PA.

I wish I could give more guidance... I feel like it has to do with that the script tries to move the ota file thinking its in the main directory when its in the working directory
@beerbong can you provide any guidance here?
 
Status
Not open for further replies.

Top Liked Posts