Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target
.vagrant
*.iml
.buildx
.idea
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.fizzed</groupId>
<artifactId>maven-parent</artifactId>
<version>2.7.0</version>
<version>3.4.0</version>
</parent>

<scm>
Expand All @@ -25,7 +25,7 @@
<maven.enforce.version>3.2.5</maven.enforce.version>
<jackson.version>2.14.1</jackson.version>
<slf4j.version>1.7.21</slf4j.version>
<blaze.version>1.6.0</blaze.version>
<blaze.version>2.0.0</blaze.version>
<crux.version>1.0.48</crux.version>
</properties>

Expand Down
35 changes: 21 additions & 14 deletions stork-deploy/src/main/java/com/fizzed/stork/deploy/UnixTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,36 @@ public Path realpath(Object path) {

@Override
public void chown(boolean sudo, boolean recursive, String owner, String target) {
String options = "";
final List<Object> args = new ArrayList<>();
args.add("chown");

if (recursive) {
options = "-R";
args.add("-R");
}

sshExec(sudo, false, "chown", options, owner, target).run();
args.add(owner);
args.add(target);

this.sshExec(sudo, false, args.toArray())
.run();

log.info("Set owner to {} for {}", owner, target);
}

@Override
public void chmod(boolean sudo, boolean recursive, String permissions, String target) {
String options = "";
final List<Object> args = new ArrayList<>();
args.add("chmod");

if (recursive) {
options = "-R";
args.add("-R");
}

sshExec(sudo, false, "chmod", options, permissions, target).run();
args.add(permissions);
args.add(target);

this.sshExec(sudo, false, args.toArray())
.run();

log.info("Set perms to {} for {}", permissions, target);
}
Expand Down Expand Up @@ -159,7 +171,7 @@ public Integer getUserId(String user) {
try {
String userId
= sshExec(false, false, "id", "-u", user)
.pipeOutput(Streamables.captureOutput())
.pipeOutput(Streamables.captureOutput(false))
.pipeError(Streamables.nullOutput())
.runResult()
.map(Actions::toCaptureOutput)
Expand All @@ -180,7 +192,7 @@ public Integer getGroupId(String group) {
try {
String groupId
= sshExec(false, false, "id", "-g", group)
.pipeOutput(Streamables.captureOutput())
.pipeOutput(Streamables.captureOutput(false))
.pipeError(Streamables.nullOutput())
.runResult()
.map(Actions::toCaptureOutput)
Expand Down Expand Up @@ -264,7 +276,7 @@ public void startDaemon(Daemon daemon) throws DeployerException {
// run a status command so user can see what's up
String output
= sshExec(true, false, "systemctl", "status", daemon.getName())
.pipeOutput(Streamables.captureOutput())
.pipeOutput(Streamables.captureOutput(false))
.runResult()
.map(Actions::toCaptureOutput)
.asString();
Expand Down Expand Up @@ -376,12 +388,7 @@ private void installSysvDaemon(Deployment install, Daemon daemon, boolean onBoot
}

private void installSystemdDaemon(Deployment install, Daemon daemon, boolean onBoot) {


// upload modified file to target, then copy it over



String sourceServiceFile = install.getCurrentDir() + "/share/systemd/" + daemon.getName() + ".service";
String serviceFile = "/etc/systemd/system/" + daemon.getName() + ".service";
copyFiles(true, sourceServiceFile, serviceFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ public String execute(int exitValue, Path exe, Map<String,String> environment, S

exec.run();
} else {
SshExec exec
= SecureShells.sshExec(ssh)
SshExec exec = (SshExec)SecureShells.sshExec(ssh)
.command(exe)
.args((Object[]) args)
.exitValue(exitValue)
Expand Down
Loading