-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0615da6
commit ee4d3ec
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package edu.wpi.first.gradlerio.deploy; | ||
|
||
import com.google.gson.GsonBuilder; | ||
import com.google.gson.Gson; | ||
import java.util.Map; | ||
import java.util.HashMap; | ||
import java.io.File; | ||
|
||
class DeployLogFile { | ||
public String deployHost; | ||
public String deployUser; | ||
public String deployDate; | ||
public String codePath; | ||
public String gitHash; | ||
public String gitBranch; | ||
public String gitDesc; | ||
public static final String LOG_FILE_PATH = "/home/lvuser/deploy.json"; | ||
public String[] deployItems = { | ||
"deployHost", | ||
"deployUser", | ||
"deployDate", | ||
"codePath", | ||
"gitHash", | ||
"gitBranch", | ||
"gitDesc", | ||
}; | ||
|
||
Gson builder = new GsonBuilder().create(); | ||
Map<String, String> data = new HashMap<String, String>(); | ||
String jsonDeploy; | ||
File deployDotJson; | ||
|
||
DeployLogFile() { | ||
data.put(deployItems[0], deployHost); | ||
data.put(deployItems[1], deployUser); | ||
data.put(deployItems[2], deployDate); | ||
data.put(deployItems[3], codePath); | ||
data.put(deployItems[4], gitHash); | ||
data.put(deployItems[5], gitBranch); | ||
data.put(deployItems[6], gitDesc); | ||
|
||
jsonDeploy = builder.toJson(data); | ||
|
||
deployDotJson = new File(LOG_FILE_PATH); | ||
} | ||
} |