[zanata-users] Zanata & Github

Patrick Huang pahuang at redhat.com
Mon Dec 18 05:22:06 UTC 2017


Hello Mr Yu,

For file type project, you will have to use scripting do the job in
Jenkins. Please follow https://zanata-jenkins-plugin.readthedocs.io/en/
latest/configuration/build-step/install-cli/ to configure your Jenkins
server. After you have done with "Individual Job Configuration", you can
reference the zanata-cli tool in shell script (jenkins build step). Below
is some snippet that you can reference:

# alias to zanata-cli (installed by Jenkins)
z=$ZANATA_CLI_4_0_0_HOME/bin/zanata-cli

# invoke zanata cli (Z_USERNAME and Z_API_KEY are from credential binding
plugin)

# push translatable source to Zanata
$z --batch-mode -e push --username $Z_USERNAME --key $Z_API_KEY
--file-types "HTML"

# pull translation
$z --batch-mode -e pull --username $Z_USERNAME --key $Z_API_KEY

# after pull, you can optionally commit the translation files and push to
github in post build step
# git add .
# git commit -m "translation"




On Mon, Dec 18, 2017 at 12:12 PM, 于林生 <yls at chainnova.com> wrote:

> Can anyone help me?
>
> 在 2017年12月14日,下午7:27,Sean Flanigan <sflaniga at redhat.com> 写道:
>
> Hi Patrick,
>
> Do you know what's going on here?
>
> On 14 December 2017 at 20:02, 于林生 <yls at chainnova.com> wrote:
>
>> Hi,
>>
>>
>> I tried jenkins and zanata_plugin, but found exception.(I uploaded HTML
>> file as source document, and i want download HTML file.)
>>
>> The message is :
>>
>> Job config: ZanataSyncStep{zanataURL=, credentialsId=163dfc8c-d81f-4e37-9758-3389e62d6aa5, zanataUsername=linsheng, zanataSecret=29*9, syncOption=source, zanataLocaleIds=, zanataProjectConfigs=}
>> Dec 14, 2017 8:37:21 AM org.zanata.client.commands.OptionsUtil readProjectConfigFile
>> INFO: Loading project config from /var/jenkins_home/workspace/zanata_test/zanata.xml
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Server: https://translate.zanata.org/
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Project: xxxx
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Version: v1
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Username: xxxxx
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Project type: file
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Enable modules: false
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Using ETag cache: false
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Purging ETag cache beforehand: false
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Locales to pull: [zh-Hans-CN]
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Encode tab as \t: true
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Current directory: /
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Pulling target documents (translations) only
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Target-language base directory (translations): /var/jenkins_home/workspace/zanata_test/.
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Minimum accepted translation percentage (message based): 0%
>> Dec 14, 2017 8:37:23 AM org.zanata.client.commands.pull.PullCommand logOptions
>> INFO: Create skeletons for untranslated messages/files: false
>> ERROR: Build step failed with exception
>> java.lang.RuntimeException: unknown project type: file
>> 	at org.zanata.client.commands.pull.PullCommand.createStrategy(PullCommand.java:76)
>> 	at org.zanata.client.commands.pull.PullCommand.run(PullCommand.java:151)
>> 	at org.jenkinsci.plugins.zanata.cli.service.impl.PullServiceImpl.pullFromZanata(PullServiceImpl.java:38)
>> Caused: org.jenkinsci.plugins.zanata.exception.ZanataSyncException: failed pulling from zanata
>> 	at org.jenkinsci.plugins.zanata.cli.service.impl.PullServiceImpl.pullFromZanata(PullServiceImpl.java:40)
>> 	at org.jenkinsci.plugins.zanata.cli.service.impl.ZanataSyncServiceImpl.pullIfProjectIdMatchesConfig(ZanataSyncServiceImpl.java:234)
>> 	at org.jenkinsci.plugins.zanata.cli.service.impl.ZanataSyncServiceImpl.pullFromZanata(ZanataSyncServiceImpl.java:212)
>> 	at org.jenkinsci.plugins.zanata.zanatareposync.ZanataSyncStep$1.invoke(ZanataSyncStep.java:263)
>> 	at org.jenkinsci.plugins.zanata.zanatareposync.ZanataSyncStep$1.invoke(ZanataSyncStep.java:255)
>> 	at hudson.FilePath.act(FilePath.java:998)
>> 	at hudson.FilePath.act(FilePath.java:976)
>> 	at org.jenkinsci.plugins.zanata.zanatareposync.ZanataSyncStep.pullFromZanata(ZanataSyncStep.java:255)
>> 	at org.jenkinsci.plugins.zanata.zanatareposync.ZanataSyncStep.perform(ZanataSyncStep.java:218)
>> 	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
>> 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>> 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
>> 	at hudson.model.Build$BuildExecution.build(Build.java:206)
>> 	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>> 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
>> 	at hudson.model.Run.execute(Run.java:1737)
>> 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>> 	at hudson.model.ResourceController.execute(ResourceController.java:97)
>> 	at hudson.model.Executor.run(Executor.java:419)
>> Build step 'Zanata Sync' marked build as failure
>> Build did not succeed and the project is configured to only push after a successful build, so no pushing will occur.
>> Finished: FAILURE
>>
>>
>>
>> My Zanata config is:
>> <PastedGraphic-2.png>
>>
>>
>> When i set the "Project Type” as “Gettext”, there was no exception.
>>
>>
>>
>> 在 2017年12月12日,下午3:55,Sean Flanigan <sflaniga at redhat.com> 写道:
>>
>> Zanata doesn't integrate directly with GitHub, but we have a plugin for
>> Jenkins which can synchronise between Zanata and a git repository,
>> including GitHub.
>>   https://wiki.jenkins.io/display/JENKINS/Zanata+Plugin
>>
>> Alternatively you can look at Zanata's CLI (push and pull commands):
>>   http://docs.zanata.org/en/release/client/
>>
>>
>> On 12 December 2017 at 17:13, 于林生 <yls at chainnova.com> wrote:
>>
>>> Hi,
>>>
>>> Currently I want to translate some documents using Zanata, and use
>>> GitHub Pages to show translations.
>>>
>>> But I do not know how to display the translation on Zanata as GitHub
>>> Pages automatically rather than manually.
>>>
>>> If you can not do it automatically, what is the easiest and fastest way?
>>>
>>> That is to say, how to sync github repository documents to Zanata
>>> original, how to sync Zanata translation to github repository.
>>>
>>> Please help me.
>>>
>>> _______________________________________________
>>> zanata-users mailing list
>>> zanata-users at redhat.com
>>> https://www.redhat.com/mailman/listinfo/zanata-users
>>>
>>
>>
>>
>> --
>> Sean Flanigan
>>
>> Principal Software Engineer
>> Globalisation Tools Engineering
>> Red Hat
>>
>>
>>
>
>
> --
> Sean Flanigan
>
> Principal Software Engineer
> Globalisation Tools Engineering
> Red Hat
>
>
>


-- 
Patrick Huang
Senior Software Engineer
Engineering - Internationalisation
Red Hat, Asia-Pacific Pty Ltd
Level 1, 193 North Quay
Brisbane 4000
Office: +61 7 3514 8278
Fax: +61 7 3514 8199
IRC: pahuang
github: github.com/huangp
Website: www.redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/zanata-users/attachments/20171218/a755c341/attachment.htm>


More information about the zanata-users mailing list