114.4. 생산자 예

다음은 test.java 파일을 로컬 리포지토리에 추가하고 master 분기에 특정 메시지와 함께 커밋한 다음 원격 리포지토리로 내보내는 생산자 경로의 예입니다.

from("direct:start")
        .setHeader(GitConstants.GIT_FILE_NAME, constant("test.java"))
        .to("git:///tmp/testRepo?operation=add")
        .setHeader(GitConstants.GIT_COMMIT_MESSAGE, constant("first commit"))
        .to("git:///tmp/testRepo?operation=commit")
        .to("git:///tmp/testRepo?operation=push&remotePath=https://foo.com/test/test.git&username=xxx&password=xxx")
        .to("git:///tmp/testRepo?operation=createTag&tagName=myTag")
        .to("git:///tmp/testRepo?operation=pushTag&tagName=myTag&remoteName=origin")