Skip to content

Commit

Permalink
Merge pull request #96 from nicholasM95/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nicholasM95 authored Dec 22, 2024
2 parents 063d75c + cb5451c commit d4fc99e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 39 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/deploy-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ jobs:
method: jwt
path: github-actions-secret
secrets: |
github-actions-secret/data/secret CLOUDFLARE_API_KEY | CLOUDFLARE_API_KEY ;
github-actions-secret/data/secret CLOUDFLARE_EMAIL | CLOUDFLARE_EMAIL ;
github-actions-secret/data/secret K8S_CONFIG | K8S_CONFIG ;
github-actions-secret/data/secret PUBLIC_IP | PUBLIC_IP ;
github-actions-secret/data/secret DOCKER_CONFIG | DOCKER_CONFIG ;
- name: Configure AWS credentials
Expand Down Expand Up @@ -74,10 +71,10 @@ jobs:

- name: Terraform Plan
id: plan
run: terraform plan -var image_tag=${{ github.event.inputs.image_tag }} -var server_ip=$PUBLIC_IP -var docker_config=$DOCKER_CONFIG -var host_name="nicholasmeyers.be"
run: terraform plan -var image_tag=${{ github.event.inputs.image_tag }} -var docker_config=$DOCKER_CONFIG
working-directory: infra/prod

- name: Terraform Apply
id: apply
run: terraform apply -var image_tag=${{ github.event.inputs.image_tag }} -var server_ip=$PUBLIC_IP -var docker_config=$DOCKER_CONFIG -var host_name="nicholasmeyers.be" -auto-approve
run: terraform apply -var image_tag=${{ github.event.inputs.image_tag }} -var docker_config=$DOCKER_CONFIG -auto-approve
working-directory: infra/prod
7 changes: 2 additions & 5 deletions .github/workflows/destroy-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ jobs:
method: jwt
path: github-actions-secret
secrets: |
github-actions-secret/data/secret CLOUDFLARE_API_KEY | CLOUDFLARE_API_KEY ;
github-actions-secret/data/secret CLOUDFLARE_EMAIL | CLOUDFLARE_EMAIL ;
github-actions-secret/data/secret K8S_CONFIG | K8S_CONFIG ;
github-actions-secret/data/secret PUBLIC_IP | PUBLIC_IP ;
github-actions-secret/data/secret DOCKER_CONFIG | DOCKER_CONFIG ;
- name: Configure AWS credentials
Expand Down Expand Up @@ -70,10 +67,10 @@ jobs:

- name: Terraform Plan Destroy
id: plan-destroy
run: terraform plan -destroy -var image_tag=foobar -var server_ip=$PUBLIC_IP -var docker_config=$DOCKER_CONFIG -var host_name="nicholasmeyers.be"
run: terraform plan -destroy -var image_tag=foobar -var docker_config=$DOCKER_CONFIG
working-directory: infra/prod

- name: Terraform Destroy
id: destroy
run: terraform destroy -var image_tag=foobar -var server_ip=$PUBLIC_IP -var docker_config=$DOCKER_CONFIG -var host_name="nicholasmeyers.be" -auto-approve
run: terraform destroy -var image_tag=foobar -var docker_config=$DOCKER_CONFIG -auto-approve
working-directory: infra/prod
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'liberica'
Expand Down
9 changes: 2 additions & 7 deletions infra/prod/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ terraform {

helm = {
source = "hashicorp/helm"
version = "2.16.1"
}

cloudflare = {
source = "cloudflare/cloudflare"
version = "4.46.0"
version = "2.17.0"
}

aws = {
source = "hashicorp/aws"
version = "5.77.0"
version = "5.82.2"
}
}

Expand Down
9 changes: 1 addition & 8 deletions infra/prod/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
module "dns" {
source = "git::https://github.com/nicholasM95/terraform-modules.git//modules/dns-cloudflare?ref=v1.8.3"
ip = var.server_ip
name = "api-skoda"
host_name = var.host_name
}

module "application" {
source = "git::https://github.com/nicholasM95/terraform-modules.git//modules/k8s-helm-release?ref=v1.8.3"
source = "git::https://github.com/nicholasM95/terraform-modules.git//modules/k8s-helm-release?ref=v1.8.6"
image_tag = var.image_tag
application_name = "api-skoda"
namespace_name = "skoda"
Expand Down
10 changes: 0 additions & 10 deletions infra/prod/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ variable "docker_config" {
type = string
}

variable "server_ip" {
description = "Server ip"
type = string
}

variable "host_name" {
description = "Host name"
type = string
}

variable "image_tag" {
description = "Image tag"
type = string
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>be.nicholas</groupId>
<artifactId>api</artifactId>
<version>1.3.2</version>
<version>1.3.3-SNAPSHOT</version>

<name>api</name>
<description>api</description>
Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2024.0.0-RC1</version>
<version>2024.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit d4fc99e

Please sign in to comment.