From 7f2685114509094e67610c60e1302d5f57fc0623 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Wed, 5 Jun 2024 18:06:40 +0800 Subject: [PATCH 1/2] Deploy files as lvuser not admin Resolves https://github.com/wpilibsuite/GradleRIO/issues/408 --- .../java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java index 049642c4..a7d9b889 100644 --- a/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java +++ b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java @@ -95,7 +95,7 @@ public void setAddresses(String... addresses) { } getLocations().create("ds", DSDeployLocation.class, ds -> { - ds.setUser("admin"); + ds.setUser("lvuser"); ds.setPassword(""); ds.setIpv6(false); }); @@ -105,7 +105,7 @@ public void addAddress(String address) { getLocations().create(address, SshDeployLocation.class, loc -> { loc.setAddress(address); loc.setIpv6(false); - loc.setUser("admin"); + loc.setUser("lvuser"); loc.setPassword(""); }); } From 67f9c1a556449831776e2e09688c3db4f2de321f Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Thu, 6 Jun 2024 19:23:34 +0800 Subject: [PATCH 2/2] Use a custom artifact instead --- .../deploy/roborio/FRCFileTreeArtifact.java | 16 ++++++++++++++++ .../first/gradlerio/deploy/roborio/RoboRIO.java | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/main/java/edu/wpi/first/gradlerio/deploy/roborio/FRCFileTreeArtifact.java diff --git a/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/FRCFileTreeArtifact.java b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/FRCFileTreeArtifact.java new file mode 100644 index 00000000..ec6915ab --- /dev/null +++ b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/FRCFileTreeArtifact.java @@ -0,0 +1,16 @@ +package edu.wpi.first.gradlerio.deploy.roborio; + +import javax.inject.Inject; + +import edu.wpi.first.deployutils.deploy.artifact.FileTreeArtifact; + +public class FRCFileTreeArtifact extends FileTreeArtifact { + @Inject + FRCFileTreeArtifact(String name, RoboRIO target) { + super(name, target); + + getPostdeploy().add(ctx -> { + ctx.execute("chown lvuser \"" + getFiles().get().toString() + "\""); + }); + } +} diff --git a/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java index a7d9b889..049642c4 100644 --- a/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java +++ b/src/main/java/edu/wpi/first/gradlerio/deploy/roborio/RoboRIO.java @@ -95,7 +95,7 @@ public void setAddresses(String... addresses) { } getLocations().create("ds", DSDeployLocation.class, ds -> { - ds.setUser("lvuser"); + ds.setUser("admin"); ds.setPassword(""); ds.setIpv6(false); }); @@ -105,7 +105,7 @@ public void addAddress(String address) { getLocations().create(address, SshDeployLocation.class, loc -> { loc.setAddress(address); loc.setIpv6(false); - loc.setUser("lvuser"); + loc.setUser("admin"); loc.setPassword(""); }); }