Merge branch 'MON-336_Convert_bitbucket_pipeline_to_gitlab_ci' into 'master'
Resolve MON-336 "Convert bitbucket pipeline to gitlab ci" Closes MON-336 See merge request claranet/cloudnative/projects/datadog/terraform/monitors!5
This commit is contained in:
commit
d9cc2f99a8
20
.gitlab-ci.yml
Normal file
20
.gitlab-ci.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
image: hashicorp/terraform:full
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
|
||||||
|
test_auto_update:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- apk update
|
||||||
|
- apk upgrade
|
||||||
|
- apk add --no-cache bash git grep coreutils curl
|
||||||
|
- curl -Lo /usr/local/bin/terraform-docs "https://github.com/$(curl -s https://github.com/segmentio/terraform-docs/releases | grep terraform-docs-v0.4.0-linux-amd | head -n 1 | cut -d '"' -f 2)"
|
||||||
|
- chmod +x /usr/local/bin/terraform-docs
|
||||||
|
- ./scripts/auto_update.sh ./
|
||||||
|
- git status
|
||||||
|
- git diff --exit-code
|
||||||
|
tags:
|
||||||
|
- default
|
||||||
|
- cloudnative
|
||||||
|
|
||||||
@ -1,7 +1,8 @@
|
|||||||
# DataDog Monitors #
|
# DataDog Monitors [](https://git.fr.clara.net/claranet/cloudnative/projects/datadog/terraform/monitors/commits/master) #
|
||||||
|
|
||||||
This repository is used to store all our monitors templates ready to use for generic purpose.
|
This repository is used to store all our monitors templates ready to use for generic purpose.
|
||||||
|
|
||||||
|
|
||||||
### How to contribute ? ###
|
### How to contribute ? ###
|
||||||
|
|
||||||
First, you may refresh your knowledge and look at the [terminology](https://confluence.fr.clara.net/display/DAT/Getting+started).
|
First, you may refresh your knowledge and look at the [terminology](https://confluence.fr.clara.net/display/DAT/Getting+started).
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
image: hashicorp/terraform:full
|
|
||||||
|
|
||||||
pipelines:
|
|
||||||
default:
|
|
||||||
- step:
|
|
||||||
name: Check auto update
|
|
||||||
script:
|
|
||||||
- apk update
|
|
||||||
- apk upgrade
|
|
||||||
- apk add --no-cache bash git grep coreutils curl
|
|
||||||
- curl -Lo /usr/local/bin/terraform-docs "https://github.com/$(curl -s https://github.com/segmentio/terraform-docs/releases | grep terraform-docs-v0.4.0-linux-amd | head -n 1 | cut -d '"' -f 2)"
|
|
||||||
- chmod +x /usr/local/bin/terraform-docs
|
|
||||||
- ./scripts/auto_update.sh
|
|
||||||
- git status
|
|
||||||
- git diff --exit-code
|
|
||||||
@ -11,7 +11,6 @@ for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors
|
|||||||
> outputs.tf
|
> outputs.tf
|
||||||
# loop over monitors for each set
|
# loop over monitors for each set
|
||||||
for monitor in $(grep 'resource "datadog_monitor"' $(basename $path) | awk '{print $3}' | tr -d '"' ); do
|
for monitor in $(grep 'resource "datadog_monitor"' $(basename $path) | awk '{print $3}' | tr -d '"' ); do
|
||||||
echo $monitor
|
|
||||||
# create output block for current monitor
|
# create output block for current monitor
|
||||||
cat >> outputs.tf <<EOF
|
cat >> outputs.tf <<EOF
|
||||||
output "${monitor}_id" {
|
output "${monitor}_id" {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ goto_root
|
|||||||
|
|
||||||
for path in $(find "$(get_scope $1)" -path ./testing -prune -o -path ./incubator -prune -o -name 'inputs.tf' -print); do
|
for path in $(find "$(get_scope $1)" -path ./testing -prune -o -path ./incubator -prune -o -name 'inputs.tf' -print); do
|
||||||
dir=$(dirname ${path})
|
dir=$(dirname ${path})
|
||||||
terraform init ${dir}
|
terraform init ${dir} >> /dev/null 2>&1
|
||||||
terraform validate --check-variables=false ${dir}
|
terraform validate --check-variables=false ${dir}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user