Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
52 changes: 52 additions & 0 deletions .github/workflows/frogbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Frogbot"
on:
# After a pull request opened, Frogbot automatically creates the "🐸 frogbot scan" label if needed.
# After "🐸 frogbot scan" label was added to a pull request, Frogbot scans the pull request.
pull_request_target:
types: [labeled, opened]
jobs:
scan-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

# Install prerequisites
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"

- uses: jfrog/frogbot@v1
env:
# [Mandatory]
# JFrog platform URL
JF_URL: ${{ secrets.JF_URL }}

# [Mandatory if JF_ACCESS_TOKEN is not provided]
# JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD
# JF_USER: ${{ secrets.JF_USER }}

# [Mandatory if JF_ACCESS_TOKEN is not provided]
# JFrog password. Must be provided with JF_USER
# JF_PASSWORD: ${{ secrets.JF_PASSWORD }}

# [Manadatory]
# The GitHub token automatically generated for the job
JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Uncomment the below options if you'd like to use them.

# [Mandatory if JF_USER and JF_PASSWORD are not provided]
# JFrog access token with 'read' permissions on Xray service
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}

# [Optional]
# Xray Watches. Learn more about them here: https://www.jfrog.com/confluence/display/JFROG/Configuring+Xray+Watches
# JF_WATCHES: <watch-1>,<watch-2>...<watch-n>

# [Optional]
# JFrog project. Learn more about it here: https://www.jfrog.com/confluence/display/JFROG/Projects
# JF_PROJECT: <project-key>
29 changes: 18 additions & 11 deletions ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pipeline {
spec:
containers:
- name: maven
image: maven:alpine
image: maven:3.8.4-eclipse-temurin-11-alpine
command:
- cat
tty: true
Expand Down Expand Up @@ -42,7 +42,7 @@ pipeline {
DOCKER_BUILD_NAME='jenkins-java-docker'
DOCKER_REGISTRY_URL=sh(returnStdout: true, script: """ if [ \"${params.DOCKER_SUB_DOMAIN}\" = \"true\" ]; then echo \"${params.DOCKER_REPO}.${params.JPD_URL}\"; else echo \"${params.JPD_URL}/${params.DOCKER_REPO}\"; fi""").trim()

JAVA_HOME = '/usr/lib/jvm/java-1.8-openjdk/'
//JAVA_HOME = '/usr/lib/jvm/java-1.8-openjdk/'
MAVEN_HOME = '/usr/share/maven'
}

Expand Down Expand Up @@ -92,7 +92,11 @@ pipeline {
steps {
container('maven') {

git branch: params.MY_GIT_BRANCH , url: params.MY_GIT_URL
//git branch: params.MY_GIT_BRANCH , url: params.MY_GIT_URL
sh """#!/bin/sh
apk add git curl openjdk11 jq
git clone ${params.MY_GIT_URL} -b ${params.MY_GIT_BRANCH}
"""

dir ("src") {

Expand All @@ -118,15 +122,15 @@ pipeline {
id: "MAVEN_DEPLOYER",
serverId: env.ART_ID,
properties: ["app.name=${params.APP_NAME}","app.version=${params.NEW_VERSION}"],
releaseRepo: env.MVN_REPO,
snapshotRepo: env.MVN_REPO
releaseRepo: params.MVN_REPO,
snapshotRepo: params.MVN_REPO
)

rtMavenResolver (
id: "MAVEN_RESOLVER",
serverId: env.ART_ID,
releaseRepo: env.MVN_REPO,
snapshotRepo: env.MVN_REPO
releaseRepo: params.MVN_REPO,
snapshotRepo: params.MVN_REPO
)

rtBuildInfo (
Expand All @@ -135,7 +139,7 @@ pipeline {

buildName: env.MY_BUILD_NAME,
buildNumber: env.BUILD_NUMBER,
maxBuilds: 1,
maxBuilds: 1,
// doNotDiscardBuilds: ['4'],
// deleteBuildArtifacts: true
)
Expand All @@ -149,13 +153,16 @@ pipeline {
--user=${ARTY_CREDS_USR} \
--password="${ARTY_CREDS_PSW}" \
yann-rt
./jf mvn-config \
--server-id-resolve=yann-rt \
--repo-resolve-releases=${params.MVN_REPO} \
--repo-resolve-snapshots=${params.MVN_REPO}
./jf audit-mvn

"""

rtMavenRun (
pom: "pom.xml",
goals: 'clean package -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn',
goals: 'clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn',
deployerId: "MAVEN_DEPLOYER",
resolverId: "MAVEN_RESOLVER",
buildName: env.MY_BUILD_NAME,
Expand Down Expand Up @@ -280,7 +287,7 @@ pipeline {
)

sh """#!/bin/sh
apk add curl openjdk11
apk add curl openjdk11 libc6-compat
echo ${env.DOCKER_REGISTRY_URL}
git_path=`echo ${params.MY_GIT_URL} | cut -d/ -f4,5`
echo \${git_path}
Expand Down
10 changes: 5 additions & 5 deletions ci/jfrog/pipelines.resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ resources:
- name: bi_backapp_mvn
type: BuildInfo
configuration:
sourceArtifactory: artifactory_eu
sourceArtifactory: artifactory_eu_https
buildName: {{ gitBranch }}_backapp_mvn
buildNumber: ${run_number}

- name: bi_backapp_mvn_promoted
type: BuildInfo
configuration:
sourceArtifactory: artifactory_eu
sourceArtifactory: artifactory_eu_https
buildName: {{ gitBranch }}_backapp_mvn
buildNumber: ${run_number}

Expand All @@ -49,20 +49,20 @@ resources:
- name: fs_backapp_mvn
type: FileSpec
configuration:
sourceArtifactory: artifactory_eu
sourceArtifactory: artifactory_eu_https
pattern: "urs-mvn/**/multi-module-application-${runVarAppVersion}.jar"
flat: true

- name: bi_backapp_mvn_docker
type: BuildInfo
configuration:
sourceArtifactory: artifactory_eu
sourceArtifactory: artifactory_eu_https
buildName: {{ gitBranch }}_backapp_mvn_docker
buildNumber: ${run_number}

- name: bi_backapp_mvn_docker_promoted
type: BuildInfo
configuration:
sourceArtifactory: artifactory_eu
sourceArtifactory: artifactory_eu_https
buildName: {{ gitBranch }}_backapp_mvn_docker
buildNumber: ${run_number}
20 changes: 15 additions & 5 deletions ci/jfrog/pipelines.steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ pipelines:
- name: build_backapp_mvn
type: MvnBuild
configuration:
runtime:
type: image
image:
custom:
name: platform-eu.stg.gcp.devopsacc.team/urs-docker/jfrog/pipelines-u18java
tag: "14"
registry: artifactory_docker
sourceRepository: urs-docker
environmentVariables:
JFROG_CLI_BUILD_NAME: "{{ gitBranch }}_backapp_mvn"
JFROG_CLI_BUILD_URL: "${step_url}${res_src_code_backapp_mvn_branchName}"
JFROG_CLI_LOG_LEVEL: DEBUG
JFROG_CLI_LOG_LEVEL: INFO
M2_HOME: /usr/local/apache-maven-3.6.3/
mvnCommand: clean package --no-transfer-progress
sourceLocation: src
Expand All @@ -27,7 +35,8 @@ pipelines:
outputResources:
- name: bi_backapp_mvn
integrations:
- name: artifactory_eu
- name: artifactory_eu_https
- name: artifactory_docker
execution:
onStart:
- ls -l ${res_src_code_backapp_mvn_resourcePath}/src
Expand Down Expand Up @@ -80,7 +89,7 @@ pipelines:
configuration:
environmentVariables:
readOnly:
registryFQDN: yann-sbx.dev.gcp.devopsacc.team
registryFQDN: platform-eu.stg.gcp.devopsacc.team
dockerRepoName: urs-docker
skipScan: "true"
pushRepo: urs-docker-dev-local
Expand Down Expand Up @@ -116,7 +125,8 @@ pipelines:
- name: src_dockerfile_backapp_mvn
- name: fs_backapp_mvn
integrations:
- name: artifactory_eu
- name: artifactory_eu_https
- name: artifactory_docker
execution:
onStart:
# - pwd && ls -l
Expand All @@ -142,7 +152,7 @@ pipelines:
inputSteps:
- name: build_backapp_mvn_docker
integrations:
- name: artifactory_eu
- name: artifactory_eu_https
outputResources:
- name: bi_backapp_mvn_docker
execution:
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG DOCKER_REPO=urs-docker
FROM $REGISTRY/$DOCKER_REPO/groovy:jre16

# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
# ARG REGISTRY
ARG REGISTRY

# dummy
RUN mkdir -p /home/groovy/webapp/
Expand Down
6 changes: 3 additions & 3 deletions src/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<version>2.6.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>multi-module-application</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
<name>multi-module-application</name>
<description>Demo project for Spring Boot</description>

Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>com.example</groupId>
<artifactId>multi-module-library</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/application/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
service.message=it is friday
service.message=it is tuesday
4 changes: 2 additions & 2 deletions src/library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<version>2.6.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>multi-module-library</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
<name>multi-module-library</name>
<description>Demo project for Spring Boot</description>

Expand Down
2 changes: 1 addition & 1 deletion src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.example</groupId>
<artifactId>gs-multi-module</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
<packaging>pom</packaging>

<modules>
Expand Down