Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1408879 - OPENSHIFT_BUILD_COMMIT env is not set on manual builds
OPENSHIFT_BUILD_COMMIT env is not set on manual builds
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build (Show other bugs)
3.3.1
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Ben Parees
Wang Haoran
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-27 17:51 EST by Eric Rich
Modified: 2017-07-24 10 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Different code paths for retrieving and setting the commit information. Consequence: OPENSHIFT_BUILD_COMMIT env variable is only set in the output image when the build is triggered by a webhook. Fix: Use a common code path for retrieving and setting the commit information so it is always available to be added to the image. Result: OPENSHIFT_BUILD_COMMIT env variable is always present in the output image.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-04-12 15:08:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Origin (Github) 6817 None None None 2016-12-27 17:51 EST
Red Hat Product Errata RHBA-2017:0884 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 18:50:07 EDT

  None (edit)
Description Eric Rich 2016-12-27 17:51:18 EST
Description of problem:

https://github.com/openshift/origin/issues/6817


Version-Release number of selected component (if applicable): 3.3.0


How reproducible: 100% 


Steps to Reproduce: see https://github.com/openshift/origin/issues/6817

Actual results: 
OPENSHIFT_BUILD_COMMIT env var not set when build is triggered

Expected results:

OPENSHIFT_BUILD_COMMIT env is set when build is triggered 


Additional info:
Comment 1 Cesar Wong 2017-01-03 10:23:47 EST
Ben assigning to you, since you are assigned the origin issue
Comment 2 Ben Parees 2017-01-03 11:23:18 EST
we should be adding the commit information in a consistent way:

    clone the git repo
    check out the requested commit/ref (if any, otherwise master)
    check what the current commit information is
    apply that commit information as labels/env/etc.

i'm guessing this is currently broken because the ENV comes from the webhook info and the label comes from the flow I just described.
Comment 3 Ben Parees 2017-01-04 16:55:27 EST
https://github.com/openshift/origin/pull/12390
Comment 4 Dongbo Yan 2017-01-09 02:42:44 EST
Verified 

openshift v1.5.0-alpha.1+15872c0-61
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0
devenv-centos7_5644 (ami-8fc12599)

docker build logs:
Step 13 : ENV "OPENSHIFT_BUILD_NAME" "ruby-sample-build-1" "OPENSHIFT_BUILD_NAMESPACE" "dyan" "OPENSHIFT_BUILD_SOURCE" "git://github.com/openshift/ruby-hello-world.git" "OPENSHIFT_BUILD_COMMIT" "e79d8870be808a7abb4ab304e94c8bee69d909c6"
 ---> Running in a674847812b0
 ---> a6fed1ff2c15
Removing intermediate container a674847812b0

docker build and sti build image
$ env |grep OPENSHIFT
OPENSHIFT_BUILD_COMMIT=e79d8870be808a7abb4ab304e94c8bee69d909c6
OPENSHIFT_BUILD_NAME=ruby-sample-build-1
OPENSHIFT_BUILD_SOURCE=https://github.com/openshift/ruby-hello-world.git
OPENSHIFT_BUILD_NAMESPACE=dyan1

need verify on ocp once pr merged
Comment 5 Troy Dawson 2017-01-20 18:05:39 EST
This has been merged into ocp and is in OCP v3.5.0.7 or newer.
Comment 6 Dongbo Yan 2017-01-22 01:12:02 EST
Verified

openshift v3.5.0.7+390ef18
kubernetes v1.5.2+43a9be4
etcd 3.1.0-rc.0
Comment 8 errata-xmlrpc 2017-04-12 15:08:18 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0884

Note You need to log in before you can comment on or make changes to this bug.