0

TASK: I was charged to make/test CI pipeline for any Java (Maven preferably) sources in Jenkins (all Devops tools must be in Docker containers) . I need to do basic stages :

  • 1) Get source from github - done (I did by creating task in Jenkins and used example java app from some github repo)

  • 2) Build in Maven - done

  • 3) Make Junit tests - done

  • 4) Push artifacts ( .war file probably) to Nexus 3 repository - need to solve

HOW I tried to SOLVE: I've found the docker-ci-tool-stack ( "Devops-ready" platform: Jenkins, SonarQube, Nexus, GitLab) , so I've just used it for my purpose (here it is https://github.com/marcelbirkner/docker-ci-tool-stack) First I've tried to understand building app example from that repo, but stuck in Groove DSL scripts. After I've been trying look some tutorials, documents on integration: Jenkins , Maven and Nexus, but it's incomprehensible for me. I agree, that I should own each tool separately and after combine it together (and work in other place probably) , but I've a terms from by boss... What should I do? I passed some courses in Linux Academy for Git, Docker and Jenkins, but I still feel really raw in practice that DevOps (CI/CD), Thank you.

LocalOps
  • 21
  • 5
  • 1
    Simple answer to your question: Simply use the tools and after a long time you know how they work and how to use them... – khmarbaise Dec 27 '17 at 14:45
  • Do you have development experience? – khmarbaise Dec 27 '17 at 14:55
  • as @khmarbaise said, practice is the only way. You have to work with each tool. Start with some hello world, try to learn each one separately. Through basic. Here's a sample on deploying to nexus - try it first from command line. Jenkins just executes these commands. http://www.baeldung.com/maven-deploy-nexus – Vijay Dec 27 '17 at 15:27
  • @khmarbaise Thank you. The problem I haven't neither dev experience nor time for each tool, because my teamlead think I don't need deep learn each separately and should to learn on the fly by tutorials and searching... :( – LocalOps Dec 27 '17 at 17:31
  • @Vijay thank you. I agree with you, it right direction. – LocalOps Dec 27 '17 at 17:32
  • @LocalOps I have to say you won't really learn them on the fly nor understand them really which is fundamentally needed to use them efficiently. Your teamlead has not understood what DevOps etc. means nor realized the fundamental ideas behind that. If you don't have time you will never get it...cause that's thing which absolutely necessary to learn. Don't get me wrong but things like: `becoming a professional within 21 days` does not work(I'm working for 30 years their and learning continuously). Also you need to do some development in Java otherwise you won't understand the concepts. – khmarbaise Dec 27 '17 at 18:53
  • @khmarbaise I absolutely agree with you, thank you. I've just post my question only to verify/prove my opinion about, so exactly the same. I've told to him, but he doesn't realize the complexity. I really don't like these experiments... Thank you for your time and opinion! – LocalOps Dec 27 '17 at 20:27

2 Answers2

0

You can do this by adding the distributionManagement section to your pom.xml file.

<project ...>

  ...

  <distributionManagement>
    <snapshotRepository>
      <id>nexus-snapshots</id>
      <url>http://your-host:8081/repository/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>nexus-releases</id>
      <url>http://your-host:8081/repository/maven-releases/</url>
    </repository>
  </distributionManagement>
</project>

And add in Jenkins job to Maven(mvn) section:

deploy

Briefly:

More details here:

LocalOps
  • 21
  • 5