Skip to content

Commit 0039ec7

Browse files
authored
Merge pull request #13 from isaacmaffeis/isaac
Isaac
2 parents b0dac37 + b7dae2b commit 0039ec7

File tree

4 files changed

+78
-73
lines changed

4 files changed

+78
-73
lines changed

.github/workflows/docker-image.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Push CI Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
name: Build and Test with Maven
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: '8'
24+
25+
- name: Build with Maven
26+
run: mvn --batch-mode clean install
27+
28+
- name: Upload Artifact codegen
29+
if: github.ref == 'refs/heads/master' || github.event.pull_request.base.ref == 'master'
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: javatoavalla-1.0-SNAPSHOT-jar-with-dependencies.jar
33+
path: target/javatoavalla-1.0-SNAPSHOT-jar-with-dependencies.jar
34+
retention-days: 1
35+
36+
docker:
37+
name: Push Docker Image
38+
needs: build
39+
runs-on: ubuntu-latest
40+
if: github.ref == 'refs/heads/master' || github.event.pull_request.base.ref == 'master'
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Download artifact
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: javatoavalla-1.0-SNAPSHOT-jar-with-dependencies.jar
49+
path: ./target
50+
51+
- name: Login to Docker Hub
52+
uses: docker/login-action@v3
53+
with:
54+
username: ${{ secrets.DOCKER_USERNAME }}
55+
password: ${{ secrets.DOCKER_PASSWORD }}
56+
57+
- name: Build and push
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: .
61+
dockerfile: ./Dockerfile
62+
push: true
63+
tags: isaacmaffeis/javatoavalla:latest
64+
65+
- name: Delete Artifact
66+
uses: GeekyEggo/[email protected]
67+
with:
68+
name: javatoavalla-1.0-SNAPSHOT-jar-with-dependencies.jar

.github/workflows/maven.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/main/java/com/javatoavalla/Main.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ public class Main {
4040
* @param args An array of {@code String} arguments passed from the command line.
4141
*/
4242
public static void main(String[] args) {
43+
44+
String asciiart = "\n _ _____ _ _ _ \n"
45+
+ " (_) __ ___ ____ |_ _|__ / \\__ ____ _| | | __ _ \n"
46+
+ " | |/ _` \\ \\ / / _` || |/ _ \\ / _ \\ \\ / / _` | | |/ _` |\n"
47+
+ " | | (_| |\\ V / (_| || | (_) / ___ \\ V / (_| | | | (_| |\n"
48+
+ " _/ |\\__,_| \\_/ \\__,_||_|\\___/_/ \\_\\_/ \\__,_|_|_|\\__,_|\n"
49+
+ "|__/ ";
50+
4351
try {
4452
Main main = new Main();
4553
Options options = getCommandLineOptions();
4654
CommandLine line = main.parseCommandLine(args, options);
47-
log.info("Performing requested operation ...");
55+
log.info(asciiart);
4856
if (line == null || line.hasOption("help") || line.getOptions().length == 0) {
4957
HelpFormatter formatter = new HelpFormatter();
5058
// Do not sort
@@ -107,7 +115,7 @@ public static Options getCommandLineOptions() {
107115

108116
// clean option
109117
Option clean = Option.builder("clean")
110-
.argName("<boolean>")
118+
.argName("boolean")
111119
.type(String.class)
112120
.hasArg(true)
113121
.desc("Clean the input and the stepFunctionArgs files.")

0 commit comments

Comments
 (0)