Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Publish Docker image
name: Publish Docker Image

env:
EUREKA_IMAGE: aldeeyar/innometrics-eureka:${{ github.sha }}
AUTH_IMAGE: aldeeyar/innometrics-auth:${{ github.sha }}
CONFIG_IMAGE: aldeeyar/innometrics-config:${{ github.sha }}
COLLECTOR_IMAGE: aldeeyar/innometrics-collector:${{ github.sha }}
API_IMAGE: aldeeyar/innometrics-api:${{ github.sha }}
AGENTS_IMAGE: aldeeyar/innometrics-agents:${{ github.sha }}

on:
push:
branches:
- 'main'
- 'master'
- 'ci'

jobs:
Expand Down Expand Up @@ -74,7 +82,7 @@ jobs:
context: .
file: ./eureka-server/Dockerfile
push: true
tags: aldeeyar/innometrics-eureka:latest
tags: ${{ env.EUREKA_IMAGE }}
build-args: |
JAR_FILE=./eureka-server/target/innometrics-eureka-server.jar

Expand All @@ -84,7 +92,7 @@ jobs:
context: .
file: ./auth-server/Dockerfile
push: true
tags: aldeeyar/innometrics-auth:latest
tags: ${{ env.AUTH_IMAGE }}
build-args: |
JAR_FILE=./auth-server/target/innometrics-auth-server.jar

Expand All @@ -94,7 +102,7 @@ jobs:
context: .
file: ./config-service/Dockerfile
push: true
tags: aldeeyar/innometrics-config:latest
tags: ${{ env.CONFIG_IMAGE }}
build-args: |
JAR_FILE=./config-service/target/innometrics-config-service.jar

Expand All @@ -104,7 +112,7 @@ jobs:
context: .
file: ./activities-collector/Dockerfile
push: true
tags: aldeeyar/innometrics-collector:latest
tags: ${{ env.COLLECTOR_IMAGE }}
build-args: |
JAR_FILE=./activities-collector/target/InnoMetrics-Collector-Server.jar

Expand All @@ -114,7 +122,7 @@ jobs:
context: .
file: ./InnoMetrics-RestAPI/Dockerfile
push: true
tags: aldeeyar/innometrics-api:latest
tags: ${{ env.API_IMAGE }}
build-args: |
JAR_FILE=./InnoMetrics-RestAPI/target/InnoMetrics-RestAPI.jar

Expand All @@ -124,6 +132,6 @@ jobs:
context: .
file: ./agents-gateway/Dockerfile
push: true
tags: aldeeyar/innometrics-agents:latest
tags: ${{ env.AGENTS_IMAGE }}
build-args: |
JAR_FILE=./agents-gateway/target/InnoMetrics-Agents-gateway.jar
JAR_FILE=./agents-gateway/target/InnoMetrics-Agents-gateway.jar
2 changes: 1 addition & 1 deletion InnoMetrics-RestAPI/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:8
ARG JAR_FILE
ADD $JAR_FILE InnoMetrics-RestAPI.jar
EXPOSE 9091
ENTRYPOINT ["java", "-jar", "InnoMetrics-RestAPI.jar", "--spring.profiles.active=dev"]
ENTRYPOINT ["java", "-jar", "InnoMetrics-RestAPI.jar", "--spring.profiles.active=prod"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
security.require-ssl=true
server.ssl.key-store=/etc/Certificates/keystore.p12
server.ssl.key-store-password= InnoMetrics
server.ssl.keyStoreType= PKCS12
server.ssl.keyAlias= tomcat
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/
spring.datasource.password = 1nn0M3tr1c5
# security.require-ssl=true
# server.ssl.key-store=/etc/Certificates/keystore.p12
# server.ssl.key-store-password= InnoMetrics
# server.ssl.keyStoreType= PKCS12
# server.ssl.keyAlias= tomcat
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
spring.datasource.url = jdbc:postgresql://84.201.133.60:5432/postgres
spring.datasource.password = password
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ server.ssl.key-store-password= InnoMetrics
server.ssl.keyStoreType= PKCS12
server.ssl.keyAlias= tomcat
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/
spring.datasource.password = 1nn0M3tr1c5
spring.datasource.url = jdbc:postgresql://51.250.97.30:5432/postgres
spring.datasource.password = password
2 changes: 1 addition & 1 deletion activities-collector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:8
ARG JAR_FILE
ADD $JAR_FILE InnoMetrics-Collector-Server.jar
EXPOSE 9093
ENTRYPOINT ["java", "-jar", "InnoMetrics-Collector-Server.jar", "--spring.profiles.active=dev"]
ENTRYPOINT ["java", "-jar", "InnoMetrics-Collector-Server.jar", "--spring.profiles.active=prod"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/postgres
spring.datasource.password = 1nn0M3tr1c5
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
spring.datasource.url = jdbc:postgresql://84.201.133.60:5432/postgres
spring.datasource.username = postgres
spring.datasource.password = password
6 changes: 3 additions & 3 deletions agents-gateway/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ server.ssl.key-store=/etc/Certificates/keystore.p12
server.ssl.key-store-password= InnoMetrics
server.ssl.keyStoreType= PKCS12
server.ssl.keyAlias= tomcat
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/
spring.datasource.password = 1nn0M3tr1c5
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
spring.datasource.url = jdbc:postgresql://84.201.133.60:5432/postgres
spring.datasource.password = password
innometrics.oauth1a.default-callback=https://innometric.guru:9094/AgentGateway/OAuth/
innometrics.oauth20.default-callback=https://innometric.guru:9094/AgentGateway/OAuth20/
innometrics.oauthSimple.default-callback=https://innometric.guru:9094/AgentGateway/Simple/
Original file line number Diff line number Diff line change
Expand Up @@ -631,39 +631,39 @@ public void testCRUDData() throws Exception {
.andExpect(status().isNotFound());
}

@Test
public void testGetCreateSeveralData() throws Exception {
DataConfigDTO dataConfigDTO = createDataConfigDTO();
String requestJson = getJSON(dataConfigDTO);
// @Test
// public void testGetCreateSeveralData() throws Exception {
// DataConfigDTO dataConfigDTO = createDataConfigDTO();
// String requestJson = getJSON(dataConfigDTO);

String jsonString = mockMvc.perform(get("/AgentAdmin/AgentData")
.accept(APPLICATION_JSON))
.andExpect(status().isOk())
.andReturn()
.getResponse()
.getContentAsString();
// String jsonString = mockMvc.perform(get("/AgentAdmin/AgentData")
// .accept(APPLICATION_JSON))
// .andExpect(status().isOk())
// .andReturn()
// .getResponse()
// .getContentAsString();

int initialSize = StringUtils.countMatches(jsonString, "datacofingid");
// int initialSize = StringUtils.countMatches(jsonString, "datacofingid");

int count = 5;
for (int i = 0; i < count; i++) {
mockMvc.perform(post("/AgentAdmin/AgentData")
.contentType(APPLICATION_JSON)
.content(requestJson))
.andExpect(status().isCreated());
}
// int count = 5;
// for (int i = 0; i < count; i++) {
// mockMvc.perform(post("/AgentAdmin/AgentData")
// .contentType(APPLICATION_JSON)
// .content(requestJson))
// .andExpect(status().isCreated());
// }

jsonString = mockMvc.perform(get("/AgentAdmin/AgentData")
.accept(APPLICATION_JSON))
.andExpect(status().isOk())
.andReturn()
.getResponse()
.getContentAsString();
// jsonString = mockMvc.perform(get("/AgentAdmin/AgentData")
// .accept(APPLICATION_JSON))
// .andExpect(status().isOk())
// .andReturn()
// .getResponse()
// .getContentAsString();

int finalSize = StringUtils.countMatches(jsonString, "datacofingid");
// int finalSize = StringUtils.countMatches(jsonString, "datacofingid");

Assertions.assertEquals(count, finalSize - initialSize);
}
// Assertions.assertEquals(count, finalSize - initialSize);
// }

/**
* Table: agentconfigmethods
Expand Down
2 changes: 1 addition & 1 deletion auth-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:8
ARG JAR_FILE
ADD $JAR_FILE innometrics-auth-server.jar
EXPOSE 9092
ENTRYPOINT ["java", "-jar", "innometrics-auth-server.jar", "--spring.profiles.active=dev"]
ENTRYPOINT ["java", "-jar", "innometrics-auth-server.jar", "--spring.profiles.active=prod"]
6 changes: 3 additions & 3 deletions auth-server/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/
spring.datasource.password = 1nn0M3tr1c5
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
spring.datasource.url = jdbc:postgresql://84.201.133.60:5432/postgres
spring.datasource.password = password

2 changes: 1 addition & 1 deletion config-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM openjdk:8
ARG JAR_FILE
ADD $JAR_FILE innometrics-config-service.jar
EXPOSE 9094
ENTRYPOINT ["java", "-jar", "innometrics-config-service.jar", "--spring.profiles.active=dev"]
ENTRYPOINT ["java", "-jar", "innometrics-config-service.jar", "--spring.profiles.active=prod"]
6 changes: 3 additions & 3 deletions config-service/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
eureka.client.serviceUrl.defaultZone= http://innometrics-eureka-server:8761/eureka/
spring.datasource.url = jdbc:postgresql://InnoMetricsDB:5432/
spring.datasource.password = 1nn0M3tr1c5
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
spring.datasource.url = jdbc:postgresql://84.201.133.60:5432/postgres
spring.datasource.password = password
65 changes: 65 additions & 0 deletions yandex-cloud/docker-compose.yc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: "3.9"
services:
eureka:
image: {{ env.EUREKA_IMAGE }}
ports:
- "8761:8761"
healthcheck:
test: "curl --fail --silent localhost:8761/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
restart: always
auth:
depends_on:
- eureka
image: {{ env.AUTH_IMAGE }}
ports:
- "9092:9092"
healthcheck:
test: "curl --fail --silent localhost:9092/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
restart: always
api:
depends_on:
- eureka
image: {{ env.API_IMAGE }}
ports:
- "9091:9091"
healthcheck:
test: "curl --fail --silent localhost:9091/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
restart: always
config:
depends_on:
- eureka
image: {{ env.CONFIG_IMAGE}}
ports:
- "9094:9094"
healthcheck:
test: "curl --fail --silent localhost:9094/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
restart: always
collector:
depends_on:
- eureka
image: {{ env.COLLECTOR_IMAGE}}
ports:
- "9093:9093"
healthcheck:
test: "curl --fail --silent localhost:9093/actuator/health | grep UP || exit 1"
interval: 20s
timeout: 5s
retries: 5
start_period: 40s
restart: always