-
Notifications
You must be signed in to change notification settings - Fork 222
/
release-pipeline.yml
2197 lines (1852 loc) · 84.8 KB
/
release-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
variables:
AZCOPY_GOLANG_VERSION: '1.21.8'
parameters:
- name: tag
displayName: 'New Release Tag'
type: string
default: 'v10.'
- name: publish_to_container
displayName: 'Publish To Container'
type: boolean
default: false
- name: publish_to_m1_container
displayName: 'Publish To M1 Container'
type: boolean
default: false
- name: post_release
displayName: 'Post Release on Github'
type: boolean
default: false
- name: publish_artifacts
displayName: 'Publish Artifacts to Linux Repos'
type: boolean
default: false
- name: draft
displayName: 'Post as Draft Release'
type: boolean
default: false
- name: prerelease
displayName: 'Post as PreRelease'
type: boolean
default: false
- name: update_version
displayName: 'Update Version'
type: boolean
default: false
- name: publish_docker_image
displayName: 'Build and Push Docker Image'
type: boolean
default: false
# Do not trigger this pipeline automatically
trigger: none
pr: none
stages:
- stage: BuildArtifacts
jobs:
- job: Set_1
timeoutInMinutes: 120
strategy:
matrix:
Ubuntu_amd64:
imageName: 'ubuntu-20.04'
container: 'test-cnt-ubn-20'
AgentName: "blobfuse-ubuntu20"
pool:
name: "blobfuse-ubuntu-pool"
demands:
- ImageOverride -equals $(agentName)
variables:
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
- name: work_dir
value: '$(Build.SourcesDirectory)'
- name: archives
value: $(root_dir)/archives
steps:
- checkout: self
displayName: 'Checkout repository'
# Custom script to install Go-lang
- task: ShellScript@2
inputs:
scriptPath: "$(work_dir)/go_installer.sh"
args: "$(root_dir)/ $(AZCOPY_GOLANG_VERSION)"
displayName: "Installing Go tools"
- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet - Linux'
workingDirectory: $(root_dir)
# install dependencies required for compiling azcopy
- script: |
sudo apt-get clean
sudo apt-get update --fix-missing
sudo apt-get install pkg-config libsecret-1-dev -y
sudo apt-get install ruby ruby-dev rubygems libglib2.0-dev build-essential rpm -y
sudo gem install dotenv -v 2.8.1
sudo gem install fpm -V
displayName: "Installing Dependencies"
# get glibc version with which build is done
- script: |
ldd --version
displayName: "GLIBC Version"
- script: |
GOARCH=amd64 GOOS=linux go build -tags "netgo" -o "$(root_dir)/azcopy_linux_amd64"
displayName: 'Generate Linux AMD64'
- script: |
GOARCH=amd64 GOOS=linux go build -tags "netgo,se_integration" -o "$(root_dir)/azcopy_linux_se_amd64"
displayName: 'Generate Linux AMD64 SE Integration'
- script: |
sudo ls -lRt $(root_dir)/
cp $(root_dir)/azcopy_linux* $(Build.ArtifactStagingDirectory)
displayName: 'List the binaries and add to staging directory'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-binaries'
displayName: 'Publish binaries'
condition: succeededOrFailed()
- script: |
rm -rf $(Build.ArtifactStagingDirectory)/azcopy*
displayName: "Remove binaries from staging directory"
- template: setup/azcopy_version_check_linux.yml
parameters:
azcopy_executable: $(root_dir)/azcopy_linux_amd64
- script: |
linux_amd64_dir="$(work_dir)/azcopy_linux_amd64_$(azcopy_version)"
echo "##vso[task.setvariable variable=linux_amd64_dir]$linux_amd64_dir"
linux_se_amd64_dir="$(work_dir)/azcopy_linux_se_amd64_$(azcopy_version)"
echo "##vso[task.setvariable variable=linux_se_amd64_dir]$linux_se_amd64_dir"
mkdir -p $linux_amd64_dir
mkdir -p $linux_se_amd64_dir
mkdir -p $(archives)
ls -ltR $(work_dir)
displayName: 'Create required directories'
- script: |
mkdir -p pkgDir/usr/bin/
mv $(root_dir)/azcopy_linux_amd64 $(linux_amd64_dir)/azcopy
mv $(root_dir)/azcopy_linux_se_amd64 $(linux_se_amd64_dir)/azcopy
cp $(linux_amd64_dir)/azcopy pkgDir/usr/bin/
cp NOTICE.txt $(linux_amd64_dir)/
cp NOTICE.txt $(linux_se_amd64_dir)/
cp NOTICE.txt pkgDir/usr/bin/
displayName: 'Copy required files for packaging'
# using fpm tool for packaging of our binary & performing post-install operations
# for additional information about fpm refer https://fpm.readthedocs.io/en/v1.13.1/
- script: |
fpm -s dir -t deb -n azcopy -C pkgDir/ \
-v `./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3` \
--maintainer "Azcopy v-Team <[email protected]>" \
--url "https://github.com/Azure/azure-storage-azcopy" \
--description "A command-line utility that is used to copy data to and from containers and file shares in Azure Storage accounts"
mv ./azcopy*.deb ./azcopy-`./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3`.x86_64.deb
cp ./azcopy*.deb $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Make AMD64 deb Package'
- script: |
fpm -s dir -t rpm -n azcopy --rpm-digest sha256 -C pkgDir/ \
-v `./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3` \
--maintainer "Azcopy v-Team <[email protected]>" \
--url "https://github.com/Azure/azure-storage-azcopy" \
--description "A command-line utility that is used to copy data to and from containers and file shares in Azure Storage accounts"
mv ./azcopy*.rpm ./azcopy-`./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3`.x86_64.rpm
cp ./azcopy*.rpm $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Make AMD64 rpm Package'
- task: ArchiveFiles@2
displayName: 'Archive Partner(SE) Linux Build'
inputs:
rootFolderOrFile: '$(linux_se_amd64_dir)'
archiveType: tar
archiveFile: '$(archives)/azcopy_linux_se_amd64_$(azcopy_version).tar.gz'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive Amd Linux Build'
inputs:
rootFolderOrFile: '$(linux_amd64_dir)'
archiveType: tar
archiveFile: '$(archives)/azcopy_linux_amd64_$(azcopy_version).tar.gz'
continueOnError: true
- script: |
cp -r $(archives)/* $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Add tar.gz to signing stage'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-linux-temp'
displayName: 'Publish Artifacts'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- job: Set_2
timeoutInMinutes: 120
strategy:
matrix:
Ubuntu_arm64:
vmImage: 'ubuntu-20.04'
container: 'test-cnt-ubn-20'
AgentName: 'blobfuse-ubn20-arm64'
pool:
name: "blobfuse-ubn-arm64-pool"
demands:
- ImageOverride -equals $(agentName)
variables:
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
- name: work_dir
value: '$(Build.SourcesDirectory)'
- name: archives
value: $(root_dir)/archives
steps:
- checkout: self
displayName: 'Checkout repository'
# Custom script to install Go-lang
- task: ShellScript@2
inputs:
scriptPath: "$(work_dir)/go_installer.sh"
args: "$(root_dir)/ $(AZCOPY_GOLANG_VERSION)"
displayName: "Installing Go tools"
- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet - Linux'
workingDirectory: $(root_dir)
# install dependencies required for compiling azcopy
- script: |
sudo apt-get clean
sudo apt-get update --fix-missing
sudo apt-get install pkg-config libsecret-1-dev wget -y
sudo apt-get install ruby ruby-dev rubygems libglib2.0-dev build-essential rpm -y
sudo gem install dotenv -v 2.8.1
sudo gem install fpm -V
displayName: "Installing Dependencies"
# get glibc version with which build is done
- script: |
ldd --version
displayName: "GLIBC Version"
- script: |
GOARCH=arm64 GOOS=linux go build -tags "netgo" -o "$(root_dir)/azcopy_linux_arm64"
displayName: 'Generate Linux ARM64'
- script: |
GOARCH=arm64 GOOS=linux go build -tags "netgo,se_integration" -o "$(root_dir)/azcopy_linux_se_arm64"
displayName: 'Generate Linux ARM64 SE Integration'
- script: |
sudo ls -lRt $(root_dir)/
cp -r $(root_dir)/azcopy_linux* $(Build.ArtifactStagingDirectory)
displayName: 'List the binaries and add to staging directory'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-binaries'
displayName: 'Publish binaries'
condition: succeededOrFailed()
- script: |
rm -rf $(Build.ArtifactStagingDirectory)/azcopy*
displayName: "Remove binaries from staging directory"
- template: setup/azcopy_version_check_linux.yml
parameters:
azcopy_executable: $(root_dir)/azcopy_linux_arm64
- script: |
linux_arm64_dir="$(work_dir)/azcopy_linux_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=linux_arm64_dir]$linux_arm64_dir"
linux_se_arm64_dir="$(work_dir)/azcopy_linux_se_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=linux_se_arm64_dir]$linux_se_arm64_dir"
mkdir -p $linux_arm64_dir
mkdir -p $linux_se_arm64_dir
mkdir -p $(archives)
displayName: 'Create required directories'
- script: |
mkdir -p pkgDir/usr/bin/
cp NOTICE.txt pkgDir/usr/bin/
mv $(root_dir)/azcopy_linux_arm64 $(linux_arm64_dir)/azcopy
mv $(root_dir)/azcopy_linux_se_arm64 $(linux_se_arm64_dir)/azcopy
cp $(linux_arm64_dir)/azcopy pkgDir/usr/bin/
cp NOTICE.txt $(linux_arm64_dir)/
cp NOTICE.txt $(linux_se_arm64_dir)/
displayName: 'Copy required files for packaging'
# using fpm tool for packaging of our binary & performing post-install operations
# for additional information about fpm refer https://fpm.readthedocs.io/en/v1.13.1/
- script: |
fpm -s dir -t deb -n azcopy -C pkgDir/ \
-v `./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3` \
--maintainer "Azcopy v-Team <[email protected]>" \
--url "https://github.com/Azure/azure-storage-azcopy" \
--description "A command-line utility that is used to copy data to and from containers and file shares in Azure Storage accounts"
mv ./azcopy*.deb ./azcopy-`./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3`.arm64.deb
cp ./azcopy*.deb $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Make ARM64 deb Package'
- script: |
fpm -s dir -t rpm -n azcopy --rpm-digest sha256 -C pkgDir/ \
-v `./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3` \
--maintainer "Azcopy v-Team <[email protected]>" \
--url "https://github.com/Azure/azure-storage-azcopy" \
--description "A command-line utility that is used to copy data to and from containers and file shares in Azure Storage accounts"
mv ./azcopy*.rpm ./azcopy-`./pkgDir/usr/bin/azcopy --version | cut -d " " -f 3`.arm64.rpm
cp ./azcopy*.rpm $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Make ARM64 rpm Package'
- task: ArchiveFiles@2
displayName: 'Archive Standard Linux Build'
inputs:
rootFolderOrFile: '$(linux_arm64_dir)'
archiveType: tar
archiveFile: '$(archives)/azcopy_linux_arm64_$(azcopy_version).tar.gz'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive Partner(SE) Linux Build'
inputs:
rootFolderOrFile: '$(linux_se_arm64_dir)'
archiveType: tar
archiveFile: '$(archives)/azcopy_linux_se_arm64_$(azcopy_version).tar.gz'
continueOnError: true
- script: |
cp -r $(archives)/* $(Build.ArtifactStagingDirectory)
workingDirectory: $(root_dir)
displayName: 'Add tar.gz to staging directory'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-linux-temp'
displayName: 'Publish Artifacts'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- job: Set_3
timeoutInMinutes: 120
strategy:
matrix:
Windows:
imageName: 'windows-2019'
type: 'windows'
pool:
vmImage: $(imageName)
variables:
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
steps:
- task: GoTool@0
env:
GO111MODULE: 'on'
inputs:
version: $(AZCOPY_GOLANG_VERSION)
- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet - Windows'
workingDirectory: $(root_dir)
- script: |
go build -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_amd64.exe"
displayName: 'Generate Windows AMD64'
env:
GOARCH: amd64
GOOS: windows
CGO_ENABLED: 0
- script: |
go build -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_386.exe"
displayName: 'Generate Windows i386'
env:
GOARCH: 386
GOOS: windows
CGO_ENABLED: 0
- script: |
go build -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_v7_arm.exe"
displayName: 'Generate Windows ARM'
env:
GOARCH: arm
GOARM: 7
GOOS: windows
CGO_ENABLED: 0
- script: |
go build -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_arm64.exe"
displayName: 'Generate Windows ARM'
env:
GOARCH: arm64
GOOS: windows
CGO_ENABLED: 0
- script: |
go build -tags "se_integration" -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_se_arm64.exe"
displayName: 'Generate Windows ARM'
env:
GOARCH: arm64
GOOS: windows
CGO_ENABLED: 0
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-windows-temp'
displayName: 'Publish Artifacts'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- job: Set_4
timeoutInMinutes: 360
strategy:
matrix:
MacOS:
imageName: 'macos-latest'
type: 'mac-os'
pool:
vmImage: $(imageName)
variables:
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
- name: work_dir
value: '$(System.DefaultWorkingDirectory)/azure-storage-azcopy'
- name: archives
value: $(root_dir)/archives
steps:
- task: GoTool@0
env:
GO111MODULE: 'on'
inputs:
version: $(AZCOPY_GOLANG_VERSION)
- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet - Mac'
workingDirectory: $(System.DefaultWorkingDirectory)
- script: |
CGO_ENABLED=1 go build -o "$(root_dir)/azcopy_darwin_amd64"
displayName: 'Generate MacOS Build with AMD64'
- script: |
GOARCH=arm64 CGO_ENABLED=1 go build -o "$(root_dir)/azcopy_darwin_arm64"
displayName: 'Test Cross-compiled MacOS Build with ARM64'
- task: Bash@3
displayName: 'Extract AZCopy version'
inputs:
targetType: 'inline'
script: |
azcopy_version=$($(root_dir)/azcopy_darwin_amd64 --version | awk '{print $3}' | cut -d'-' -f1)
echo "##vso[task.setvariable variable=azcopy_version]$azcopy_version"
- script: |
darwin_amd_dir="$(work_dir)/azcopy_darwin_amd64_$(azcopy_version)"
echo "##vso[task.setvariable variable=darwin_amd_dir]$darwin_amd_dir"
darwin_arm_dir="$(work_dir)/azcopy_darwin_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=darwin_arm_dir]$darwin_arm_dir"
mkdir -p $darwin_amd_dir
mkdir -p $darwin_arm_dir
mkdir -p $(archives)
displayName: 'Create required directories'
- script: |
cp NOTICE.txt $(darwin_amd_dir)
cp NOTICE.txt $(darwin_arm_dir)
mv $(root_dir)/azcopy_darwin_amd64 $(darwin_amd_dir)/azcopy
mv $(root_dir)/azcopy_darwin_arm64 $(darwin_arm_dir)/azcopy
displayName: 'Copy required files for packaging'
- task: ArchiveFiles@2
displayName: 'Archive MacOS AMD64 Build (must happen before signing/notarization)'
inputs:
rootFolderOrFile: '$(darwin_amd_dir)'
archiveFile: '$(archives)/azcopy_darwin_amd64_$(azcopy_version).zip'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive MacOS ARM64 Build (must happen before signing/notarization)'
inputs:
rootFolderOrFile: '$(darwin_arm_dir)'
archiveFile: '$(archives)/azcopy_darwin_arm64_$(azcopy_version).zip'
continueOnError: true
- script: |
cp $(archives)/azcopy_darwin* $(Build.ArtifactStagingDirectory)
displayName: 'Copy zip to staging directory'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-mac-temp'
displayName: 'Publish Artifacts'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- job: Set_5
timeoutInMinutes: 360
strategy:
matrix:
MacOS-14-ARM64:
imageName: 'ubuntu-latest'
type: 'linux'
pool:
vmImage: $(imageName)
variables:
- group: AZCOPY_TESTS_VAR
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
- name: work_dir
value: '$(Build.SourcesDirectory)'
- name: archives
value: $(root_dir)/archives
- name: Publish_To_M1_Container
value: ${{ parameters.publish_to_m1_container }}
steps:
- task: GoTool@0
env:
GO111MODULE: 'on'
inputs:
version: $(AZCOPY_GOLANG_VERSION)
- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet'
workingDirectory: $(System.DefaultWorkingDirectory)
- script: |
CGO_ENABLED=1 go build -o "$(root_dir)/azcopy"
displayName: 'Generate build'
- template: setup/azcopy_version_check_linux.yml
parameters:
azcopy_executable: $(root_dir)/azcopy
- template: setup/trigger_m1_build.yml
- script: |
mkdir -p $(archives)
darwin_arm64_m1_dir="$(work_dir)/azcopy_darwin_m1_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=darwin_arm64_m1_dir]$darwin_arm64_m1_dir"
mkdir -p $darwin_arm64_m1_dir
cp NOTICE.txt $darwin_arm64_m1_dir
cp $(Build.ArtifactStagingDirectory)/azcopy $darwin_arm64_m1_dir
displayName: 'Copy required files for packaging'
- task: ArchiveFiles@2
displayName: 'Archive MacOS M1_ARM64 Build (must happen before signing/notarization)'
inputs:
rootFolderOrFile: '$(darwin_arm64_m1_dir)'
archiveFile: '$(archives)/azcopy_darwin_m1_arm64_$(azcopy_version).zip'
continueOnError: true
- script: |
rm -rf $(Build.ArtifactStagingDirectory)/azcopy
cp $(archives)/azcopy_darwin* $(Build.ArtifactStagingDirectory)
displayName: 'Copy zip to staging directory'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-mac-temp'
displayName: 'Publish Artifacts'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
# BuildArtifacts end here
- stage: SignArtifacts
dependsOn: BuildArtifacts
condition: succeeded('BuildArtifacts')
jobs:
- job: Set_1
timeoutInMinutes: 120
strategy:
matrix:
Linux-Signing:
vmImage: 'Ubuntu-20.04'
AgentName: "blobfuse-ubuntu20"
pool:
name: "blobfuse-ubuntu-pool"
demands:
- ImageOverride -equals $(AgentName)
variables:
- group: AZCOPY_SECRET_VAULT
steps:
- checkout: none
- script: |
echo ${{ parameters.tag }}
displayName: 'Tag Name'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: 'azCopy-linux-temp'
downloadPath: $(Build.ArtifactStagingDirectory)
- script: |
rm -rf azcopy_linux*
sudo ls -lRt azCopy-linux-temp
md5sum azCopy-linux-temp/*
displayName: 'List Artifacts'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
- script: |
mkdir mariner && chmod 755 mariner
cp azCopy-linux-temp/*arm64.rpm mariner
cp azCopy-linux-temp/*x86_64.rpm mariner
sudo ls -lRt mariner
md5sum mariner/*
displayName: 'Copy artifacts for Mariner'
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: |
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -f --fix-missing
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https -y
sudo apt install dotnet-sdk-3.1 -y
displayName: "Update dependencies"
- template: setup/esrp_sign_linux.yml
parameters:
FolderPath: $(Build.ArtifactStagingDirectory)/azCopy-linux-temp
ESRP_AZCOPY_KEY_CODE: $(ESRP_AZCOPY_KEY_CODE)
Pattern: '*.rpm, *.deb'
DisplayName: 'ESRP CodeSigning azCopy linux'
- template: setup/esrp_sign_linux.yml
parameters:
FolderPath: $(Build.ArtifactStagingDirectory)/mariner
ESRP_AZCOPY_KEY_CODE: $(ESRP_AZCOPY_MARINER_KEY_CODE)
Pattern: '*.rpm, *.deb'
DisplayName: 'ESRP CodeSigning azCopy mariner'
# Validate signed images have md5sum changed
- script: |
chmod 755 $(Build.ArtifactStagingDirectory)/azCopy-linux-temp/*
chmod 755 $(Build.ArtifactStagingDirectory)/mariner/*
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-linux-temp/*.md
rm -rf $(Build.ArtifactStagingDirectory)/mariner/*.md
mv $(Build.ArtifactStagingDirectory)/azCopy-linux-temp/* $(Build.ArtifactStagingDirectory)/
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-linux-temp
displayName: 'Make Artifacts executable'
- script: |
sudo ls -lRt $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/*
md5sum $(Build.ArtifactStagingDirectory)/mariner/*
displayName: 'List Signed Artifacts'
# Push signed images to artifact directory
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-linux-signed'
displayName: 'Publish Signed Artifacts'
- job: Set_2
timeoutInMinutes: 120
strategy:
matrix:
Windows-Signing:
vmImage: 'Ubuntu-20.04'
AgentName: "blobfuse-ubuntu20"
pool:
name: "blobfuse-ubuntu-pool"
demands:
- ImageOverride -equals $(AgentName)
variables:
- group: AZCOPY_SECRET_VAULT
- name: work_dir
value: '$(System.DefaultWorkingDirectory)/azure-storage-azcopy'
- name: archives
value: '$(work_dir)/archives'
steps:
- script: |
echo ${{ parameters.tag }}
displayName: 'Tag Name'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: 'azCopy-windows-temp'
downloadPath: $(Build.ArtifactStagingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download linux binary for extracting version'
inputs:
artifactName: 'azCopy-binaries'
downloadPath: $(work_dir)/
itemPattern: 'azCopy-binaries/azcopy_linux_amd64'
- script: |
sudo ls -lRt $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/*
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/*.md
displayName: 'List Artifacts'
- script: |
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -f --fix-missing
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https -y
sudo apt install dotnet-sdk-6.0 -y
sudo apt-get install -y zip
displayName: "Update dependencies"
- template: setup/esrp_sign_windows.yml
parameters:
FolderPath: $(Build.ArtifactStagingDirectory)/azCopy-windows-temp
ESRP_AZCOPY_WIN_KEY_CODE: $(ESRP_AZCOPY_WIN_KEY_CODE)
Pattern: 'azcopy_windows*'
- script: |
rm -rf azCopy-windows-temp/*.md
cp azCopy-windows-temp/* .
mv azCopy-windows-temp $(work_dir)
displayName: 'Add signed windows binary to staging directory'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
# Push signed images to artifact directory
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-binaries'
displayName: 'Publish Signed Artifacts'
# Validate signed images have md5sum changed
- script: |
rm -rf $(Build.ArtifactStagingDirectory)/*
mv $(work_dir)/azCopy-windows-temp .
rm -rf azCopy-windows-temp/azcopy_windows_v7_arm.exe
chmod 755 azCopy-windows-temp/*
rm -rf azCopy-windows-temp/*.md
displayName: 'Make Artifacts executable'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
- script: |
chmod 755 $(work_dir)/azCopy-binaries/azcopy_linux_amd64
# Run azcopy --version and capture the output
azcopyOutput=$($(work_dir)/azCopy-binaries/azcopy_linux_amd64 --version)
if echo "$azcopyOutput" | grep -q "azcopy version"; then
version=$(echo "$azcopyOutput" | sed -n 's/^azcopy version \([0-9]*\.[0-9]*\.[0-9]*[^ ]*\).*/\1/p')
if [[ -n "$version" ]]; then
echo "Extracted version: $version"
echo "##vso[task.setvariable variable=azcopy_version]$version"
fi
fi
displayName: 'Extract the generated build version'
- script: |
windows_amd64="$(work_dir)/azcopy_windows_amd64_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_amd64]$windows_amd64"
windows_arm64="$(work_dir)/azcopy_windows_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_arm64]$windows_arm64"
windows_se_arm64="$(work_dir)/azcopy_windows_se_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_se_arm64]$windows_se_arm64"
windows_386="$(work_dir)/azcopy_windows_386_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_386]$windows_386"
mkdir -p $windows_amd64
mkdir -p $windows_arm64
mkdir -p $windows_se_arm64
mkdir -p $windows_386
mkdir -p $(archives)
displayName: 'Create required directories'
- script: |
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_amd64.exe $(windows_amd64)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_arm64.exe $(windows_arm64)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_386.exe $(windows_386)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_se_arm64.exe $(windows_se_arm64)/azcopy.exe
cp NOTICE.txt $(windows_amd64)
cp NOTICE.txt $(windows_arm64)
cp NOTICE.txt $(windows_386)
cp NOTICE.txt $(windows_se_arm64)
zip -r $(archives)/azcopy_windows_amd64_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_arm64_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_386_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_se_arm64_$(azcopy_version).zip .
displayName: 'Copy required files'
- task: ArchiveFiles@2
displayName: 'Archive Windows 64 bit AMD Build'
inputs:
rootFolderOrFile: '$(windows_amd64)'
archiveFile: '$(archives)/azcopy_windows_amd64_$(azcopy_version).zip'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive Windows 64 bit ARM Build'
inputs:
rootFolderOrFile: '$(windows_arm64)'
archiveFile: '$(archives)/azcopy_windows_arm64_$(azcopy_version).zip'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive Windows 32 bit Build'
inputs:
rootFolderOrFile: '$(windows_386)'
archiveFile: '$(archives)/azcopy_windows_386_$(azcopy_version).zip'
continueOnError: true
- task: ArchiveFiles@2
displayName: 'Archive Windows SE 64 bit ARM Build'
inputs:
rootFolderOrFile: '$(windows_se_arm64)'
archiveFile: '$(archives)/azcopy_windows_se_arm64_$(azcopy_version).zip'
continueOnError: true
- script: |
cp $(archives)/azcopy_windows* $(Build.ArtifactStagingDirectory)
displayName: 'Copy zip to staging directory'
- script: |
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-windows-temp
sudo ls -lRt $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/*
rm -rf $(Build.ArtifactStagingDirectory)/*.md
displayName: 'List Signed Artifacts'
# Push signed images to artifact directory
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-windows-signed'
displayName: 'Publish Signed Artifacts'
- job: Set_3
timeoutInMinutes: 120
strategy:
matrix:
Mac-Signing:
vmImage: 'Ubuntu-20.04'
AgentName: "blobfuse-ubuntu20"
pool:
name: "blobfuse-ubuntu-pool"
demands:
- ImageOverride -equals $(AgentName)
variables:
- group: AZCOPY_SECRET_VAULT
steps:
- checkout: none
- script: |
echo ${{ parameters.tag }}
displayName: 'Tag Name'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: 'azCopy-mac-temp'
downloadPath: $(Build.ArtifactStagingDirectory)
- script: |
sudo ls -lRt $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/azCopy-mac-temp/*
displayName: 'List Artifacts'
- script: |
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install unzip -y
sudo apt-get install -f --fix-missing
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt install apt-transport-https -y
sudo apt install dotnet-sdk-6.0 -y
displayName: "Update dependencies"
- template: setup/esrp_sign_notarize_macos.yml
parameters:
FolderPath: $(Build.ArtifactStagingDirectory)/azCopy-mac-temp
ESRP_AZCOPY_MAC_KEY_CODE: $(ESRP_AZCOPY_MAC_KEY_CODE)
Pattern: '*.zip'
# Validate signed images have md5sum changed
- script: |
chmod 755 $(Build.ArtifactStagingDirectory)/azCopy-mac-temp/*
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-mac-temp/*.md
mv $(Build.ArtifactStagingDirectory)/azCopy-mac-temp/* $(Build.ArtifactStagingDirectory)/
rm -rf $(Build.ArtifactStagingDirectory)/azCopy-mac-temp/
displayName: 'Make Artifacts executable'
- script: |
sudo ls -lRt $(Build.ArtifactStagingDirectory)
md5sum $(Build.ArtifactStagingDirectory)/*
displayName: 'List Signed Artifacts'
# Push signed images to artifact directory
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-mac-signed'
displayName: 'Publish Signed Artifacts'
- script: |
mkdir -p unzipped_amd64
mkdir -p unzipped_arm64
mkdir -p unzipped_m1_arm64
unzip -o azcopy*amd64*.zip -d unzipped_amd64
unzip -o azcopy_darwin_arm64*.zip -d unzipped_arm64
unzip -o azcopy_darwin_m1_arm64*.zip -d unzipped_m1_arm64
# Use find to retrieve the folder name
amd64FolderName=$(find unzipped_amd64 -maxdepth 1 -type d -name "azcopy_darwin_amd64*")
echo "AMD64 Folder name: $amd64FolderName"
arm64FolderName=$(find unzipped_arm64 -maxdepth 1 -type d -name "azcopy_darwin_arm64*")
echo "ARM64 Folder name: $arm64FolderName"
m1Arm64FolderName=$(find unzipped_m1_arm64 -maxdepth 1 -type d -name "azcopy_darwin_m1_arm64*")
echo "ARM64 M1 Folder name: $m1Arm64FolderName"
# Check if there is exactly one matching directory for amd64
if [ $(echo "$amd64FolderName" | wc -l) -eq 1 ]; then
echo "Found matching AMD64 directory: $amd64FolderName"
cd "$amd64FolderName"
mv azcopy $(Build.ArtifactStagingDirectory)/azcopy_darwin_amd64
else