@@ -9,6 +9,18 @@ def getStandAloneStorageServers(){
9
9
}
10
10
}
11
11
12
+ def createChocolateyConfigFile (configJsonFile , installerPackage , url ){
13
+ def deployJsonMetadata = [
14
+ " PackageVersion" : readTOML( file : ' pyproject.toml' )[' project' ]. version,
15
+ " DownloadUrl" : url,
16
+ " PackageFile" : installerPackage. name,
17
+ " Sha256" : sha256(installerPackage. path),
18
+ " TabCompletionPowershellModule" : " ${ installerPackage.name.take(installerPackage.name.lastIndexOf('.'))} \\ extras\\ cli_completion\\ powershell\\ GalateaArgumentCompleter.psm1"
19
+
20
+ ]
21
+ writeJSON( json : deployJsonMetadata, file : configJsonFile, pretty : 2 )
22
+ }
23
+
12
24
def deployStandalone (glob , url ) {
13
25
script{
14
26
findFiles(glob : glob). each{
@@ -25,6 +37,20 @@ def deployStandalone(glob, url) {
25
37
}
26
38
}
27
39
40
+ def deploySingleStandalone (file , url , authentication ) {
41
+ script{
42
+ try {
43
+ def encodedUrlFileName = new URI (null , null , file. name, null ). toASCIIString()
44
+ def newUrl = " ${ url} /${ encodedUrlFileName} "
45
+ def putResponse = httpRequest authentication : authentication, httpMode : ' PUT' , uploadFile : file. path, url : " ${ newUrl} " , wrapAsMultipart : false
46
+ return newUrl
47
+ } catch (Exception e){
48
+ echo " ${ e} "
49
+ throw e;
50
+ }
51
+ }
52
+ }
53
+
28
54
def getToxEnvs (){
29
55
node(' docker && windows' ){
30
56
docker. image(' python' ). inside(" --mount type=volume,source=uv_python_install_dir,target=${ env.UV_PYTHON_INSTALL_DIR} " ){
@@ -74,7 +100,6 @@ def call(){
74
100
]
75
101
)
76
102
)
77
- standaloneVersions = []
78
103
pipeline {
79
104
agent none
80
105
parameters{
@@ -656,9 +681,6 @@ def call(){
656
681
success{
657
682
archiveArtifacts artifacts : ' dist/*.tar.gz' , fingerprint : true
658
683
stash includes : ' dist/*.tar.gz' , name : ' APPLE_APPLICATION_X86_64'
659
- script{
660
- standaloneVersions << ' APPLE_APPLICATION_X86_64'
661
- }
662
684
}
663
685
cleanup{
664
686
cleanWs(patterns : [
@@ -710,9 +732,6 @@ def call(){
710
732
success{
711
733
archiveArtifacts artifacts : ' dist/*.tar.gz' , fingerprint : true
712
734
stash includes : ' dist/*.tar.gz' , name : ' APPLE_APPLICATION_ARM64'
713
- script{
714
- standaloneVersions << ' APPLE_APPLICATION_ARM64'
715
- }
716
735
}
717
736
cleanup{
718
737
cleanWs(patterns : [
@@ -767,15 +786,10 @@ def call(){
767
786
tee(' reports/windows_cpack.log' ){
768
787
bat(script : ' contrib/create_windows_distrib.bat' )
769
788
}
789
+ archiveArtifacts artifacts : ' dist/*.zip' , fingerprint : true
790
+ stash includes : ' dist/*.zip' , name : ' WINDOWS_APPLICATION_X86_64'
770
791
}
771
792
post{
772
- success{
773
- archiveArtifacts artifacts : ' dist/*.zip' , fingerprint : true
774
- stash includes : ' dist/*.zip' , name : ' WINDOWS_APPLICATION_X86_64'
775
- script{
776
- standaloneVersions << ' WINDOWS_APPLICATION_X86_64'
777
- }
778
- }
779
793
always{
780
794
recordIssues(
781
795
sourceCodeRetention : ' LAST_BUILD' ,
@@ -854,15 +868,60 @@ def call(){
854
868
string defaultValue : " galatea/${ get_version()} " , description : ' subdirectory to store artifact' , name : ' archiveFolder'
855
869
}
856
870
}
857
- stages {
858
- stage(' Deploy Standalone Applications' ){
871
+ parallel {
872
+ stage(' Deploy Standalone Applications: Windows x86_64 ' ){
859
873
agent any
874
+ when{
875
+ equals expected : true , actual : params. PACKAGE_STANDALONE_WINDOWS_INSTALLER
876
+ beforeAgent true
877
+ }
878
+ environment{
879
+ GENERATED_CHOCOLATEY_CONFIG_FILE = ' dist/chocolatey/config.json'
880
+ }
860
881
steps{
861
882
script{
862
- standaloneVersions. each{
863
- unstash " ${ it} "
864
- }
865
- deployStandalone(' dist/*.zip' , " ${ SERVER_URL} /${ archiveFolder} " )
883
+ unstash ' WINDOWS_APPLICATION_X86_64'
884
+ def deploymentFile = findFiles(glob : ' dist/*.zip' )[0 ]
885
+ def deployedUrl = deploySingleStandalone(deploymentFile, " ${ SERVER_URL} /${ archiveFolder} " , NEXUS_CREDS )
886
+ createChocolateyConfigFile(env. GENERATED_CHOCOLATEY_CONFIG_FILE , deploymentFile, deployedUrl)
887
+ archiveArtifacts artifacts : env. GENERATED_CHOCOLATEY_CONFIG_FILE
888
+ echo " Deployed ${ deploymentFile} to ${ deployedUrl} -> SHA256: ${ sha256(deploymentFile.path)} "
889
+ }
890
+ }
891
+ post{
892
+ success{
893
+ echo " Use ${ env.GENERATED_CHOCOLATEY_CONFIG_FILE} for deploying to Chocolatey with https://github.com/UIUCLibrary/chocolatey-hosted-public.git. Found in the artifacts for this build."
894
+ echo " ${ readFile(env.GENERATED_CHOCOLATEY_CONFIG_FILE)} "
895
+ }
896
+ }
897
+ }
898
+ stage(' Deploy Standalone Applications: MacOS ARM64' ){
899
+ agent any
900
+ when{
901
+ equals expected : true , actual : params. PACKAGE_MAC_OS_STANDALONE_ARM64
902
+ beforeAgent true
903
+ }
904
+ steps{
905
+ script{
906
+ unstash ' APPLE_APPLICATION_ARM64'
907
+ def deploymentFile = findFiles(glob : ' dist/*.tar.gz' )[0 ]
908
+ def deployedUrl = deploySingleStandalone(deploymentFile, " ${ SERVER_URL} /${ archiveFolder} " , NEXUS_CREDS )
909
+ echo " Deployed ${ deploymentFile} to ${ deployedUrl} -> SHA256: ${ sha256(deploymentFile.path)} "
910
+ }
911
+ }
912
+ }
913
+ stage(' Deploy Standalone Applications: MacOS X86_64' ){
914
+ agent any
915
+ when{
916
+ equals expected : true , actual : params. PACKAGE_MAC_OS_STANDALONE_X86_64
917
+ beforeAgent true
918
+ }
919
+ steps{
920
+ script{
921
+ unstash ' APPLE_APPLICATION_X86_64'
922
+ def deploymentFile = findFiles(glob : ' dist/*.tar.gz' )[0 ]
923
+ def deployedUrl = deploySingleStandalone(deploymentFile, " ${ SERVER_URL} /${ archiveFolder} " , NEXUS_CREDS )
924
+ echo " Deployed ${ deploymentFile} to ${ deployedUrl} -> SHA256: ${ sha256(deploymentFile.path)} "
866
925
}
867
926
}
868
927
}
0 commit comments