Skip to content

Commit 3732f6d

Browse files
committed
add new batch 3.x samples for task and batch
Signed-off-by: trisberg <thomas.risberg@broadcom.com>
1 parent 36bba8e commit 3732f6d

29 files changed

Lines changed: 1959 additions & 0 deletions

.github/workflows/ci-task-3.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI-TASK-3
2+
3+
on:
4+
# Called by UI
5+
workflow_dispatch:
6+
7+
jobs:
8+
9+
timestamp-task-3:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Get the build version
14+
id: buildversion
15+
run: |
16+
cd timestamp-task-3
17+
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
18+
echo "BUILD_VERSION=$VERSION" >> $GITHUB_OUTPUT
19+
echo "BUILD_VERSION=$VERSION"
20+
cd ..
21+
- uses: ./.github/actions/build-sample-app
22+
with:
23+
app-dir: 'timestamp-task-3'
24+
mvn-build-commands: '-B clean install spring-boot:build-image'
25+
artifactory-publish: ${{ inputs.maven-build-only != true }}
26+
jf-artifactory-spring: ${{ secrets.JF_ARTIFACTORY_SPRING }}
27+
artifactory-repo-deploy-releases: 'libs-milestone-local'
28+
docker-push: ${{ inputs.maven-build-only != true }}
29+
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
docker-password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
java-version: '17'
32+
docker-images: springcloudtask/timestamp-task:${{steps.buildversion.outputs.BUILD_VERSION}}
33+
34+
timestamp-batch-3:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Get the build version
39+
id: buildversion
40+
run: |
41+
cd timestamp-batch-3
42+
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
43+
echo "BUILD_VERSION=$VERSION" >> $GITHUB_OUTPUT
44+
echo "BUILD_VERSION=$VERSION"
45+
cd ..
46+
- uses: ./.github/actions/build-sample-app
47+
with:
48+
app-dir: 'timestamp-batch-3'
49+
mvn-build-commands: '-B clean install spring-boot:build-image'
50+
artifactory-publish: ${{ inputs.maven-build-only != true }}
51+
jf-artifactory-spring: ${{ secrets.JF_ARTIFACTORY_SPRING }}
52+
artifactory-repo-deploy-releases: 'libs-milestone-local'
53+
docker-push: ${{ inputs.maven-build-only != true }}
54+
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
55+
docker-password: ${{ secrets.DOCKERHUB_TOKEN }}
56+
java-version: '17'
57+
docker-images: springcloudtask/timestamp-batch-task:${{steps.buildversion.outputs.BUILD_VERSION}}
58+
59+
completed:
60+
runs-on: ubuntu-latest
61+
needs:
62+
- timestamp-task-3
63+
- timestamp-batch-3
64+
steps:
65+
- name: 'Completed'
66+
shell: bash
67+
run: echo "::info ::completed"

timestamp-batch-3/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
!**/src/main/**/build/
30+
!**/src/test/**/build/
31+
32+
### VS Code ###
33+
.vscode/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

timestamp-batch-3/README.adoc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
= Spring Batch Job Task
2+
3+
This is a Spring Cloud Task application that executes two simple Spring Batch Jobs.
4+
5+
== Requirements
6+
7+
* Java 17 or Above
8+
9+
== Classes
10+
11+
* BatchJobApplication - the Spring Boot Main Application
12+
13+
== Build
14+
15+
=== Build and test
16+
[source,shell,indent=2]
17+
----
18+
./mvnw clean install
19+
----
20+
21+
=== Build Docker container
22+
23+
[source,shell,indent=2]
24+
----
25+
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=spring/timestamp-batch-task:latest
26+
----
27+
28+
== Run
29+
30+
=== Command line
31+
[source,shell,indent=2]
32+
----
33+
java -jar target/timestamp-batch-task-3.0.0.jar
34+
----
35+
36+
=== Docker
37+
[source,shell,indent=2]
38+
----
39+
docker run spring/timestamp-batch-task:latest
40+
----
41+
42+
=== Properties
43+
* *timestamp.format* - The timestamp format, "yyyy-MM-dd HH:mm:ss.SSS" by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
if [ "$TIMESTAMP_BATCH_TASK_VERSION" = "" ]; then
3+
TIMESTAMP_BATCH_TASK_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
4+
fi
5+
./mvnw -o clean install -DskipTests
6+
./mvnw -o spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=springcloud/timestamp-batch-task:$TIMESTAMP_BATCH_TASK_VERSION

0 commit comments

Comments
 (0)