Mavenのビルドコマンドは、デプロイのニーズに合わせて適応可能です。コマンドの例は次のとおりです。
- CICDプロジェクトのアーティファクトを.jarファイルか.zipファイルとしてビルド、テスト、パッケージ化し、Nexusスナップショットリポジトリーにデプロイする場合:
options: '-f <ProjectName>/poms/pom.xml -s <PathToDirectory>/settings.xml -Dlicense.path=<PathToDirectory>/license -Dupdatesite.path=<updatesiteURL> -DaltDeploymentRepository=snapshots::default::http://XXX:8081/repository/snapshots/ -fn -e' goals: 'deploy'
例:
options: '-f CICD/poms/pom.xml -s /home/talend/CI_dir/settings.xml -Dlicense.path=/home/talend/talend_studio/license -Dupdatesite.path=http://company/updatesite -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ -fn -e' goals: 'deploy'
カスタムコンポーネントを使用するジョブの例(カスタムコンポーネントが保存されているアーティファクトリポジトリーをポイントする追加のパラメーターが必要です)。
options: '-f CICD/poms/pom.xml -s /home/talend/CI_dir/settings.xml -pl jobs/process/sample_0.1 -am -Dcomponents.nexus.user=username -Dcomponents.nexus.password=password -Dcomponents.nexus.url=http://localhost:8081/ -Dcomponents.nexus.repository=talend-custom-libs-release -Dcomponents.nexus.repository.snapshot=talend-custom-libs-snapshot -Dlicense.path=/home/talend/talend_studio/license -Dupdatesite.path=http://company/updatesite -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ -fn -e' goals: 'deploy'
コンテキストグループを使用するジョブの例:
options: '-f CICD/poms/pom.xml -s /home/talend/CI_dir/settings.xml -pl jobs/process/parent_0.1 -am -Dlicense.path=/home/talend/talend_studio/license -Dupdatesite.path=http://company/updatesite -Dtalend.job.context=dev -Dtalend.job.applyContextToChildren=true -fn -e' goals: 'deploy'
注: 指定したコンテキストグループがジョブに存在しない場合は、デフォルトのコンテキストグループが適用されます。 - CICDプロジェクトのアーティファクトを.jarファイルか.zipファイルとしてビルド、クリーニング、テスト、パッケージ化し、Dockerレジストリーにデプロイする場合:
options: '-f <ProjectName>/poms/pom.xml -s <PathToDirectory>/settings.xml -Dlicense.path=<PathToDirectory>/license -Dupdatesite.path=<updatesiteURL> -Ddocker.push.registry=<DockerRegistryName> -Ddocker.push.username=<Dockerusername> -Ddocker.push.password=<DockerPassword> -Dtalend.docker.name=<DockerImageName> -Xms1024m -Xmx3096m' goals: 'clean deploy'
例:
options: '-f CICD/poms/pom.xml -s /home/talend/CI_dir/settings.xml -Dlicense.path=/home/talend/talend_studio/license -Dupdatesite.path=http://company/updatesite -Ddocker.push.registry=registry.example.com/group/project -Ddocker.push.username=TalendUser -Ddocker.push.password=V3ryCompl3xPwd -Dtalend.docker.name=cicd4talend -Xms1024m -Xmx3096m' goals: 'clean deploy'