Merge branch 'add-ci-cd' into 'master'

Add ci cd

See merge request spengreb/ephemeral-jamulus!2
This commit is contained in:
spengreb 2023-01-05 13:25:31 +00:00
commit 529b0435eb
3 changed files with 63 additions and 5 deletions

59
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,59 @@
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
- chmod 600 barotrauma.pem
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
- chmod 600 barotrauma.pem
script:
- terraform init
- terraform destroy
dependencies:
- tf-plan
when: manual
only:
- master

View file

@ -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:

View file

@ -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"
}