Coder Social home page Coder Social logo

sample-maven-step's Introduction

Wercker Maven Step Sample

This repository contains a sample application that demonstrates how to use the Wercker Maven Step.

The example wercker.yml below demonstrates the basic usage of the Wercker Maven Step. There are a few interesting things to note:

  • You can run the step more than once, as shown in the rather contrived example below of running compile in one step and then install in another. A more realistic use of this may be to run a separate profile that performs deployment (copies built artifacts into some well known location for example).

  • If you run the step more than once, you can set the cache_repo: true property as shown below. This will put the Maven local repository into the Wercker cache, meaning it will be available in subsequent builds. If you run this build twice over and pay careful attention to what Maven downloads each time, you will notice that in the first build, the first step downloads the plugins and dependencies needed to clean and compile, and the second step downloads those needed to install (and other phases in between). The second build will not need to download anything becuase the required JARs are already in the repository.

  • The first script steps installs the extra dependencies needed to run this step, which are not in the image/box I am using here.

  • If you look carefully at the output of the build, you will see that Maven is only installed if it is not already present. The step will use Maven if it finds it installed in /maven but it is recommended to let the step install it itself in order to minimize image size.

box:
  id: store/oracle/serverjre
  username: $DOCKER_USERNAME
  password: $DOCKER_PASSWORD
  tag: 8

test-with-wercker-cache:
  steps:
    - script:
      name: Install pre-reqs
      code: |
        yum -y install tar gzip
    - java/maven:
      goals: clean compile
      cache_repo: true
    - java/maven:
      goals: install
      cache_repo: true
    # you should push your image now :)
    #  - internal/docker-push:
    #    repository: quay.io/myuser/myapp
    #    tag: 1.0.0

sample-maven-step's People

Contributors

markxnelson avatar sanjeevk1410 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.