Bug 1252826 - [origin_devexp_555]Can't trigger a new build when push some change to origin-gitserver
[origin_devexp_555]Can't trigger a new build when push some change to origin-...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Build (Show other bugs)
3.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Cesar Wong
Wenjing Zheng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-12 05:59 EDT by DeShuai Ma
Modified: 2016-09-19 09:50 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-19 09:50:54 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)

  None (edit)
Description DeShuai Ma 2015-08-12 05:59:54 EDT
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-20 22:53:16 EDT
We need to set a default hook in the image or template definition so that something runs.
Comment 2 Cesar Wong 2016-04-28 09:47:27 EDT
Builds should now be triggered. Please see documentation at 
https://github.com/openshift/origin/tree/master/examples/gitserver
Comment 3 XiuJuan Wang 2016-04-28 23:13:51 EDT
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.