Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions avatarsDicebear/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} avatarsDicebear.jar
ENTRYPOINT ["java", "-jar", "/avatarsDicebear.jar"]
22 changes: 22 additions & 0 deletions avatarsDicebear/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=avatars_dicebear
imageFullName=$repositoryName:$imageTag

echo [Avatars DiceBear STARTING] building $imageFullName
echo BASH_SOURCE: "${BASH_SOURCE%/*}"
echo [Avatars DiceBear] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Avatars DiceBear] creating docker image...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Avatars DiceBear FINISHED] image has been built

20 changes: 20 additions & 0 deletions avatarsDicebear/pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=avatars_decebear
imageFullName=$repositoryName:$imageTag

echo [Avatars decebear STARTING] pushing image $imageFullName

echo [Avatars decebear ] pushing image...

echo [Avatars decebear ] creating docker image...
docker push $imageFullName

echo [Avatars decebear FINISHED] image $imageFullName pushed
16 changes: 16 additions & 0 deletions buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi

(exec "${BASH_SOURCE%/*}/avatarsDicebear/buildImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/businessPeople/buildImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/persistence/buildImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/presentation/buildImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/quoteGarden/buildImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/useCasePeople/buildImage.sh" $imageTag)
7 changes: 7 additions & 0 deletions businessPeople/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} businessPeople.jar
ENTRYPOINT ["java", "-jar", "/businessPeople.jar"]
22 changes: 22 additions & 0 deletions businessPeople/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=business_image
imageFullName=$repositoryName:$imageTag

echo [Business people STARTING] building $imageFullName

echo [Business people] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Business people] creating docker image...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Business people FINISHED] image has been built

20 changes: 20 additions & 0 deletions businessPeople/pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=business_people
imageFullName=$repositoryName:$imageTag

echo [Business people STARTING] pushing image $imageFullName

echo [Business people ] pushing image...

echo [Business people ] creating docker image...
docker push $imageFullName

echo [Business people FINISHED] image $imageFullName pushed
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ data class Person(
val secondName: String,
val birthDate: LocalDate,
val sex: Sex,
var avatartUrl: String = DEFAULT_ROBOT_AVATAR,
var avatarUrl: String = DEFAULT_ROBOT_AVATAR,
val favoriteQuote: String
) {

fun mature(forDate: LocalDate = LocalDate.now()): Boolean =
age(forDate) > 40


fun age(forDate: LocalDate = LocalDate.now()): Year =
Period.between(forDate, birthDate).years

Expand All @@ -28,7 +24,7 @@ data class Person(
}

fun changeAvatar(pictureUrl: String) {
avatartUrl = pictureUrl
avatarUrl = pictureUrl
}
}

Expand Down
Empty file added gradle.properties
Empty file.
7 changes: 7 additions & 0 deletions persistence/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} persistence.jar
ENTRYPOINT ["java", "-jar", "/persistence.jar"]
22 changes: 22 additions & 0 deletions persistence/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=persistence
imageFullName=$repositoryName:$imageTag

echo [Persistence STARTING] building $imageFullName

echo [Persistence ] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Persistence ] creating docker image...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Persistence FINISHED] image has been built

20 changes: 20 additions & 0 deletions persistence/pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=persistence
imageFullName=$repositoryName:$imageTag

echo [Persistence STARTING] pushing image $imageFullName

echo [Persistence ] pushing image...

echo [Persistence ] creating docker image...
docker push $imageFullName

echo [Persistence FINISHED] image $imageFullName pushed
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class PersonEntity(
val secondName: String,
val birthDate: LocalDate,
val sex: Sex,
val avatartUrl: String,
val avatarUrl: String,
val favoriteQuote: String
) {
enum class Sex {
Expand All @@ -28,7 +28,7 @@ data class PersonEntity(
secondName = p.secondName,
birthDate = p.birthDate,
sex = if (p.sex == Person.Sex.MAN) Sex.MAN else Sex.WOMAN,
avatartUrl = p.avatartUrl,
avatarUrl = p.avatarUrl,
favoriteQuote = p.favoriteQuote
)

Expand All @@ -39,7 +39,7 @@ data class PersonEntity(
secondName = p.secondName,
birthDate = p.birthDate,
sex = if (p.sex == Sex.MAN) Person.Sex.MAN else Person.Sex.WOMAN,
avatartUrl = p.avatartUrl,
avatarUrl = p.avatarUrl,
favoriteQuote = p.favoriteQuote
)
}
Expand Down
7 changes: 7 additions & 0 deletions presentation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} presentation.jar
ENTRYPOINT ["java", "-jar", "/presentation.jar"]
22 changes: 22 additions & 0 deletions presentation/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=presentation
imageFullName=$repositoryName:$imageTag

echo [Presentation STARTING] building $imageFullName

echo [Presentation ] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Presentation ] creating docker image...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Presentation FINISHED] image has been built

20 changes: 20 additions & 0 deletions presentation/pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=presentation
imageFullName=$repositoryName:$imageTag

echo [Presentation STARTING] pushing image $imageFullName

echo [Presentation ] pushing image...

echo [Presentation ] creating docker image...
docker push $imageFullName

echo [Presentation FINISHED] image $imageFullName pushed
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PersonRespectfullViewModel(
else ""


fun avatarUrl() = person.avatartUrl
fun avatarUrl() = person.avatarUrl

fun birthDate() = "${person.birthDate.dayOfMonth} ${person.birthDate.month} ${person.birthDate.year}"

Expand Down
16 changes: 16 additions & 0 deletions pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi

(exec "${BASH_SOURCE%/*}/avatarsDicebear/pushImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/businessPeople/pushImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/persistence/pushImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/presentation/pushImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/quoteGarden/pushImage.sh" $imageTag)
(exec "${BASH_SOURCE%/*}/useCasePeople/pushImage.sh" $imageTag)
7 changes: 7 additions & 0 deletions quoteGarden/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} quoteGarden.jar
ENTRYPOINT ["java", "-jar", "/quoteGarden.jar"]
22 changes: 22 additions & 0 deletions quoteGarden/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=quote_garden
imageFullName=$repositoryName:$imageTag

echo [Quote garden STARTING] building $imageFullName

echo [Quote garden ] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Quote garden ] creating docker image...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Quote garden FINISHED] image has been built

20 changes: 20 additions & 0 deletions quoteGarden/pushImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=quote_garden
imageFullName=$repositoryName:$imageTag

echo [Quote garden STARTING] pushing image $imageFullName

echo [Quote garden] pushing image...

echo [Quote garden] creating docker image...
docker push $imageFullName

echo [Quote garden FINISHED] image $imageFullName pushed
7 changes: 7 additions & 0 deletions useCasePeople/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} useCasePeople.jar
ENTRYPOINT ["java", "-jar", "/useCasePeople.jar"]
22 changes: 22 additions & 0 deletions useCasePeople/buildImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
imageTag=$1

if [ -z "$1" ];
then
echo No image tag provided. Latest will be used
imageTag=latest
fi
repositoryName=usecasepeople
imageFullName=$repositoryName:$imageTag

echo [Use case people STARTING] building $imageFullName

echo [Use case people] creating jar...
(exec "${BASH_SOURCE%/*}/../gradlew" bootJar --no-daemon)

echo [Use case people] creating docker image $imageFullName...
docker build -t $imageFullName "${BASH_SOURCE%/*}"

echo [Use case people FINISHED] image $imageFullName has been built

Loading