Skip to content

Commit

Permalink
Hotfix/5.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski committed Aug 16, 2023
2 parents 6892124 + b70a6b6 commit 5fd574d
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 191 deletions.
30 changes: 23 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
FROM alpine:latest
LABEL version=5.9.1 description="EPAM Report portal. Main API Service" maintainer="Andrei Varabyeu <andrei_varabyeu@epam.com>, Hleb Kanonik <hleb_kanonik@epam.com>"
ARG GH_TOKEN
RUN echo 'exec java ${JAVA_OPTS} -jar service-api-5.9.1-exec.jar' > /start.sh && chmod +x /start.sh && \
wget --header="Authorization: Bearer ${GH_TOKEN}" -q https://maven.pkg.github.com/reportportal/service-api/com/epam/reportportal/service-api/5.9.1/service-api-5.9.1-exec.jar
ENV JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
FROM gradle:6.8.3-jdk11 AS build
ARG BOM_VERSION MIGRATION_VERSION GITHUB_USER GITHUB_TOKEN RELEASE_MODE SCRIPTS_VERSION APP_VERSION
WORKDIR /usr/app
COPY . /usr/app
RUN if [ ${RELEASE_MODE} = true ]; then \
gradle build --exclude-task test \
-PreleaseMode=true \
-PgithubUserName=${GITHUB_USER} \
-PgithubToken=${GITHUB_TOKEN} \
-Pscripts.version=${SCRIPTS_VERSION} \
-Pmigrations.version=${MIGRATION_VERSION} \
-Pbom.version=${BOM_VERSION} \
-Dorg.gradle.project.version=${APP_VERSION}; \
else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi

# For ARM build use flag: `--platform linux/arm64`
FROM --platform=$BUILDPLATFORM amazoncorretto:11.0.19
LABEL version=${APP_VERSION} description="EPAM Report portal. Main API Service" maintainer="Andrei Varabyeu <andrei_varabyeu@epam.com>, Hleb Kanonik <hleb_kanonik@epam.com>"
ARG APP_VERSION=${APP_VERSION}
ENV APP_DIR=/usr/app JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
WORKDIR $APP_DIR
COPY --from=build $APP_DIR/build/libs/service-api-*exec.jar .
VOLUME ["/tmp"]
EXPOSE 8080
ENTRYPOINT ./start.sh
ENTRYPOINT exec java ${JAVA_OPTS} -jar ${APP_DIR}/service-api-*exec.jar
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies {
compile 'com.epam.reportportal:plugin-api'
} else {
compile 'com.github.reportportal:commons-events:f130879'
compile 'com.github.reportportal:commons-dao:c0d3d19'
compile 'com.github.reportportal:commons-dao:f71d0eb6'
compile 'com.github.reportportal:commons-rules:5.3.0'
compile 'com.github.reportportal:commons-model:292c8af2'
compile 'com.github.reportportal:commons:7480d61'
Expand Down Expand Up @@ -186,8 +186,6 @@ test {
}
}

addDockerfileToGit.dependsOn createDockerfile
beforeReleaseBuild.dependsOn addDockerfileToGit
publish.dependsOn build
publish.mustRunAfter build
checkCommitNeeded.dependsOn removeScripts
Expand Down
2 changes: 1 addition & 1 deletion project-properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project.ext {
dependencyRepos = ["commons-dao", "commons-rules", "commons-model", "commons", "commons-fonts", "plugin-api", "commons-bom"]
limits = [
'instruction': 70,
'branch' : 53,
'branch' : 51,
'line' : 74,
'complexity' : 60,
'method' : 65,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@

import com.epam.ta.reportportal.commons.ReportPortalUser;
import com.epam.ta.reportportal.ws.model.OperationCompletionRS;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;

/**
* @author Pavel_Bortnik
*/
public interface ImportLaunchHandler {

/**
* Import launch from file with specified format.
*
* @param projectDetails Project Details
* @param user user
* @param format report format
* @param file file with report
* @return OperationCompletionRS
*/
OperationCompletionRS importLaunch(ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user, String format, MultipartFile file, String baseUrl);
/**
* Import launch from file with specified format.
*
* @param projectDetails Project Details
* @param user user
* @param format report format
* @param file file with report
* @return OperationCompletionRS
*/
OperationCompletionRS importLaunch(ReportPortalUser.ProjectDetails projectDetails,
ReportPortalUser user, String format, MultipartFile file, String baseUrl,
Map<String, String> params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.epam.ta.reportportal.exception.ReportPortalException;
import com.epam.ta.reportportal.ws.model.ErrorType;
import com.epam.ta.reportportal.ws.model.OperationCompletionRS;
import java.util.Map;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -53,8 +54,9 @@ public ImportLaunchHandlerImpl(ImportStrategyFactory importStrategyFactory, Mess
}

@Override
public OperationCompletionRS importLaunch(ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user, String format,
MultipartFile file, String baseUrl) {
public OperationCompletionRS importLaunch(ReportPortalUser.ProjectDetails projectDetails,
ReportPortalUser user, String format,
MultipartFile file, String baseUrl, Map<String, String> params) {

validate(file);

Expand All @@ -68,7 +70,7 @@ public OperationCompletionRS importLaunch(ReportPortalUser.ProjectDetails projec
file.getOriginalFilename()
));
ImportStrategy strategy = importStrategyFactory.getImportStrategy(type, file.getOriginalFilename());
String launchId = strategy.importLaunch(projectDetails, user, tempFile, baseUrl);
String launchId = strategy.importLaunch(projectDetails, user, tempFile, baseUrl, params);
messageBus.publishActivity(new ImportFinishedEvent(user.getUserId(),
user.getUsername(),
projectDetails.getProjectId(),
Expand Down
Loading

0 comments on commit 5fd574d

Please sign in to comment.