mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	jenkins-setup-build-environment: auto-detect RAM/CPU specs
This lets this setup run on more basic hardware, like schweiger/vibi.
This commit is contained in:
		
							parent
							
								
									499d65f292
								
							
						
					
					
						commit
						1f363a889d
					
				
					 1 changed files with 15 additions and 3 deletions
				
			
		| 
						 | 
					@ -55,15 +55,27 @@ mkdir $VAGRANT_HOME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -rf "$WORKSPACE"/../*/.testfiles
 | 
					rm -rf "$WORKSPACE"/../*/.testfiles
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd $WORKSPACE
 | 
					memtotal=$(grep ^MemTotal: /proc/meminfo | awk '{print $2}')
 | 
				
			||||||
 | 
					if [ $memtotal -gt 8092876 ]; then
 | 
				
			||||||
 | 
					    memory=8192
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    memory=$(((memtotal / 1024) - 1024))
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ `nproc` -le 6 ]; then
 | 
				
			||||||
 | 
					    cpus=$((`nproc` - 1))
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    cpus=6
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
cat <<EOF > $WORKSPACE/makebuildserver.config.py
 | 
					cat <<EOF > $WORKSPACE/makebuildserver.config.py
 | 
				
			||||||
debian_mirror = 'http://deb.debian.org/debian/'
 | 
					debian_mirror = 'http://deb.debian.org/debian/'
 | 
				
			||||||
boot_timeout = 1200
 | 
					boot_timeout = 1200
 | 
				
			||||||
apt_package_cache = True
 | 
					apt_package_cache = True
 | 
				
			||||||
copy_caches_from_host = True
 | 
					copy_caches_from_host = True
 | 
				
			||||||
memory = 8192
 | 
					memory = $memory
 | 
				
			||||||
cpus = 6
 | 
					cpus = $cpus
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cd $WORKSPACE
 | 
				
			||||||
./makebuildserver -vv --clean
 | 
					./makebuildserver -vv --clean
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "`vagrant box list | egrep '^buildserver\s+\((libvirt|virtualbox), [0-9]+\)$'`" ]; then
 | 
					if [ -z "`vagrant box list | egrep '^buildserver\s+\((libvirt|virtualbox), [0-9]+\)$'`" ]; then
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue