forked from Azure/azure-storage-fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblobfuse2-release-test.yaml
225 lines (200 loc) · 7.46 KB
/
blobfuse2-release-test.yaml
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
variables:
tags: 'fuse3'
depends: 'fuse3'
project: 'BlobFuse'
pipelineId: 95
run_id: 0
patToken: $(System.AccessToken)
status: 'inProgress'
organization: azstorage
parameters:
- name: tag
displayName: 'New Release Tag'
type: string
default: 'blobfuse2-'
- name: unit_test
displayName: 'Execute Unit Tests'
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
# Do not trigger this pipeline automatically
trigger: none
pr: none
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# The SDL Source analysis stage can only run in a windows environment due to limitations of Guardian tools.
# If you use Linux pool, we require an additional windows image in your pool to run the source analysis.
sdl:
sourceAnalysisPool:
name: blobfuse2-pool # Name of your hosted pool
image: windows2022-1espt
os: windows # OS of the image. Allowed values: windows, linux, macOS
stages:
- stage: BuildArtifacts
jobs:
- job: Set_1
timeoutInMinutes: 120
pool:
name: blobfuse2-pool
image: ubuntu22-1espt
os: linux
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/blobfuse2-temp
artifactName: 'blobfuse2-linux-unsigned'
displayName: 'Publish Artifacts'
# Job strategy is not supported in the 1ES pipeline template. Refer https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/faqs#:~:text=Unfortunately%2C%20it%20is%20not%20possible%20to%20use%20job%20strategy%20to%20specify%20pool%20at%20the%20pipeline.
variables:
- group: NightlyBlobfuse
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
- name: work_dir
value: '$(System.DefaultWorkingDirectory)/azure-storage-fuse'
- name: unsigned
value: '$(Build.ArtifactStagingDirectory)/blobfuse2-temp'
steps:
- checkout: none
- script: |
git clone https://github.com/Azure/azure-storage-fuse
displayName: 'Checkout Code'
workingDirectory: $(root_dir)
# list commits from past 12hrs
- script: |
git checkout `echo $(Build.SourceBranch) | cut -d "/" -f 1,2 --complement`
git --no-pager log --since="12 hours ago" --stat
displayName: 'List Commits'
workingDirectory: $(work_dir)
# install dependencies required for compiling blobfuse
- script: |
sudo apt-get update --fix-missing
sudo apt-get install ruby-dev build-essential pkg-config cmake gcc g++ rpm $(fuselib) -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
#TODO:: downgrade to fuse2 glibc version
- script: |
ldd --version
displayName: "GLIBC Version"
- script: |
mkdir -p $(unsigned)/newdir
touch $(unsigned)/newdir/newfile.txt
displayName: "Create directory"
- job: TriggerTestArtifactsPipeline
timeoutInMinutes: 120
# dependsOn: Set_1
# condition: succeeded('Set_1')
pool:
name: blobfuse2-pool
image: ubuntu22-1espt
os: linux
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/blobfuse2
artifactName: 'blobfuse2'
displayName: 'Publish Artifacts'
variables:
- group: NightlyBlobfuse
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'
steps:
- checkout: none
- bash: |
triggered_run=$(az pipelines run --project 'BlobFuse' --id 95 --branch 'main' --organization 'https://dev.azure.com/azstorage/' --query id)
echo $triggered_run
# Check if the output is a number
if [[ $triggered_run =~ ^[0-9]+$ ]]; then
run_id=$triggered_run
else
run_id=$(echo $triggered_run | jq -r '.id')
fi
echo "RUNID"
echo $run_id
echo "##vso[task.setvariable variable=run_id]$run_id"
echo "New runid"
echo $(run_id)
echo "Checking the status of the triggered pipeline..."
while true; do
result=$(az pipelines runs show --organization https://dev.azure.com/$(organization) --project $(project) --id $run_id --query result --output tsv --only-show-errors)
echo "Current status: $result"
if [[ "$result" == "canceled" || "$result" == "failed" ]]; then
echo "Pipeline run $run_id has $result."
exit 1
elif [[ "$result" == "succeeded" ]]; then
echo "Pipeline run $run_id has succeeded."
break
fi
echo "Pipeline run $run_id is still in progress. Checking again in 30 seconds..."
sleep 30
done
displayName: 'Trigger and Check Pipeline Status'
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
- script: |
echo "Pipeline continues"
mkdir -p $(root_dir)/blobfuse2
mkdir -p $(Build.ArtifactStagingDirectory)/blobfuse2
displayName: "Status"
# Download artifacts from a specific pipeline.
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
artifactName: 'blobfuse2'
project: 'BlobFuse'
buildVersionToDownload: 'latest'
targetPath: '$(root_dir)/blobfuse2'
definition: 95
allowFailedBuilds: true
- script: |
ls -l
displayName: 'List Downloaded Package'
workingDirectory: $(root_dir)/blobfuse2
- script: |
mv ./newdirTest $(Build.ArtifactStagingDirectory)/blobfuse2
displayName: "Move Package"
workingDirectory: $(root_dir)/blobfuse2
- job: AccessArtifacts
timeoutInMinutes: 120
pool:
name: blobfuse2-pool
image: ubuntu22-1espt
os: linux
dependsOn: TriggerTestArtifactsPipeline
condition: succeeded('TriggerTestArtifactsPipeline')
steps:
- checkout: none
- script: |
echo "Accessing Artifacts"
ls -l $(Build.ArtifactStagingDirectory)/blobfuse2
displayName: 'Access Artifacts'