-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from UTSCCSCC01/dev
Dev
- Loading branch information
Showing
16 changed files
with
1,269 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
NEO4J_ADDR=localhost |
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,29 @@ | ||
name: app-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- master | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
working-directory: . | ||
|
||
jobs: | ||
apptests: | ||
name: Tests | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 16 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 16 | ||
- name: Clean db before tests | ||
run: delete_all_nodes | ||
- name: Run mvn test | ||
run: mvn test | ||
- name: Clean db after tests | ||
run: delete_all_nodes |
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,6 @@ | ||
/target/ | ||
.settings | ||
.classpath | ||
.factorypath | ||
.project | ||
.idea |
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,8 @@ | ||
FROM maven:3.6.3-openjdk-16 | ||
|
||
WORKDIR /root/.m2/repository | ||
COPY . ./ | ||
RUN mvn verify clean --fail-never | ||
RUN mvn compile; sleep 15 | ||
ENTRYPOINT [ "mvn","exec:java" ] | ||
EXPOSE 8000 |
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,24 @@ | ||
version: "3.7" | ||
services: | ||
assignment: | ||
container_name: a1 | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
depends_on: | ||
- neo4j | ||
ports: | ||
- '8080:8080' | ||
environment: | ||
- NEO4J_ADDR=neo4j | ||
- HTTP_PROXY="http://cms-proxy.utsc.utoronto.ca:8118/" | ||
- HTTPS_PROXY="http://cms-proxy.utsc.utoronto.ca:8118/" | ||
- NO_PROXY=".utsc.utoronto.ca,.utoronto.ca,127.0.0.0/8" | ||
neo4j: | ||
container_name: neo4j | ||
#platform: linux/amd64 | ||
image: neo4j:latest | ||
environment: | ||
- NEO4J_AUTH=neo4j/123456 | ||
ports: | ||
- '7687:7687' |
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,90 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>ca.utoronto.utm.mcs</groupId> | ||
<artifactId>a1</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>a1</name> | ||
<url>http://maven.apache.org</url> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.7.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.dagger</groupId> | ||
<artifactId>dagger</artifactId> | ||
<version>2.35.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.neo4j.driver</groupId> | ||
<artifactId>neo4j-java-driver</artifactId> | ||
<version>4.3.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20090211</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.github.cdimascio</groupId> | ||
<artifactId>dotenv-java</artifactId> | ||
<version>2.2.0</version> | ||
</dependency> | ||
</dependencies> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.release>16</maven.compiler.release> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.0.0-M4</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<release>16</release> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>com.google.dagger</groupId> | ||
<artifactId>dagger-compiler</artifactId> | ||
<version>2.35.1</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<mainClass>ca.utoronto.utm.mcs.App</mainClass> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.0</version> | ||
<configuration> | ||
<argLine>--enable-preview</argLine> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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,26 @@ | ||
package ca.utoronto.utm.mcs; | ||
|
||
import io.github.cdimascio.dotenv.Dotenv; | ||
import java.io.IOException; | ||
|
||
public class App | ||
{ | ||
static int port = 8080; | ||
|
||
public static void main(String[] args) throws IOException | ||
{ | ||
ReqHandlerComponent handlerComponent = DaggerReqHandlerComponent.create(); | ||
ServerComponent serverComponent = DaggerServerComponent.create(); | ||
Server server = serverComponent.buildServer(); | ||
server.createContext("/api/v1/", handlerComponent.buildHandler()); | ||
server.startServer(); | ||
|
||
// TODO Create Your Server Context Here, There Should Only Be One Context | ||
System.out.printf("Server started on port %d\n", port); | ||
|
||
// This code is used to get the neo4j address, you must use this so that we can mark :) | ||
Dotenv dotenv = Dotenv.load(); | ||
String addr = dotenv.get("NEO4J_ADDR"); | ||
System.out.println(addr); | ||
} | ||
} |
Oops, something went wrong.