Publier des artefacts ESB dans un registre Docker distant - 7.2

Talend Software Development Life Cycle - Guide de bonnes pratiques

Version
7.2
Language
Français (France)
Product
Talend Big Data
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Module
Studio Talend
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend JobServer
Content
Administration et monitoring
Création et développement
Déploiement

Avant de commencer

Assurez-vous qu'un registre Docker est configuré dans votre référentiel d'artefacts (Nexus, Artifactory).

Procédure

  1. Ouvrez une invite de commande ou un terminal et exécutez la commande suivante afin de construire et déployer les artefacts dans un registre Docker distant.
    $ mvn -Dgeneration.type=local -Dproduct.path=<STUDIO_HOME> -s <STUDIO_HOME>/configuration/maven_user_settings.xml \
    						deploy -Pdocker \
    						-f <GIT_PROJECT_PATH>/<STUDIO_PROJECT>/poms \
    						-pl jobs/process/demorest_0.1,jobs/routes/demorestroute_0.1,jobs/routes/directsedademo_0.1 \
    						-Ddocker.push.username=<username> -Ddocker.push.password=<password> -Ddocker.push.registry=<ARTIFACT_REPOSITORY_HOST>:<DOCKER_REGISTRY_PORT>
    						
    						[INFO] Scanning for projects...
    						...
    						[INFO] ------------------------------------------------------------------------
    						[INFO] Reactor Build Order:
    						[INFO]
    						[INFO] <STUDIO_PROJECT> DemoREST-0.1.0 (0.1,Jobs) Microservice Jar           [jar]
    						[INFO] <STUDIO_PROJECT> DirectSEDADemo-0.1.0 (0.1,Routes) Microservice Jar   [jar]
    						[INFO] <STUDIO_PROJECT> DemoRESTRoute-0.1.0 (0.1,Routes) Microservice Jar    [jar]
    						...
    						[INFO] --- fabric8-maven-plugin:4.0.0:push (push-image) @ DemoREST ---
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest]
    						[INFO] F8> latest: digest: sha256:a63c7e4672efc1632fd696eb24fe0a7dba89c0b5697b96b370f98546c6e2108e size: 1993
    						[INFO] F8> Pushed <STUDIO_PROJECT>/demorest in 8 seconds
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest]
    						[INFO] F8> 0.1.0: digest: sha256:a63c7e4672efc1632fd696eb24fe0a7dba89c0b5697b96b370f98546c6e2108e size: 1993
    						...
    						[INFO] --- fabric8-maven-plugin:4.0.0:push (push-image) @ DirectSEDADemo ---
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo]
    						[INFO] F8> latest: digest: sha256:0de9fe92ae8f4a39c7af7a676682f4a6868b4416deebc52acc4f581e0a2e16c4 size: 1992
    						[INFO] F8> Pushed <STUDIO_PROJECT>/directsedademo in 4 seconds
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo]
    						[INFO] F8> 0.1.0: digest: sha256:0de9fe92ae8f4a39c7af7a676682f4a6868b4416deebc52acc4f581e0a2e16c4 size: 1992
    						...
    						[INFO] --- fabric8-maven-plugin:4.0.0:push (push-image) @ DemoRESTRoute ---
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute]
    						[INFO] F8> latest: digest: sha256:080892fee69d06676da35aaf57bfe7ff7c4e1a544fb08b0ca86976b5d44e015e size: 1992
    						[INFO] F8> Pushed <STUDIO_PROJECT>/demorestroute in 5 seconds
    						[INFO] F8> The push refers to repository [<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute]
    						[INFO] F8> 0.1.0: digest: sha256:080892fee69d06676da35aaf57bfe7ff7c4e1a544fb08b0ca86976b5d44e015e size: 1992
    						...
    						[INFO] ------------------------------------------------------------------------
    						[INFO] Reactor Summary for <STUDIO_PROJECT> DemoREST-0.1.0 (0.1,Jobs) Microservice Jar 0.1.0:
    						[INFO]
    						[INFO] <STUDIO_PROJECT> DemoREST-0.1.0 (0.1,Jobs) Microservice Jar SUCCESS [02:54 min]
    						[INFO] <STUDIO_PROJECT> DirectSEDADemo-0.1.0 (0.1,Routes) Microservice Jar SUCCESS [ 35.323 s]
    						[INFO] <STUDIO_PROJECT> DemoRESTRoute-0.1.0 (0.1,Routes) Microservice Jar SUCCESS [ 32.586 s]
    						[INFO] ------------------------------------------------------------------------
    						[INFO] BUILD SUCCESS
    						[INFO] ------------------------------------------------------------------------
    						[INFO] Total time:  04:08 min
    						[INFO] Finished at: 2019-08-12T10:12:03+02:00
    						[INFO] ------------------------------------------------------------------------
    • <STUDIO_HOME> correspond au chemin d'installation de Studio Talend
    • <GIT_PROJECT_PATH> correspond au chemin de votre projet Git ou du résultat du clone Git
    • <STUDIO_PROJECT> correspond au nom du projet Studio Talend, identique au nom du projet Git. Le nom des projets doit comporter uniquement des majuscules.
    • <ARTIFACT_REPOSITORY_DOCKER_REGISTRY> correspond à l'URL de l'hôte du référentiel d'artefacts (Nexus, Artifactory)
    • <ARTIFACT_REPOSITORY_DOCKER_REGISTRY> correspond à l'URL de l'hôte du registre Docker du référentiel d'artefacts (Nexus, Artifactory)
    • <DOCKER_REGISTRY_PORT> correspond au port lié pour l'accès au référentiel Docker (spécifique à Nexus)
  2. Connectez-vous au registre Docker et effectuez un pull depuis le registre Docker distant vers le registre Docker local.
    $ docker login <ARTIFACT_REPOSITORY_HOST>:<DOCKER_REGISTRY_PORT>
    						Login Succeeded
    						
    						$ docker pull <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute
    						Using default tag: latest
    						latest: Pulling from <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute
    						Digest: sha256:4c8afd00802eef89197c65f6855e2dfc1609ca518022526207fcb4c56709e958
    						Status: Downloaded newer image for <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute:latest
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute:latest
    						
    						$ docker pull <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest
    						Using default tag: latest
    						latest: Pulling from repository/local-docker/jgr_docker_ci/demorest
    						Digest: sha256:a63c7e4672efc1632fd696eb24fe0a7dba89c0b5697b96b370f98546c6e2108e
    						Status: Downloaded newer image for <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest:latest
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest:latest
    						$ docker pull <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo
    						Using default tag: latest
    						latest: Pulling from repository/local-docker/jgr_docker_ci/directsedademo
    						Digest: sha256:0de9fe92ae8f4a39c7af7a676682f4a6868b4416deebc52acc4f581e0a2e16c4
    						Status: Downloaded newer image for <ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo:latest
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo:latest
    						
    						$ docker images
    						REPOSITORY                                                                   TAG                 IMAGE ID            CREATED             SIZE
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorestroute         latest              5901eb7a8c7d        1 minute ago        258MB
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/directsedademo        latest              36aaa145fd80        1 minute ago        237MB
    						<ARTIFACT_REPOSITORY_DOCKER_REGISTRY>/<STUDIO_PROJECT>/demorest              latest              afdaba21fb8a        1 minute ago        307MB