-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove wrong indexer Signed-off-by: andrei_varabyeu <[email protected]> * add k8s configs Signed-off-by: andrei_varabyeu <[email protected]> * add k8s configs Signed-off-by: andrei_varabyeu <[email protected]> * add postman test example Signed-off-by: andrei_varabyeu <[email protected]> * EPMRPP-40125 || Plugin instance removing fix. Plugin-related jobs update (#911) * Plugin instance removing fix. Plugin-related jobs update * Plugins directories creation impl * Plugins data store uploading fix * Junit tests update * update analyzer info contributor (#910) * change error type on bid creation (#912) * EPMRPP-40285 || Project level integration validation fix (#914) * Project level integration validation fix * Junit tests fix * backward compatibility updates (#909) * handle attributes without key on sending notification (#913) * EPMRPP-40470 || Bts integrations validation update (#915) * Bts integrations validation update * Junit tests update * cover few tests * update deps * Tests (#916) * cover few tests * update deps * update release versions
- Loading branch information
Showing
38 changed files
with
502 additions
and
181 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build/ | ||
#!build/libs/ | ||
out/ | ||
.gradle/ | ||
.gradle/ | ||
.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,103 @@ | ||
#!groovy | ||
|
||
//String podTemplateConcat = "${serviceName}-${buildNumber}-${uuid}" | ||
def label = "worker-${UUID.randomUUID().toString()}" | ||
println("label") | ||
println("${label}") | ||
|
||
podTemplate( | ||
label: "${label}", | ||
containers: [ | ||
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:alpine'), | ||
containerTemplate(name: 'docker', image: 'docker:dind', ttyEnabled: true, alwaysPullImage: true, privileged: true, | ||
command: 'dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay', | ||
resourceRequestCpu: '500m', | ||
resourceLimitCpu: '800m', | ||
resourceRequestMemory: '2048Mi', | ||
resourceLimitMemory: '2048Mi'), | ||
// containerTemplate(name: 'jdk', image: 'quay.io/reportportal/openjdk-8-alpine-nonroot', command: 'cat', ttyEnabled: true), | ||
// containerTemplate(name: 'gradle', image: 'quay.io/reportportal/gradle-nonroot', command: 'cat', ttyEnabled: true), | ||
// containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.8.8', command: 'cat', ttyEnabled: true), | ||
containerTemplate(name: 'helm', image: 'lachlanevenson/k8s-helm:latest', command: 'cat', ttyEnabled: true) | ||
], | ||
imagePullSecrets: ["regcred"], | ||
volumes: [ | ||
emptyDirVolume(memory: false, mountPath: '/var/lib/docker'), | ||
secretVolume(mountPath: '/etc/.dockercreds', secretName: 'docker-creds'), | ||
// hostPathVolume(mountPath: '/home/gradle/.gradle', hostPath: '/tmp/jenkins/gradle') | ||
] | ||
) { | ||
|
||
node("${label}") { | ||
|
||
properties([ | ||
pipelineTriggers([ | ||
pollSCM('H/10 * * * *') | ||
]) | ||
]) | ||
|
||
stage('Configure') { | ||
container('docker') { | ||
sh 'echo "Initialize environment"' | ||
sh """ | ||
QUAY_USER=\$(cat "/etc/.dockercreds/username") | ||
cat "/etc/.dockercreds/password" | docker login -u \$QUAY_USER --password-stdin quay.io | ||
""" | ||
} | ||
} | ||
parallel 'Checkout Infra': { | ||
stage('Checkout Infra') { | ||
sh 'mkdir -p ~/.ssh' | ||
sh 'ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts' | ||
dir('kubernetes') { | ||
git branch: "v5", url: 'https://github.com/reportportal/kubernetes.git' | ||
|
||
} | ||
} | ||
}, 'Checkout Service': { | ||
stage('Checkout Service') { | ||
dir('app') { | ||
checkout scm | ||
} | ||
} | ||
} | ||
|
||
|
||
// dir('app') { | ||
// try { | ||
// container('docker') { | ||
// stage('Build App') { | ||
// sh "gradle build --full-stacktrace" | ||
// } | ||
// } | ||
// } finally { | ||
// junit 'build/test-results/**/*.xml' | ||
// dependencyCheckPublisher pattern: 'build/reports/dependency-check-report.xml' | ||
// | ||
// } | ||
// | ||
// } | ||
|
||
stage('Build Docker Image') { | ||
dir('app') { | ||
container('docker') { | ||
container('docker') { | ||
version = """${ | ||
sh( | ||
returnStdout: true, | ||
script: 'cat gradle.properties | grep "version" | cut -d "=" -f2' | ||
) | ||
}""".trim() | ||
image = "quay.io/reportportal/service-api:${version}-BUILD-${env.BUILD_NUMBER}" | ||
sh "docker build -f docker/Dockerfile-develop -t $image ." | ||
sh "docker push $image" | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
} | ||
} | ||
} | ||
|
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
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 @@ | ||
FROM openjdk:8-jre | ||
|
||
LABEL maintainer="Andrei Varabyeu <[email protected]>" | ||
LABEL version="@version@" | ||
LABEL description="@description@" | ||
|
||
ENV APP_FILE @name@-@version@ | ||
ENV APP_DOWNLOAD_URL https://dl.bintray.com/epam/reportportal/com/epam/reportportal/@name@/@version@/$APP_FILE.jar | ||
ENV JAVA_OPTS="-Xmx1g -Djava.security.egd=file:/dev/./urandom" | ||
ENV JAVA_APP=/app.jar | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y fonts-noto && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN sh -c "echo '#!/bin/sh \n\ | ||
exec java $JAVA_OPTS -jar $JAVA_APP' > /start.sh && chmod +x /start.sh" | ||
|
||
VOLUME /tmp | ||
|
||
COPY build/libs/service-api.jar /app.jar | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/start.sh"] |
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 |
---|---|---|
|
@@ -5,17 +5,21 @@ RUN apk add --no-cache ca-certificates git curl font-noto | |
RUN addgroup -S -g 1000 rp-builder | ||
RUN adduser -D -S -G rp-builder -u 1000 -s /bin/ash rp-builder | ||
|
||
USER rp-builder | ||
WORKDIR /home/rp-builder | ||
|
||
COPY gradle/ ./gradle | ||
COPY gradlew . | ||
COPY build-quality.gradle build.gradle gradlew settings.gradle gradle.properties ./ | ||
COPY . ./ | ||
|
||
RUN chown -R rp-builder:rp-builder ./ | ||
USER rp-builder | ||
### Copy gradle wrapper's stuff to init and cache gradle wrapper | ||
COPY --chown=rp-builder gradle/ ./gradle/ | ||
COPY --chown=rp-builder gradlew* ./ | ||
RUN ./gradlew wrapper | ||
|
||
### Copy gradle build files to resolve and cache dependencies | ||
COPY --chown=rp-builder *.gradle gradle.properties ./ | ||
RUN ./gradlew resolveDependencies --stacktrace | ||
|
||
### Copy source and run build | ||
COPY --chown=rp-builder src/ ./src/ | ||
COPY --chown=rp-builder .git/ .git/ | ||
RUN ./gradlew build --full-stacktrace | ||
|
||
RUN mkdir -p /home/rp-builder/plugins | ||
|
@@ -24,9 +28,17 @@ RUN curl -o /home/rp-builder/plugins/RALLY.jar https://jitpack.io/com/github/rep | |
|
||
FROM openjdk:8-jre-slim | ||
|
||
ARG version | ||
|
||
### Set quay.io image cache. Since the build is for development only, | ||
### there is no need to keep them forever | ||
### details: https://support.coreos.com/hc/en-us/articles/115001384693-Tag-Expiration | ||
LABEL quay.expires-after=1w | ||
|
||
LABEL maintainer="Andrei Varabyeu <[email protected]>" | ||
LABEL version="@version@" | ||
LABEL description="@description@" | ||
LABEL version=${version} | ||
LABEL description="ReportPortal API Service: Development Version" | ||
|
||
|
||
ENV JAVA_OPTS="-Xmx1g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djava.security.egd=file:/dev/./urandom -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" | ||
ENV JAVA_APP=/app.jar | ||
|
@@ -50,4 +62,4 @@ RUN sh -c 'touch /app.jar' | |
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT /start.sh | ||
ENTRYPOINT /start.sh |
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,7 @@ | ||
FROM gradle:5.4.1-jdk8-alpine | ||
|
||
USER root | ||
RUN apk add --no-cache ca-certificates git curl font-noto | ||
|
||
USER gradle | ||
|
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,48 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "1c81a0f3-8beb-4317-8749-0d506c95eac8", | ||
"name": "service-api", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "GET Info", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "3e2613e1-567b-46da-a520-f54f5a7936f7", | ||
"exec": [ | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
"});", | ||
"", | ||
"pm.test(\"Build Version is Present\", function () {", | ||
" var jsonData = pm.response.json();", | ||
" pm.expect(jsonData.build.version).to.not.eq(undefined);", | ||
"});", | ||
"", | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "{{rp_url}}/api/info", | ||
"host": [ | ||
"{{rp_url}}" | ||
], | ||
"path": [ | ||
"api", | ||
"info" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} |
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
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
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
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Ivan Budayeu</a> | ||
|
@@ -51,8 +52,8 @@ public EntryCreatedRS uploadPlugin(MultipartFile pluginFile) { | |
BusinessRule.expect(newPluginFileName, StringUtils::isNotBlank) | ||
.verify(ErrorType.BAD_REQUEST_ERROR, "File name should be not empty."); | ||
|
||
try { | ||
IntegrationType integrationType = pluginBox.uploadPlugin(newPluginFileName, pluginFile.getInputStream()); | ||
try (InputStream inputStream = pluginFile.getInputStream()) { | ||
IntegrationType integrationType = pluginBox.uploadPlugin(newPluginFileName, inputStream); | ||
return new EntryCreatedRS(integrationType.getId()); | ||
} catch (IOException e) { | ||
throw new ReportPortalException(ErrorType.PLUGIN_UPLOAD_ERROR, "Error during file stream retrieving"); | ||
|
Oops, something went wrong.