Package org.platformlayer.service.nexus.ops

Source Code of org.platformlayer.service.nexus.ops.NexusApp

package org.platformlayer.service.nexus.ops;

import java.io.File;
import java.io.IOException;

import org.platformlayer.ops.Handler;
import org.platformlayer.ops.Injection;
import org.platformlayer.ops.OpsContext;
import org.platformlayer.ops.OpsException;
import org.platformlayer.ops.OpsTarget;

public class NexusApp {
  @Handler
  public void handler() throws IOException, OpsException {
    // TODO: This needs to be idempotent
    OpsTarget target = OpsContext.get().getInstance(OpsTarget.class);

    String url = "http://nexus.sonatype.org/downloads/all/nexus-webapp-1.9.2.4.war";
    File warFile = new File("/var/lib/jetty/wars/nexus-webapp-1.9.2.4.war");

    target.executeCommand("wget {0} -O {1}", url, warFile);

    // Whatever version of nexus we have, we want it to be the root
    target.symlink(warFile, new File("/var/lib/jetty/webapps/root.war"), false);
  }

  public static NexusApp build() {
    return Injection.getInstance(NexusApp.class);
  }
}
TOP

Related Classes of org.platformlayer.service.nexus.ops.NexusApp

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.