Skip to content

Commit

Permalink
add upgrade flag to buid-images pipeline (#136)
Browse files Browse the repository at this point in the history
Signed-off-by: 662962756 <[email protected]>
  • Loading branch information
bvered authored Jun 1, 2023
1 parent 18a3c8f commit 36db369
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion hack/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pipeline {
string(name: 'CONSOLE_GIT_BRANCH', defaultValue: "release-1.4.0")
string(name: 'OPERATOR_GIT_BRANCH', defaultValue: "release-1.4.0")
string(name: 'PLATFORM', defaultValue: "linux/amd64")
string(name: 'ENABLE_UPGRADE', defaultValue: "False")
}
environment {
registryCredentialsID = 'odf_w3_user'
Expand Down Expand Up @@ -74,7 +75,7 @@ pipeline {
-v /root/.docker:/root/.docker \
-v /var/run/docker.sock:/var/run/docker.sock \
odf-build-images \
"from build_images import build_and_push_operator_image; build_and_push_operator_image(\'${DOCKER_REGISTRY}\', \'${OPERATOR_GIT_BRANCH}\', \'${DRIVER_IMAGE}\', \'${CONSOLE_IMAGE}\', \'${PLATFORM}\', \'report/${OUTPUT_FILE}\')"
"from build_images import build_and_push_operator_image; build_and_push_operator_image(\'${DOCKER_REGISTRY}\', \'${OPERATOR_GIT_BRANCH}\', \'${DRIVER_IMAGE}\', \'${CONSOLE_IMAGE}\', \'${PLATFORM}\', \'${ENABLE_UPGRADE}\', \'report/${OUTPUT_FILE}\')"
'''
}
}
Expand Down
4 changes: 2 additions & 2 deletions hack/build_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
OPERATOR_CLONE_LOCAL_DIR = 'ibm-storage-odf-operator'


def build_and_push_operator_image(docker_registry, git_branch, driver_image, console_image, platform, output_file):
def build_and_push_operator_image(docker_registry, git_branch, driver_image, console_image, platform, upgrade, output_file):
print("Cloning git project", flush=True)
git.Repo.clone_from(OPERATOR_GIT_URL, OPERATOR_CLONE_LOCAL_DIR, branch=git_branch)

Expand All @@ -28,7 +28,7 @@ def build_and_push_operator_image(docker_registry, git_branch, driver_image, co
console_image_tag = console_image.split(":")[-1]

print("Building image")
env_vars = dict(IMAGE_REGISTRY=docker_registry, PLATFORM=platform,
env_vars = dict(IMAGE_REGISTRY=docker_registry, PLATFORM=platform, ENABLE_UPGRADE=upgrade,
IMAGE_TAG=image_tag, DRIVER_IMAGE_TAG=driver_image_tag, CONSOLE_IMAGE_TAG=console_image_tag, **os.environ)

run_operator_make_command("build", env_vars)
Expand Down

0 comments on commit 36db369

Please sign in to comment.