From d6542f933a634548d8cd6d3e4fee62d89553b0fd Mon Sep 17 00:00:00 2001 From: scootz Date: Wed, 7 Dec 2022 20:01:31 +0000 Subject: [PATCH 1/2] Add ci-cd.yml to jam repo --- .gitlab-ci.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++ jamulus-install.yml | 6 ++--- main.tf | 3 +-- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f75fcbe --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +image: + name: hashicorp/terraform:light + entrypoint: [""] + +stages: + - tf-validate + - tf-plan + - tf-apply + - tf-destroy + +tf-validate: + stage: tf-validate + script: + - terraform init + - terraform validate + +tf-plan: + stage: tf-plan + script: + - terraform init + - terraform plan -out plan.tfplan + artifacts: + paths: + - plan.tfplan + +tf-apply: + stage: tf-apply + image: + name: hashicorp/terraform + entrypoint: [""] + before_script: + - apk add ansible + - ansible-galaxy collection install community.docker + script: + - terraform init + - terraform apply plan.tfplan + dependencies: + - tf-plan + when: manual + only: + - master + +tf-destroy: + stage: tf-destroy + image: + name: hashicorp/terraform + entrypoint: [""] + before_script: + - apk add ansible + script: + - terraform init + - terraform destroy plan.tfplan + dependencies: + - tf-plan + when: manual + only: + - master diff --git a/jamulus-install.yml b/jamulus-install.yml index 8ae4572..7906d57 100644 --- a/jamulus-install.yml +++ b/jamulus-install.yml @@ -43,12 +43,12 @@ - name: Get jamulus get_url: - url: https://github.com/jamulussoftware/jamulus/releases/download/r3_9_0/jamulus_headless_3.9.0_ubuntu_amd64.deb - dest: /tmp/jamulus_headless_3.9.0_ubuntu_amd64.deb + url: https://github.com/jamulussoftware/jamulus/releases/download/r3_9_1/jamulus-headless_3.9.1_ubuntu_amd64.deb + dest: /tmp/jamulus_headless_3.9.1_ubuntu_amd64.deb - name: Install jamulus apt: - deb: /tmp/jamulus_headless_3.9.0_ubuntu_amd64.deb + deb: /tmp/jamulus_headless_3.9.1_ubuntu_amd64.deb - name: Move jamulus service file copy: diff --git a/main.tf b/main.tf index 3a6cc1f..ada4c8c 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,5 @@ provider "aws" { region = "eu-west-2" - profile = "vereto" } terraform { @@ -88,7 +87,7 @@ resource "aws_security_group_rule" "jamulus" { } resource "aws_security_group" "node-exporter" { - name = "node-exporter-port-access" + name = "jam-node-exporter-port-access" description = "Allow jamulus inbound traffic" } -- 2.45.3 From 9c87bdf133e6c92781d40a43e67d626eac3b34c3 Mon Sep 17 00:00:00 2001 From: Conor McManus Date: Thu, 5 Jan 2023 14:23:11 +0100 Subject: [PATCH 2/2] Add fixes for ci-cd from baro project --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f75fcbe..d43de01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,7 @@ tf-apply: before_script: - apk add ansible - ansible-galaxy collection install community.docker + - chmod 600 barotrauma.pem script: - terraform init - terraform apply plan.tfplan @@ -47,9 +48,10 @@ tf-destroy: entrypoint: [""] before_script: - apk add ansible + - chmod 600 barotrauma.pem script: - terraform init - - terraform destroy plan.tfplan + - terraform destroy dependencies: - tf-plan when: manual -- 2.45.3