ci: use drone http proxy where go image is used (#7549)

This commit is contained in:
Sawjan Gurung
2023-10-20 16:58:56 +05:45
committed by GitHub
parent c42e5ae6ba
commit 67365bd7a2
+25 -40
View File
@@ -180,6 +180,15 @@ MINIO_MC_ENV = {
}, },
} }
DRONE_HTTP_PROXY_ENV = {
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
}
def pipelineDependsOn(pipeline, dependant_pipelines): def pipelineDependsOn(pipeline, dependant_pipelines):
if "depends_on" in pipeline.keys(): if "depends_on" in pipeline.keys():
pipeline["depends_on"] = pipeline["depends_on"] + getPipelineNames(dependant_pipelines) pipeline["depends_on"] = pipeline["depends_on"] + getPipelineNames(dependant_pipelines)
@@ -375,14 +384,7 @@ def cacheGoBin():
"make bingo-update", "make bingo-update",
], ],
"volumes": [stepVolumeGo], "volumes": [stepVolumeGo],
"environment": { "environment": DRONE_HTTP_PROXY_ENV,
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
},
}, },
{ {
"name": "archive-go-bin", "name": "archive-go-bin",
@@ -441,19 +443,13 @@ def testOcis(ctx):
"make ci-golangci-lint", "make ci-golangci-lint",
"mv checkstyle.xml cache/checkstyle/checkstyle.xml", "mv checkstyle.xml cache/checkstyle/checkstyle.xml",
], ],
"environment": { "environment": DRONE_HTTP_PROXY_ENV,
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
},
"volumes": [stepVolumeGo], "volumes": [stepVolumeGo],
}, },
{ {
"name": "test", "name": "test",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"mkdir -p cache/coverage", "mkdir -p cache/coverage",
"make test", "make test",
@@ -1263,6 +1259,7 @@ def dockerRelease(ctx, arch):
{ {
"name": "build", "name": "build",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C ocis release-linux-docker-%s" % (arch), "make -C ocis release-linux-docker-%s" % (arch),
], ],
@@ -1377,6 +1374,7 @@ def binaryRelease(ctx, name):
{ {
"name": "build", "name": "build",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C ocis release-%s" % (name), "make -C ocis release-%s" % (name),
], ],
@@ -1384,6 +1382,7 @@ def binaryRelease(ctx, name):
{ {
"name": "finish", "name": "finish",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C ocis release-finish", "make -C ocis release-finish",
"cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/", "cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/",
@@ -1409,6 +1408,7 @@ def binaryRelease(ctx, name):
{ {
"name": "changelog", "name": "changelog",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
], ],
@@ -1507,6 +1507,7 @@ def licenseCheck(ctx):
{ {
"name": "go-check-licenses", "name": "go-check-licenses",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make ci-go-check-licenses", "make ci-go-check-licenses",
], ],
@@ -1515,6 +1516,7 @@ def licenseCheck(ctx):
{ {
"name": "go-save-licenses", "name": "go-save-licenses",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make ci-go-save-licenses", "make ci-go-save-licenses",
], ],
@@ -1541,6 +1543,7 @@ def licenseCheck(ctx):
{ {
"name": "changelog", "name": "changelog",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], "make changelog CHANGELOG_VERSION=%s" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
], ],
@@ -1629,6 +1632,7 @@ def changelog():
{ {
"name": "generate", "name": "generate",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C ocis changelog", "make -C ocis changelog",
], ],
@@ -1731,19 +1735,13 @@ def docs():
{ {
"name": "docs-generate", "name": "docs-generate",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": { "environment": DRONE_HTTP_PROXY_ENV,
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
},
"commands": ["make docs-generate"], "commands": ["make docs-generate"],
}, },
{ {
"name": "prepare", "name": "prepare",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C docs docs-copy", "make -C docs docs-copy",
], ],
@@ -1751,6 +1749,7 @@ def docs():
{ {
"name": "test", "name": "test",
"image": OC_CI_GOLANG, "image": OC_CI_GOLANG,
"environment": DRONE_HTTP_PROXY_ENV,
"commands": [ "commands": [
"make -C docs test", "make -C docs test",
], ],
@@ -1827,14 +1826,7 @@ def makeGoGenerate(module):
"commands": [ "commands": [
"retry -t 3 '%s ci-go-generate'" % (make), "retry -t 3 '%s ci-go-generate'" % (make),
], ],
"environment": { "environment": DRONE_HTTP_PROXY_ENV,
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
},
"volumes": [stepVolumeGo], "volumes": [stepVolumeGo],
}, },
] ]
@@ -2031,14 +2023,7 @@ def build():
"commands": [ "commands": [
"retry -t 3 'make -C ocis build'", "retry -t 3 'make -C ocis build'",
], ],
"environment": { "environment": DRONE_HTTP_PROXY_ENV,
"HTTP_PROXY": {
"from_secret": "drone_http_proxy",
},
"HTTPS_PROXY": {
"from_secret": "drone_http_proxy",
},
},
"volumes": [stepVolumeGo], "volumes": [stepVolumeGo],
}, },
] ]