mirror of https://github.com/icedream/icecon.git
				
				
				
			Jenkinsfile: Don't attempt to download UPX if it will be skipped.
							parent
							
								
									48f1ab5f16
								
							
						
					
					
						commit
						508b5d461e
					
				|  | @ -9,26 +9,26 @@ def binext(os) { | ||||||
| 
 | 
 | ||||||
| def upx(file) { | def upx(file) { | ||||||
|   // Install upx |   // Install upx | ||||||
|   withEnv(["PATH+=${tool "UPX v3.91"}"]) { |   switch("${env.GOOS}.${env.GOARCH}") { | ||||||
|     switch("${env.GOOS}.${env.GOARCH}") { |     case "linux.amd64": | ||||||
|       case "linux.amd64": |     case "linux.386": | ||||||
|       case "linux.386": |     case "darwin.amd64": | ||||||
|       case "darwin.amd64": |     case "darwin.arm": | ||||||
|       case "darwin.arm": |     case "windows.amd64": | ||||||
|       case "windows.amd64": |     case "windows.386": | ||||||
|       case "windows.386": |     case "freebsd.386": | ||||||
|       case "freebsd.386": |     case "netbsd.386": | ||||||
|       case "netbsd.386": |       withEnv(["PATH+=${tool "UPX v3.91"}"]) { | ||||||
|         if (env.GOOS == "linux") { |         if (env.GOOS == "linux") { | ||||||
|           sh "GOOS= GOARCH= go get -v github.com/pwaller/goupx" |           sh "GOOS= GOARCH= go get -v github.com/pwaller/goupx" | ||||||
|           sh "goupx --no-upx \"$file\"" |           sh "goupx --no-upx \"$file\"" | ||||||
|         } |         } | ||||||
|         sh "upx --best --ultra-brute \"$file\"" |         sh "upx --best --ultra-brute \"$file\"" | ||||||
|         break |       } | ||||||
|       default: |       break | ||||||
|         echo "Skipping UPX compression as it is not supported for $goos/$goarch." |     default: | ||||||
|         break |       echo "Skipping UPX compression as it is not supported for $goos/$goarch." | ||||||
|     } |       break | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue