Bug 1252826 - [origin_devexp_555]Can't trigger a new build when push some change to origin-gitserver
Summary: [origin_devexp_555]Can't trigger a new build when push some change to origin-...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Build
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Cesar Wong
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-12 09:59 UTC by DeShuai Ma
Modified: 2016-09-19 13:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:50:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description DeShuai Ma 2015-08-12 09:59:54 UTC
Description of problem:
When use origin-gitserver repo to do build, push some change to origin-gitserver, can't  trigger a new build automatically.

Version-Release number of selected component (if applicable):
openshift v1.0.4-184-gc5f08bc-dirty
kubernetes v1.1.0-alpha.0-1155-gb73c53c

How reproducible:
Always

Steps to Reproduce:
1.Login openshift and create a new project

2.Deploy the ruby-hello-world application
$oc process -f application-template-stibuild.json | oc create -f - -n dma1 

3.Add admin role to default serviceaccount in project
$ oc policy add-role-to-user admin system:serviceaccount:dma:default -n dma

4.Configure gitserver without auth, set both "REQUIRE_SERVER_AUTH" and "REQUIRE_GIT_AUTH" to empty.
$ cat examples/gitserver/gitserver.yaml
---skip---
- name: REQUIRE_SERVER_AUTH
- name: REQUIRE_GIT_AUTH

5.Deploy the private gitserver
$ oc create -f gitserver.yaml -n dma1

6.Check the pod ,service, build
$ oc get svc -n dma1
$ oc get pod -n dma1
$ oc get build -n dma1

7.Clone the repo from private gitserver and make some change push to gitserver
$ git clone http://172.30.10.11:8080/ruby-sample-build.git
$ cd ruby-sample-build
$ echo "hello" > b.txt
$ git add b.txt
$ git commit -anmq
$ git push

8.Check the build
$ oc get build -n dma1

9.Change the buildConfig uri to "http://gitserver.dma1.svc.cluster.local:8080/ruby-sample-build.git" or "http://172.30.10.11:8080/ruby-sample-build.git"
[fedora@ip-10-154-3-36 ruby-sample-build]$ oc get buildConfig -n dma1
NAME                TYPE      SOURCE
ruby-sample-build   Source    http://gitserver.dma1.svc.cluster.local:8080/ruby-sample-build.git

[fedora@ip-10-154-3-36 ruby-sample-build]$ oc get buildConfig -n dma1
NAME                TYPE      SOURCE
ruby-sample-build   Source    http://172.30.10.11:8080/ruby-sample-build.git

10.repeat step7 to trigger a new build

Actual results:
8.No new build generate.
10.No new build generate.

Expected results:
8.Should trigger a new build
10.Should trigger a new build

Additional info:
1.gitserver log
[fedora@ip-10-154-3-36 gitserver]$ oc logs gitserver-1-c587u -n dma1
2015/08/12 07:56:51 Linking build configs in namespace(s) [dma1] to the gitserver
2015/08/12 07:56:52 Linked ruby-sample-build for repo https://github.com/openshift/ruby-hello-world.git as http://gitserver.dma1.svc.cluster.local:8080/ruby-sample-build.git
2015/08/12 07:56:52 Cloning https://github.com/openshift/ruby-hello-world.git into /var/lib/git/ruby-sample-build.git
2015/08/12 07:56:52 Serving /var/lib/git on :8080

Comment 1 Clayton Coleman 2015-08-21 02:53:16 UTC
We need to set a default hook in the image or template definition so that something runs.

Comment 2 Cesar Wong 2016-04-28 13:47:27 UTC
Builds should now be triggered. Please see documentation at 
https://github.com/openshift/origin/tree/master/examples/gitserver

Comment 3 XiuJuan Wang 2016-04-29 03:13:51 UTC
Verified this bug with openshift/origin-gitserver (d4413378d01d).
Could trigger new build after push code to gitserver.

remote: --> Creating resources with label app=ruby-hello-world ...
remote:     imagestream "ruby-22-centos7" created
remote:     imagestream "ruby-hello-world" created
remote:     buildconfig "ruby-hello-world" created
remote:     deploymentconfig "ruby-hello-world" created
remote:     service "ruby-hello-world" created
remote: --> Success
remote:     Build scheduled, use 'oc logs -f bc/ruby-hello-world' to track its progress.
remote:     Run 'oc status' to view your app.
To http://git-xiuwang.0428-og3.qe.rhcloud.com/ruby-hello-world.git
 * [new branch]      master -> master
[xiuj@dhcp-128-25 ruby-hello-world]$ oc get  pods 
NAME                       READY     STATUS    RESTARTS   AGE
git-1-trrhu                1/1       Running   0          8m
ruby-hello-world-1-build   1/1       Running   0          1m


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