|
| 1 | +pipeline: |
| 2 | + projectIdentifier: Drone_Plugins |
| 3 | + orgIdentifier: default |
| 4 | + tags: {} |
| 5 | + properties: |
| 6 | + ci: |
| 7 | + codebase: |
| 8 | + connectorRef: GitHub_Drone_Plugins_Org |
| 9 | + repoName: drone-sftp |
| 10 | + build: <+input> |
| 11 | + sparseCheckout: [] |
| 12 | + stages: |
| 13 | + - stage: |
| 14 | + name: Test |
| 15 | + identifier: Test |
| 16 | + description: "" |
| 17 | + type: CI |
| 18 | + spec: |
| 19 | + cloneCodebase: true |
| 20 | + caching: |
| 21 | + enabled: false |
| 22 | + paths: [] |
| 23 | + platform: |
| 24 | + os: Linux |
| 25 | + arch: Amd64 |
| 26 | + runtime: |
| 27 | + type: Cloud |
| 28 | + spec: {} |
| 29 | + execution: |
| 30 | + steps: |
| 31 | + - step: |
| 32 | + type: Run |
| 33 | + name: Lint |
| 34 | + identifier: Lint |
| 35 | + spec: |
| 36 | + connectorRef: Plugins_Docker_Hub_Connector |
| 37 | + image: golang:1.21 |
| 38 | + shell: Sh |
| 39 | + command: |- |
| 40 | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
| 41 | + golangci-lint version |
| 42 | + golangci-lint run |
| 43 | + - step: |
| 44 | + type: Run |
| 45 | + name: Testing |
| 46 | + identifier: Testing |
| 47 | + spec: |
| 48 | + connectorRef: Plugins_Docker_Hub_Connector |
| 49 | + image: golang:1.21 |
| 50 | + shell: Sh |
| 51 | + command: go test -cover ./... |
| 52 | + - parallel: |
| 53 | + - stage: |
| 54 | + name: linux-amd64 |
| 55 | + identifier: linuxamd64 |
| 56 | + description: "" |
| 57 | + type: CI |
| 58 | + spec: |
| 59 | + cloneCodebase: true |
| 60 | + caching: |
| 61 | + enabled: false |
| 62 | + paths: [] |
| 63 | + platform: |
| 64 | + os: Linux |
| 65 | + arch: Amd64 |
| 66 | + runtime: |
| 67 | + type: Cloud |
| 68 | + spec: {} |
| 69 | + execution: |
| 70 | + steps: |
| 71 | + - step: |
| 72 | + type: Run |
| 73 | + name: Build Binary |
| 74 | + identifier: Run_1 |
| 75 | + spec: |
| 76 | + connectorRef: Plugins_Docker_Hub_Connector |
| 77 | + image: golang:1.21 |
| 78 | + shell: Sh |
| 79 | + command: |- |
| 80 | + # force go modules |
| 81 | + export GOPATH="" |
| 82 | +
|
| 83 | + # disable cgo |
| 84 | + export CGO_ENABLED=0 |
| 85 | +
|
| 86 | + set -e |
| 87 | + set -x |
| 88 | +
|
| 89 | + # linux |
| 90 | + export GOOS=linux GOARCH=amd64 |
| 91 | +
|
| 92 | + go build -v -a -tags netgo -o release/linux/amd64/drone-sftp . |
| 93 | + - step: |
| 94 | + type: Plugin |
| 95 | + name: Build and Push on Tag |
| 96 | + identifier: Plugin_1 |
| 97 | + spec: |
| 98 | + connectorRef: Plugins_Docker_Hub_Connector |
| 99 | + image: plugins/docker |
| 100 | + settings: |
| 101 | + username: drone |
| 102 | + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> |
| 103 | + repo: plugins/sftp |
| 104 | + dockerfile: docker/Dockerfile.linux.amd64 |
| 105 | + auto_tag: "true" |
| 106 | + auto_tag_suffix: linux-amd64 |
| 107 | + when: |
| 108 | + stageStatus: Success |
| 109 | + condition: <+codebase.build.type> == "tag" |
| 110 | + - step: |
| 111 | + type: BuildAndPushDockerRegistry |
| 112 | + name: Build And Push on Branch |
| 113 | + identifier: BuildAndPushDockerRegistry_1 |
| 114 | + spec: |
| 115 | + connectorRef: Plugins_Docker_Hub_Connector |
| 116 | + repo: plugins/sftp |
| 117 | + tags: |
| 118 | + - linux-amd64 |
| 119 | + caching: false |
| 120 | + dockerfile: docker/Dockerfile.linux.amd64 |
| 121 | + when: |
| 122 | + stageStatus: Success |
| 123 | + condition: | |
| 124 | + <+codebase.build.type> == "branch" |
| 125 | + - stage: |
| 126 | + identifier: linarm64 |
| 127 | + type: CI |
| 128 | + name: linux-arm64 |
| 129 | + description: "" |
| 130 | + spec: |
| 131 | + cloneCodebase: true |
| 132 | + caching: |
| 133 | + enabled: false |
| 134 | + paths: [] |
| 135 | + platform: |
| 136 | + os: Linux |
| 137 | + arch: Arm64 |
| 138 | + runtime: |
| 139 | + type: Cloud |
| 140 | + spec: {} |
| 141 | + execution: |
| 142 | + steps: |
| 143 | + - step: |
| 144 | + identifier: buildpush |
| 145 | + type: Run |
| 146 | + name: Build Binary |
| 147 | + spec: |
| 148 | + connectorRef: Plugins_Docker_Hub_Connector |
| 149 | + image: golang:1.21 |
| 150 | + shell: Sh |
| 151 | + command: |- |
| 152 | + # force go modules |
| 153 | + export GOPATH="" |
| 154 | +
|
| 155 | + # disable cgo |
| 156 | + export CGO_ENABLED=0 |
| 157 | +
|
| 158 | + set -e |
| 159 | + set -x |
| 160 | +
|
| 161 | + # linux |
| 162 | + export GOOS=linux GOARCH=arm64 |
| 163 | +
|
| 164 | + go build -v -a -tags netgo -o release/linux/arm64/drone-sftp . |
| 165 | + - step: |
| 166 | + type: Plugin |
| 167 | + name: "Build and Push on Tag " |
| 168 | + identifier: Plugin_1 |
| 169 | + spec: |
| 170 | + connectorRef: Plugins_Docker_Hub_Connector |
| 171 | + image: plugins/docker |
| 172 | + settings: |
| 173 | + username: drone |
| 174 | + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> |
| 175 | + repo: plugins/sftp |
| 176 | + dockerfile: docker/Dockerfile.linux.arm64 |
| 177 | + auto_tag: "true" |
| 178 | + auto_tag_suffix: linux-arm64 |
| 179 | + when: |
| 180 | + stageStatus: Success |
| 181 | + condition: <+codebase.build.type> == "tag" |
| 182 | + - step: |
| 183 | + type: BuildAndPushDockerRegistry |
| 184 | + name: Build And Push On Branch |
| 185 | + identifier: BuildAndPushDockerRegistry_1 |
| 186 | + spec: |
| 187 | + connectorRef: Plugins_Docker_Hub_Connector |
| 188 | + repo: plugins/sftp |
| 189 | + tags: |
| 190 | + - linux-arm64 |
| 191 | + caching: false |
| 192 | + dockerfile: docker/Dockerfile.linux.arm64 |
| 193 | + when: |
| 194 | + stageStatus: Success |
| 195 | + condition: <+codebase.build.type> == "branch" |
| 196 | + - stage: |
| 197 | + identifier: winamd64 |
| 198 | + type: CI |
| 199 | + name: windows-amd64 |
| 200 | + description: "" |
| 201 | + spec: |
| 202 | + cloneCodebase: true |
| 203 | + caching: |
| 204 | + enabled: false |
| 205 | + paths: [] |
| 206 | + platform: |
| 207 | + os: Windows |
| 208 | + arch: Amd64 |
| 209 | + runtime: |
| 210 | + type: Cloud |
| 211 | + spec: {} |
| 212 | + execution: |
| 213 | + steps: |
| 214 | + - step: |
| 215 | + identifier: build_amd64ltsc2022 |
| 216 | + type: Run |
| 217 | + name: Build Binary |
| 218 | + spec: |
| 219 | + connectorRef: Plugins_Docker_Hub_Connector |
| 220 | + image: golang:1.21 |
| 221 | + shell: Sh |
| 222 | + command: |- |
| 223 | + # force go modules |
| 224 | + export GOPATH="" |
| 225 | +
|
| 226 | + # disable cgo |
| 227 | + export CGO_ENABLED=0 |
| 228 | +
|
| 229 | + set -e |
| 230 | + set -x |
| 231 | +
|
| 232 | + # Windows |
| 233 | + GOOS=windows |
| 234 | +
|
| 235 | + go build -v -a -tags netgo -o release/windows/amd64/drone-sftp.exe . |
| 236 | + - step: |
| 237 | + type: Plugin |
| 238 | + name: Build and Push on Tag |
| 239 | + identifier: Plugin_1 |
| 240 | + spec: |
| 241 | + connectorRef: Plugins_Docker_Hub_Connector |
| 242 | + image: plugins/docker |
| 243 | + settings: |
| 244 | + username: drone |
| 245 | + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> |
| 246 | + repo: plugins/sftp |
| 247 | + dockerfile: docker/Dockerfile.windows.ltsc2022 |
| 248 | + auto_tag: "true" |
| 249 | + auto_tag_suffix: windows-ltsc2022-amd64 |
| 250 | + when: |
| 251 | + stageStatus: Success |
| 252 | + condition: <+codebase.build.type> == "tag" |
| 253 | + - step: |
| 254 | + type: BuildAndPushDockerRegistry |
| 255 | + name: Build And Push on Branch |
| 256 | + identifier: BuildAndPushDockerRegistry_1 |
| 257 | + spec: |
| 258 | + connectorRef: Plugins_Docker_Hub_Connector |
| 259 | + repo: plugins/sftp |
| 260 | + tags: |
| 261 | + - windows-ltsc2022-amd64 |
| 262 | + caching: false |
| 263 | + dockerfile: docker/Dockerfile.windows.ltsc2022 |
| 264 | + when: |
| 265 | + stageStatus: Success |
| 266 | + condition: <+codebase.build.type> == "branch" |
| 267 | + buildIntelligence: |
| 268 | + enabled: false |
| 269 | + - stage: |
| 270 | + name: windows-1809 |
| 271 | + identifier: windows1809 |
| 272 | + description: "" |
| 273 | + type: CI |
| 274 | + spec: |
| 275 | + cloneCodebase: true |
| 276 | + caching: |
| 277 | + enabled: true |
| 278 | + buildIntelligence: |
| 279 | + enabled: true |
| 280 | + infrastructure: |
| 281 | + type: VM |
| 282 | + spec: |
| 283 | + type: Pool |
| 284 | + spec: |
| 285 | + poolName: windows-2019 |
| 286 | + os: Windows |
| 287 | + execution: |
| 288 | + steps: |
| 289 | + - step: |
| 290 | + type: Run |
| 291 | + name: Build |
| 292 | + identifier: Build |
| 293 | + spec: |
| 294 | + connectorRef: account.harnessImage |
| 295 | + image: golang:1.21 |
| 296 | + shell: Sh |
| 297 | + command: |- |
| 298 | + # force go modules |
| 299 | + export GOPATH="" |
| 300 | +
|
| 301 | + # disable cgo |
| 302 | + export CGO_ENABLED=0 |
| 303 | +
|
| 304 | + set -e |
| 305 | + set -x |
| 306 | +
|
| 307 | + # Windows |
| 308 | + GOOS=windows |
| 309 | +
|
| 310 | + go build -v -a -tags netgo -o release/windows/amd64/drone-sftp.exe . |
| 311 | + - step: |
| 312 | + type: Plugin |
| 313 | + name: Build and Push on Tag |
| 314 | + identifier: Plugin_1 |
| 315 | + spec: |
| 316 | + connectorRef: Plugins_Docker_Hub_Connector |
| 317 | + image: plugins/docker |
| 318 | + settings: |
| 319 | + username: drone |
| 320 | + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> |
| 321 | + repo: plugins/sftp |
| 322 | + dockerfile: docker/Dockerfile.windows.1809 |
| 323 | + auto_tag: "true" |
| 324 | + auto_tag_suffix: windows-1809-amd64 |
| 325 | + when: |
| 326 | + stageStatus: Success |
| 327 | + condition: <+codebase.build.type> == "tag" |
| 328 | + - step: |
| 329 | + type: BuildAndPushDockerRegistry |
| 330 | + name: Build And Push on Branch |
| 331 | + identifier: BuildAndPushDockerRegistry_1 |
| 332 | + spec: |
| 333 | + connectorRef: Plugins_Docker_Hub_Connector |
| 334 | + repo: plugins/sftp |
| 335 | + tags: |
| 336 | + - windows-1809-amd64 |
| 337 | + caching: false |
| 338 | + dockerfile: docker/Dockerfile.windows.1809 |
| 339 | + when: |
| 340 | + stageStatus: Success |
| 341 | + condition: <+codebase.build.type> == "branch" |
| 342 | + delegateSelectors: |
| 343 | + - windows-vm |
| 344 | + - stage: |
| 345 | + name: Manifest and Release |
| 346 | + identifier: Manifest_and_Release |
| 347 | + description: "" |
| 348 | + type: CI |
| 349 | + spec: |
| 350 | + cloneCodebase: true |
| 351 | + caching: |
| 352 | + enabled: false |
| 353 | + paths: [] |
| 354 | + platform: |
| 355 | + os: Linux |
| 356 | + arch: Amd64 |
| 357 | + runtime: |
| 358 | + type: Cloud |
| 359 | + spec: {} |
| 360 | + execution: |
| 361 | + steps: |
| 362 | + - step: |
| 363 | + type: Plugin |
| 364 | + name: Manifest |
| 365 | + identifier: Manifest |
| 366 | + spec: |
| 367 | + connectorRef: Plugins_Docker_Hub_Connector |
| 368 | + image: plugins/manifest |
| 369 | + settings: |
| 370 | + username: drone |
| 371 | + password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> |
| 372 | + auto_tag: "true" |
| 373 | + ignore_missing: "true" |
| 374 | + spec: docker/manifest.tmpl |
| 375 | + when: |
| 376 | + stageStatus: Success |
| 377 | + condition: | |
| 378 | + <+codebase.build.type> == "tag" || "branch" |
| 379 | + allowStageExecutions: true |
| 380 | + identifier: dronesftprharness |
| 381 | + name: drone-sftp-harness |
0 commit comments