Skip to content

Commit

Permalink
Added host name to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatti committed Oct 25, 2018
1 parent 9c5affe commit 70ab588
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .circleci/orb/orb-inline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ orbs:
- attach_workspace:
at: /tmp/workspace
- run: cp apkpure_app_887.apk /tmp/workspace/test.apk
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/0.7.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-0.7 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/0.8.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-0.8 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- persist_to_workspace:
root: /tmp/workspace
paths:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/orb/orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ commands:
steps:
- attach_workspace:
at: /tmp/workspace
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/0.7.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-0.7 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/0.8.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-0.8 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- persist_to_workspace:
root: /tmp/workspace
paths:
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/java/com/nowsecure/auto/circleci/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ private void parseArgs(String[] args) {

@Override
public void info(String msg) {
System.out.println(new Date() + " " + PLUGIN_NAME + " v" + IOHelper.getVersion() + " " + msg);
System.out.println(new Date() + "@" + IOHelper.LOCAL_HOST + ":" + PLUGIN_NAME + " v" + IOHelper.getVersion() + " " + msg);
}

@Override
public void error(String msg) {
System.err.println(new Date() + " " + PLUGIN_NAME + " v" + IOHelper.getVersion() + " " + msg);
System.err.println(new Date() + "@" + IOHelper.LOCAL_HOST + ":" + PLUGIN_NAME + " v" + IOHelper.getVersion() + " " + msg);
}
}
9 changes: 9 additions & 0 deletions src/main/java/com/nowsecure/auto/utils/IOHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileVisitOption;
Expand All @@ -30,6 +31,14 @@ public class IOHelper implements IOHelperI {
private static final String POST = "POST";
private String pluginName;
private int timeout;
public static String LOCAL_HOST = "127.0.0.1";
static {
try {
InetAddress inetAddress = InetAddress.getLocalHost();
LOCAL_HOST = inetAddress.getHostName();
} catch (Exception e) {
}
}

public IOHelper(String pluginName, int timeout) {
this.pluginName = pluginName;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7
0.8

0 comments on commit 70ab588

Please sign in to comment.