Re: [onap-discuss] [integration] Questions about Docker build CI job

2017-08-29 Thread Gary Wu
Hi Ethan,

Nexus provides a special URL for retrieving the latest SNAPSHOT version of a 
particular artifact.  It looks like this in Python:

url_template = 
"https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g={0}&a={1}&e={2}&c={3}&v=LATEST<https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=%7b0%7d&a=%7b1%7d&e=%7b2%7d&c=%7b3%7d&v=LATEST>"
url_template.format(row["groupId"], row["artifactId"], row["extension"], 
row["classifier"])

extension is like "zip" or "tar.gz".
classifier is like "linux64" if applicable.

I recommend that you use wget in your Dockerfile with the above URL to retrieve 
artifacts from Nexus.

After you have a Dockerfile (and associated support files), you need to 
configure a Jenkins job that will build and push it to nexus3.onap.org:10003.  
It is not necessary to use a pom.xml for this, but you can if that's more 
familiar to you.  A more straight forward alternative is to just run the 
necessary docker commands directly via a shell script to build and push the 
image to nexus3.


For reference, you can take a look at a script that we used in OPEN-O for 
generating Dockerfiles: [1].

[1]: 
https://git.onap.org/integration/tree/packaging/docker/scripts/gen-dockerfiles.py

Thanks,
Gary


From: Ethan Lynn [mailto:ethanly...@vmware.com]
Sent: Tuesday, August 29, 2017 2:58 AM
To: onap-discuss@lists.onap.org; Gary Wu 
Subject: [onap-discuss][integration] Questions about Docker build CI job

Hi,
  This is Ethan from MultiCloud. I went through the wiki pages but still 
confuse about how to use CI job building a docker image and pushing it to 
nexus.onap.org<http://nexus.onap.org>.
  First, I think I need a Dockerfile, describe how to build our image. Here I 
have a question, how can I get the source code in Dockerfile ? We already push 
our .zip to 
https://nexus.onap.org/content/repositories/snapshots/org/onap/multicloud/framework/multicloud-framework/1.0.0-SNAPSHOT/,
  do I need to  manually download it in Dockerfile or CI will handle it? And I 
notice that the zip name is based on date it was pushed, how can I get the 
latest zip in Dockerfile?
  Then I think I need to change pom.xml and add docker build part, and set the 
patch of Dockerfile.
  Then I need to add a CI job for it. Will CI job automatically push image to 
nexus?


Best Regards,
Ethan Lynn
ethanly...@vmware.com<mailto:ethanly...@vmware.com>
+86 010-59934270



___
onap-discuss mailing list
onap-discuss@lists.onap.org
https://lists.onap.org/mailman/listinfo/onap-discuss


[onap-discuss] [integration] Questions about Docker build CI job

2017-08-29 Thread Ethan Lynn
Hi,
  This is Ethan from MultiCloud. I went through the wiki pages but still 
confuse about how to use CI job building a docker image and pushing it to 
nexus.onap.org.
  First, I think I need a Dockerfile, describe how to build our image. Here I 
have a question, how can I get the source code in Dockerfile ? We already push 
our .zip to 
https://nexus.onap.org/content/repositories/snapshots/org/onap/multicloud/framework/multicloud-framework/1.0.0-SNAPSHOT/,
  do I need to  manually download it in Dockerfile or CI will handle it? And I 
notice that the zip name is based on date it was pushed, how can I get the 
latest zip in Dockerfile?
  Then I think I need to change pom.xml and add docker build part, and set the 
patch of Dockerfile.
  Then I need to add a CI job for it. Will CI job automatically push image to 
nexus?


Best Regards,
Ethan Lynn
ethanly...@vmware.com
+86 010-59934270



___
onap-discuss mailing list
onap-discuss@lists.onap.org
https://lists.onap.org/mailman/listinfo/onap-discuss