Skip to content

Commit 2c77690

Browse files
ericlazszegedi
authored andcommitted
Add BITBUCKET_GIT_HTTP_ORIGIN env variable (#3401)
* Add BITBUCKET_GIT_HTTP_ORIGIN env variable * Update CI spec JSONs
1 parent 3fd7ee5 commit 2c77690

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

packages/dd-trace/src/plugins/util/ci.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ module.exports = {
399399
BITBUCKET_BRANCH,
400400
BITBUCKET_COMMIT,
401401
BITBUCKET_GIT_SSH_ORIGIN,
402+
BITBUCKET_GIT_HTTP_ORIGIN,
402403
BITBUCKET_TAG,
403404
BITBUCKET_PIPELINE_UUID,
404405
BITBUCKET_CLONE_DIR
@@ -416,7 +417,7 @@ module.exports = {
416417
[CI_PIPELINE_URL]: url,
417418
[GIT_BRANCH]: BITBUCKET_BRANCH,
418419
[GIT_TAG]: BITBUCKET_TAG,
419-
[GIT_REPOSITORY_URL]: BITBUCKET_GIT_SSH_ORIGIN,
420+
[GIT_REPOSITORY_URL]: BITBUCKET_GIT_SSH_ORIGIN || BITBUCKET_GIT_HTTP_ORIGIN,
420421
[CI_WORKSPACE_PATH]: BITBUCKET_CLONE_DIR,
421422
[CI_PIPELINE_ID]: BITBUCKET_PIPELINE_UUID && BITBUCKET_PIPELINE_UUID.replace(/{|}/gm, '')
422423
}

packages/dd-trace/test/plugins/util/ci-env/bitbucket.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
66
"BITBUCKET_CLONE_DIR": "/foo/bar",
77
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
8-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
8+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
99
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
1010
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
1111
},
@@ -28,7 +28,7 @@
2828
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
2929
"BITBUCKET_CLONE_DIR": "foo/bar",
3030
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
31-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
31+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
3232
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
3333
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
3434
},
@@ -51,6 +51,7 @@
5151
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
5252
"BITBUCKET_CLONE_DIR": "foo/bar",
5353
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
54+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
5455
"BITBUCKET_GIT_SSH_ORIGIN": "git@github.com:DataDog/dummy-example.git",
5556
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
5657
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
@@ -74,7 +75,7 @@
7475
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
7576
"BITBUCKET_CLONE_DIR": "/foo/bar~",
7677
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
77-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
78+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
7879
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
7980
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
8081
},
@@ -97,7 +98,7 @@
9798
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
9899
"BITBUCKET_CLONE_DIR": "/foo/~/bar",
99100
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
100-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
101+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
101102
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
102103
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
103104
},
@@ -120,7 +121,7 @@
120121
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
121122
"BITBUCKET_CLONE_DIR": "~/foo/bar",
122123
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
123-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
124+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
124125
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
125126
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
126127
"HOME": "/not-my-home",
@@ -145,7 +146,7 @@
145146
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
146147
"BITBUCKET_CLONE_DIR": "~foo/bar",
147148
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
148-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
149+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
149150
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
150151
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
151152
},
@@ -168,7 +169,7 @@
168169
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
169170
"BITBUCKET_CLONE_DIR": "~",
170171
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
171-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
172+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
172173
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
173174
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
174175
"HOME": "/not-my-home",
@@ -193,7 +194,7 @@
193194
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
194195
"BITBUCKET_CLONE_DIR": "/foo/bar",
195196
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
196-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
197+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
197198
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
198199
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
199200
},
@@ -216,7 +217,7 @@
216217
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
217218
"BITBUCKET_CLONE_DIR": "/foo/bar",
218219
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
219-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
220+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
220221
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
221222
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
222223
},
@@ -239,7 +240,7 @@
239240
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
240241
"BITBUCKET_CLONE_DIR": "/foo/bar",
241242
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
242-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
243+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
243244
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
244245
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
245246
},
@@ -262,7 +263,7 @@
262263
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
263264
"BITBUCKET_CLONE_DIR": "/foo/bar",
264265
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
265-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
266+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
266267
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
267268
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
268269
},
@@ -284,7 +285,7 @@
284285
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
285286
"BITBUCKET_CLONE_DIR": "/foo/bar",
286287
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
287-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
288+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
288289
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
289290
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
290291
"BITBUCKET_TAG": "origin/tags/0.1.0"
@@ -307,7 +308,7 @@
307308
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
308309
"BITBUCKET_CLONE_DIR": "/foo/bar",
309310
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
310-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
311+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
311312
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
312313
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
313314
"BITBUCKET_TAG": "refs/heads/tags/0.1.0"
@@ -329,7 +330,7 @@
329330
{
330331
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
331332
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
332-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
333+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
333334
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
334335
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
335336
"DD_GIT_BRANCH": "user-supplied-branch",
@@ -366,7 +367,7 @@
366367
{
367368
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
368369
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
369-
"BITBUCKET_GIT_SSH_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
370+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket-repo-url.com/repo.git",
370371
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
371372
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo",
372373
"DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate",
@@ -403,7 +404,7 @@
403404
{
404405
"BITBUCKET_BUILD_NUMBER": "bitbucket-build-num",
405406
"BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
406-
"BITBUCKET_GIT_SSH_ORIGIN": "https://user:password@bitbucket.org/DataDog/dogweb.git",
407+
"BITBUCKET_GIT_HTTP_ORIGIN": "https://user:password@bitbucket.org/DataDog/dogweb.git",
407408
"BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}",
408409
"BITBUCKET_REPO_FULL_NAME": "bitbucket-repo"
409410
},

0 commit comments

Comments
 (0)