Skip to content

Commit

Permalink
Merge branch 'dbeaver-devops#1435-update-24-2-0' of https://github.co…
Browse files Browse the repository at this point in the history
…m/dbeaver/team-edition-deploy into dbeaver-devops#1435-update-24-2-0
  • Loading branch information
arhayka committed Sep 5, 2024
2 parents c633e64 + 26d8075 commit c0453a9
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 233 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/commit-msg-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Commit Message Validation"

on:
pull_request:
branches:
- devel
types:
- opened
- synchronize
- reopened
- edited
- ready_for_review
- labeled

jobs:
commit-msg-matcher:
runs-on: ubuntu-latest
steps:
- name: Use local commit-msg-matcher
uses: dbeaver/github-actions/commit-msg-matcher@devel
with:
githubAccessToken: ${{ secrets.DEVOPS_ISSUE_RO_TOKEN }}
jiraAccessToken: ${{ secrets.JIRA_DEVOPS_TICKET_RO_TOKEN }}
23 changes: 9 additions & 14 deletions AWS/ecs-fargate/alb.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

################################################################################
# ALB
################################################################################

resource "aws_lb" "dbeaver_te_lb" {
name = "DBeaverTE-ALB"
name = "DBeaverTE-${var.deployment_id}-ALB"
internal = false
load_balancer_type = "application"
security_groups = [aws_security_group.dbeaver_alb.id]
subnets = aws_subnet.public_subnets[*].id
tags = {
env = "dev"
env = var.deployment_id
}
}

Expand All @@ -32,14 +31,15 @@ resource "aws_lb_listener" "dbeaver-te-listener" {
}
}
}

# This resources must be edited if HTTPS not used
resource "aws_lb_listener" "dbeaver-te-listener-https" {

load_balancer_arn = aws_lb.dbeaver_te_lb.arn
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
certificate_arn = "arn:aws:acm:${var.aws_region}:${var.aws_account_id}:certificate/${var.alb_certificate_Identifier}"
certificate_arn = "arn:aws:acm:${var.aws_region}:${var.aws_account_id}:certificate/${var.alb_certificate_Identifier}"

default_action {
type = "forward"
Expand Down Expand Up @@ -114,7 +114,7 @@ resource "aws_lb_listener_rule" "forward_to_service_uri_tm" {


resource "aws_lb_target_group" "dbeaver_dc" {
name = "DBeaverTE-dc"
name = "DBeaverTE-${var.deployment_id}-dc"
port = 80
protocol = "HTTP"
target_type = "ip"
Expand All @@ -129,7 +129,7 @@ resource "aws_lb_target_group" "dbeaver_dc" {
}

resource "aws_lb_target_group" "dbeaver_te" {
name = "DBeaverTE"
name = "DBeaverTE-${var.deployment_id}"
port = 80
protocol = "HTTP"
target_type = "ip"
Expand All @@ -149,7 +149,7 @@ resource "aws_lb_target_group" "dbeaver_te" {
}

resource "aws_lb_target_group" "dbeaver_qm" {
name = "DBeaverTE-qm"
name = "DBeaverTE-${var.deployment_id}-qm"
port = 80
protocol = "HTTP"
target_type = "ip"
Expand All @@ -164,7 +164,7 @@ resource "aws_lb_target_group" "dbeaver_qm" {
}

resource "aws_lb_target_group" "dbeaver_rm" {
name = "DBeaverTE-rm"
name = "DBeaverTE-${var.deployment_id}-rm"
port = 80
protocol = "HTTP"
target_type = "ip"
Expand All @@ -179,7 +179,7 @@ resource "aws_lb_target_group" "dbeaver_rm" {
}

resource "aws_lb_target_group" "dbeaver_tm" {
name = "DBeaverTE-tm"
name = "DBeaverTE-${var.deployment_id}-tm"
port = 80
protocol = "HTTP"
target_type = "ip"
Expand All @@ -192,8 +192,3 @@ resource "aws_lb_target_group" "dbeaver_tm" {
path = "/tm/health"
}
}





6 changes: 3 additions & 3 deletions AWS/ecs-fargate/aws-iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ data "aws_iam_policy_document" "assume_role_policy" {
}

resource "aws_iam_policy" "CloudbeaverTeamEditionEFSAccessPolicy" {
name = "CloudbeaverTeamEditionEFSAccessPolicy"
description = "Policy to allow access only to specific EFS resources"
name = "DBeaverTE-${var.deployment_id}-CloudbeaverTeamEditionEFSAccessPolicy"
description = "Policy to allow access only to specific EFS resources for ${var.deployment_id} environment"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand Down Expand Up @@ -64,7 +64,7 @@ resource "aws_iam_policy" "CloudbeaverTeamEditionEFSAccessPolicy" {
}

resource "aws_iam_role" "ecsTaskExecutionRole" {
name = "ecsTaskExecutionRole"
name = "DBeaverTE-${var.deployment_id}-ecsTaskExecutionRole"
assume_role_policy = "${data.aws_iam_policy_document.assume_role_policy.json}"
}

Expand Down
4 changes: 2 additions & 2 deletions AWS/ecs-fargate/build/build-dbeaverte.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ for svc in $TESERVICES; do

docker pull dbeaver/cloudbeaver-"${svc}":${TEVERSION}
docker build -t cloudbeaver-"${svc}" --build-arg TEVERSION=${TEVERSION} -f "${svc}".Dockerfile .
docker tag cloudbeaver-"${svc}" ${AWS_ACC_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/cloudbeaver-"${svc}":${TEVERSION}
docker push ${AWS_ACC_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/cloudbeaver-"${svc}":${TEVERSION}
docker tag cloudbeaver-"${svc}" ${AWS_ACC_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${DEPLOYMENT_ID}-cloudbeaver-"${svc}":${TEVERSION}
docker push ${AWS_ACC_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${DEPLOYMENT_ID}-cloudbeaver-"${svc}":${TEVERSION}
done
5 changes: 2 additions & 3 deletions AWS/ecs-fargate/ecr.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_ecr_repository" "dbeaver_te" {
count = length(var.ecr_repositories)
name = "cloudbeaver-${element(var.ecr_repositories, count.index)}"
name = "${var.deployment_id}-cloudbeaver-${element(var.ecr_repositories, count.index)}"
image_tag_mutability = "MUTABLE"
force_delete = "true"

Expand All @@ -17,6 +17,7 @@ locals {
export AWS_REGION="${var.aws_region}"
export AWS_ACC_ID="${var.aws_account_id}"
export DEPLOYMENT_ID="${var.deployment_id}"
export TESERVICES="${join(" ", [for s in var.ecr_repositories : format("%q", s)])}"
export TEVERSION="${var.dbeaver_te_version}"
Expand All @@ -28,11 +29,9 @@ locals {

}


# local-exec for build and push of docker image
resource "null_resource" "build_push_dkr_img" {
triggers = {
# image_ver_changed = !contains(keys(aws_ecr_repository.dbeaver_te[0].tags_all), var.dbeaver_te_version)
image_ver_changed = var.dbeaver_te_version
}
provisioner "local-exec" {
Expand Down
Loading

0 comments on commit c0453a9

Please sign in to comment.