Skip to content

Instantly share code, notes, and snippets.

View or-shachar's full-sized avatar

Or Shachar or-shachar

View GitHub Profile
{
"id": string,
"projectId": string,
"status": enum(Status),
"statusDetail": string,
"steps": [
{
// some steps that invoke bazel
}
],
@or-shachar
or-shachar / find_trigger_user_id.groovy
Last active July 30, 2019 12:26
How to recursively find the userId that triggered the build in Jenkins
import net.sf.json.JSONException
node {
// Just example of how to use the function
currentBuild.description = find_trigger_user(currentBuild)
}
def find_trigger_user(build){
cause = build.buildCauses.getJSONObject(0)
try{
return cause.getString("userId")
@or-shachar
or-shachar / bazel-vmr-wrapper.sh
Last active February 15, 2021 08:23
Pseudocode for bazel wrapper that generates external repositories file
current_branch <- get_current_branch()
if (force_latest): # for specific CI cases
recreate_file(current_branch)
else:
git_aware_file_for_branch <- find_locked_file_for_branch(current_branch)
git_ignored_file <- find_git_ignored_file_for_branch(current_branch)
if (git_aware_file_for_branch):
symlink(current_2nd_party_file, git_aware_file)
else if (git_ignored_file):
@or-shachar
or-shachar / wix_2nd_party.bzl
Created February 10, 2021 15:14
Example for external repositories bazel definition
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
def wix_deps():
git_repository(
name = "wix_a",
remote = "git://github.com:wix-example/wix-a.git",
commit = "[latest_wix_a_commit]",
)