diff --git a/.gitignore b/.gitignore index 4ed8e53..5cd6cd6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +.azure .gradle test/e2e-test/build/ -bin/ \ No newline at end of file +bin/ +src/account-service/build/ +src/fraud-service/build/ +src/public-api-service/build/ +src/notification-service/build/ \ No newline at end of file diff --git a/infra/core/host/aks-managed-cluster.bicep b/infra/core/host/aks-managed-cluster.bicep index b189af8..f2e0cca 100755 --- a/infra/core/host/aks-managed-cluster.bicep +++ b/infra/core/host/aks-managed-cluster.bicep @@ -11,7 +11,7 @@ param location string = resourceGroup().location param tags object = {} @description('Kubernetes Version') -param kubernetesVersion string = '1.25.5' +param kubernetesVersion string = '1.27.1' @description('Whether RBAC is enabled for local accounts') param enableRbac bool = true diff --git a/src/account-service/local-deploy.sh b/src/account-service/local-deploy.sh index 198f93d..1c1a5b5 100755 --- a/src/account-service/local-deploy.sh +++ b/src/account-service/local-deploy.sh @@ -1,11 +1,16 @@ #!/bin/sh +set -o errexit + serviceName="account-service" version=$(date +%Y.%m.%d.%H.%M.%S) printf "\n🛖 Releasing version: %s\n\n" "${version}" -printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" -kubectl delete deployment "${serviceName}" +# check if service deployment exists on cluster, deleting if it does +if [ $(kubectl get deployments | grep -c "^${serviceName}") -eq "1" ]; then + printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" + kubectl delete deployment "${serviceName}" +fi printf "\n🏗️ Building docker image\n\n" docker build -t localhost:5001/"${serviceName}":"${version}" . diff --git a/src/account-service/src/main/java/com/azdaks/accountservice/model/CreateAccountRequest.java b/src/account-service/src/main/java/com/azdaks/accountservice/model/CreateAccountRequest.java new file mode 100644 index 0000000..7e1868e --- /dev/null +++ b/src/account-service/src/main/java/com/azdaks/accountservice/model/CreateAccountRequest.java @@ -0,0 +1,19 @@ +package com.azdaks.accountservice.model; + +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.jackson.Jacksonized; + +@Getter +@Setter +@Jacksonized +@Builder +public class CreateAccountRequest { + private String owner; + private double amount; + + public String toString() { + return "Owner: " + owner + ", Amount: " + amount; + } +} diff --git a/src/fraud-service/local-deploy.sh b/src/fraud-service/local-deploy.sh index face237..d7b76a1 100755 --- a/src/fraud-service/local-deploy.sh +++ b/src/fraud-service/local-deploy.sh @@ -1,11 +1,16 @@ #!/bin/sh +set -o errexit + serviceName="fraud-service" version=$(date +%Y.%m.%d.%H.%M.%S) printf "\n🛖 Releasing version: %s\n\n" "${version}" -printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" -kubectl delete deployment "${serviceName}" +# check if service deployment exists on cluster, deleting if it does +if [ $(kubectl get deployments | grep -c "^${serviceName}") -eq "1" ]; then + printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" + kubectl delete deployment "${serviceName}" +fi printf "\n🏗️ Building docker image\n\n" docker build -t localhost:5001/"${serviceName}":"${version}" . diff --git a/src/notification-service/local-deploy.sh b/src/notification-service/local-deploy.sh index c227b10..c540b9c 100755 --- a/src/notification-service/local-deploy.sh +++ b/src/notification-service/local-deploy.sh @@ -1,11 +1,16 @@ #!/bin/sh +set -o errexit + serviceName="notification-service" version=$(date +%Y.%m.%d.%H.%M.%S) printf "\n🛖 Releasing version: %s\n\n" "${version}" -printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" -kubectl delete deployment "${serviceName}" +# check if service deployment exists on cluster, deleting if it does +if [ $(kubectl get deployments | grep -c "^${serviceName}") -eq "1" ]; then + printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" + kubectl delete deployment "${serviceName}" +fi printf "\n🏗️ Building docker image\n\n" docker build -t localhost:5001/"${serviceName}":"${version}" . diff --git a/src/public-api-service/local-deploy.sh b/src/public-api-service/local-deploy.sh index 90ad54a..e04ee18 100755 --- a/src/public-api-service/local-deploy.sh +++ b/src/public-api-service/local-deploy.sh @@ -1,11 +1,16 @@ #!/bin/sh +set -o errexit + serviceName="public-api-service" version=$(date +%Y.%m.%d.%H.%M.%S) printf "\n🛖 Releasing version: %s\n\n" "${version}" -printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" -kubectl delete deployment "${serviceName}" +# check if service deployment exists on cluster, deleting if it does +if [ $(kubectl get deployments | grep -c "^${serviceName}") -eq "1" ]; then + printf "\n☢️ Attempting to delete existing deployment %s\n\n" "${serviceName}" + kubectl delete deployment "${serviceName}" +fi printf "\n🏗️ Building docker image\n\n" docker build -t localhost:5001/"${serviceName}":"${version}" .