Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Reinitialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Sierociński committed Jan 2, 2019
0 parents commit a7d76cd
Show file tree
Hide file tree
Showing 25 changed files with 2,137 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
# Build
target/

# IDE
.vscode/
.idea/
!.idea/codeStyleSettings.xml

# Logs
remoteadb-debug.log
22 changes: 22 additions & 0 deletions Dockerfile
@@ -0,0 +1,22 @@
FROM ubuntu:16.04

ARG PLATFORM_TOOLS_VERSION=r28.0.1
ARG PLATFORM_TOOLS_URL=https://nexus.wro.int.bitbar.com/repository/raw-hosted/android/platform-tools_${PLATFORM_TOOLS_VERSION}-linux.zip

ADD ${PLATFORM_TOOLS_URL} /platform-tools_${PLATFORM_TOOLS_VERSION}-linux.zip

RUN apt-get update && \
apt-get install -y --no-install-recommends unzip && \
rm -rf /var/lib/apt/lists/*

RUN unzip -j -d /usr/bin /platform-tools_${PLATFORM_TOOLS_VERSION}-linux.zip platform-tools/adb && \
rm /platform-tools_${PLATFORM_TOOLS_VERSION}-linux.zip
RUN chmod +x /usr/bin/adb

RUN /usr/bin/adb version

RUN echo "#!/bin/bash" >/usr/local/bin/entrypoint.sh
RUN echo "exec \$@" >>/usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
24 changes: 24 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,24 @@
#!/usr/bin/env groovy

node('linux && maven') {
ansiColor('xterm') {
stage('Checkout') {
git([
url: 'https://github.com/bitbar/remote-device-client.git',
poll: true
])
}

stage('Build') {
sh('mvn clean package')
}

stage('Results') {
junit([
testResults: 'target/surefire-reports/TEST-*.xml',
allowEmptyResults: true
])
archiveArtifacts 'target/*.jar'
}
}
}
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions README.md
@@ -0,0 +1,59 @@
# Bitbar Remote Device Client

[![Language grade](https://img.shields.io/lgtm/grade/java/g/bitbar/remote-device-client.svg)](https://lgtm.com/projects/g/bitbar/remote-device-client/context:java)
[![Current Release](https://img.shields.io/github/release/bitbar/remote-device-client.svg)](https://github.com/bitbar/remote-device-client/releases)
[![License](https://img.shields.io/github/license/bitbar/remote-device-client.svg)](https://github.com/bitbar/remote-device-client/blob/master/LICENSE)

## Usage

**Run syntax**

```sh
java -jar <JAR_WITH_DEPENDENCIES_PATH> \
-cloudurl <BACKEND_URL> \
-apikey <APIKEY> \
-device <DEVICE_MODEL_ID> \
<COMMAND>
```

**Parameters**

- `cloudurl` \
URL to Bitbar Testing backend
- `apikey` \
api key used to authenticate with Bitbar Testing
- `device` \
id of device model to connect

**Commands**

- `devices` \
display list of available devices which have remote device enabled
- `connect` \
connect to a device, requires `-device` option

**Example**

```sh
java -jar remote-device-client.jar \
-cloudurl https://cloud.bitbar.com/cloud \
-apikey XXXXXXX \
-device 172 \
connect
```


## Running With Maven

Use the `exec:java` goal and `-Dexec.args` to pass arguments.

**Example**

```sh
mvn compile exec:java "-Dexec.args=-cloudurl https://cloud.bitbar.com/cloud -apikey XXXXXXXX -device 209 connect"
```


## License

This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
127 changes: 127 additions & 0 deletions pom.xml
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>Bitbar Remote Device Client</name>
<description>Bitbar Remote Device Client</description>
<url>https://github.com/bitbar/remote-device-client</url>

<groupId>com.bitbar</groupId>
<artifactId>remote-device-client</artifactId>
<version>0.3</version>
<packaging>jar</packaging>

<properties>
<java.version>1.8</java.version>
<testdroid-api.version>2.67</testdroid-api.version>
<jackson.version>2.6.0</jackson.version>
<spring.version>4.3.8.RELEASE</spring.version>
<cli.version>1.3.1</cli.version>
<jsch.version>0.1.54</jsch.version>
<springboot.version>2.0.4.RELEASE</springboot.version>
<slf4j.version>1.7.13</slf4j.version>
</properties>

<dependencies>
<dependency>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>${testdroid-api.version}</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>${jsch.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<version>${springboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${cli.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.bitbar.remotedevice.RemoteDeviceClientMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.bitbar.remotedevice.RemoteDeviceClientMain</mainClass>
</configuration>
</plugin>
</plugins>
</build>

</project>

0 comments on commit a7d76cd

Please sign in to comment.