diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c75ecbe..dde1b2f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,71 +1,55 @@ -name: "checks" +name: checks on: + pull_request: + types: [opened, synchronize] push: - branches: [master] jobs: command-check: - name: "Command check" runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Update repositories" - run: sudo apt update + - name: Update repositories + run: sudo apt update - - name: "Run tests" - run: | - sudo apt install -y pv siege - tests/ci_test.sh + - name: Run tests + run: | + sudo apt install -y pv siege + tests/ci_test.sh - markdown-lint-check: - name: "Markdown lint check" + markdownlint-check: runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - - name: "Install Node.js 12" - uses: actions/setup-node@v1 - with: - node-version: 12.x - - - name: "Install markdownlint-cli" - run: npm install -g markdownlint-cli + - uses: actions/checkout@v2 - - name: "Create markdownlint configuration file" - run: | - echo "{ MD013: false }" > /tmp/markdownlint_config.json - - - name: "Run markdownlint" - run: find . -path ./node_modules -prune -o -name "*.md" -print0 | xargs -t -0 markdownlint -c /tmp/markdownlint_config.json + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v1.1.1 + with: + files: . + config_file: .markdownlint.yml markdown-spell-check: - name: "Markdown spell check" runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Install Node.js 12" - uses: actions/setup-node@v1 - with: - node-version: 12.x + - name: Install Node.js 12 + uses: actions/setup-node@v1 + with: + node-version: 12.x - - name: "Install markdown-spellcheck" - run: npm install -g markdown-spellcheck + - name: Install markdown-spellcheck + run: npm install -g markdown-spellcheck - - name: "Run mdspell" - run: mdspell '**/*.md' '!**/node_modules/**/*.md' --ignore-numbers --ignore-acronyms --report --en-gb + - name: Run mdspell + run: find . -type f -name "*.md" -exec mdspell --ignore-numbers --ignore-acronyms --report --en-gb {} \; markdown-link-check: - name: "Markdown link check" runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - uses: gaurav-nelson/github-action-markdown-link-check@0.4.0 + - uses: actions/checkout@v2 + + - name: Link Checker + uses: gaurav-nelson/github-action-markdown-link-check@0.4.0 diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 0000000..9b9cc84 --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,51 @@ +name: terraform + +on: + pull_request: + types: [opened, synchronize] + paths: + - .github/workflows/terraform.yml + - terraform/** + push: + branches: [master] + paths: + - .github/workflows/terraform.yml + - terraform/** + +jobs: + terraform-check: + name: Terraform Actions + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Terraform Format + uses: hashicorp/terraform-github-actions@v0.6.4 + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: fmt + tf_actions_working_dir: terraform/openstack + tf_actions_comment: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Terraform Init + uses: hashicorp/terraform-github-actions@v0.6.4 + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: init + tf_actions_working_dir: terraform/openstack + tf_actions_comment: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Terraform Validate + uses: hashicorp/terraform-github-actions@v0.6.4 + with: + tf_actions_version: 0.12.13 + tf_actions_subcommand: validate + tf_actions_working_dir: terraform/openstack + tf_actions_comment: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 0000000..8f3de8b --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,23 @@ +name: yamllint + +on: + pull_request: + types: [opened, synchronize] + paths: + - '**.yml' + - '**.yaml' + push: + paths: + - '**.yml' + - '**.yaml' + +jobs: + yamllint-check: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: yamllint + uses: ibiqlik/action-yamllint@master + with: + file_or_dir: . diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..90c6300 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,3 @@ +MD013: + code_blocks: false + tables: false diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..addf0aa --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,7 @@ +extends: default + +rules: + # 80 chars should be enough, but don't fail if a line is longer + line-length: + max: 80 + level: warning diff --git a/terrafrom/openstack/main.tf b/terrafrom/openstack/main.tf index 74aeb33..27ca312 100644 --- a/terrafrom/openstack/main.tf +++ b/terrafrom/openstack/main.tf @@ -58,9 +58,9 @@ resource "openstack_networking_router_v2" "private-router" { # Create router interface for private subnet resource "openstack_networking_router_interface_v2" "router-interface" { - count = "${var.environment_count}" - router_id = "${element(openstack_networking_router_v2.private-router.*.id, count.index)}" - subnet_id = "${element(openstack_networking_subnet_v2.private-subnet.*.id, count.index)}" + count = "${var.environment_count}" + router_id = "${element(openstack_networking_router_v2.private-router.*.id, count.index)}" + subnet_id = "${element(openstack_networking_subnet_v2.private-subnet.*.id, count.index)}" } # Create floating IP for nodes @@ -80,7 +80,7 @@ resource "openstack_compute_instance_v2" "vms" { security_groups = ["${openstack_networking_secgroup_v2.secgroup.name}"] network { - uuid = "${element(openstack_networking_network_v2.private-network.*.id, count.index / var.vm_nodes )}" + uuid = "${element(openstack_networking_network_v2.private-network.*.id, count.index / var.vm_nodes)}" fixed_ip_v4 = "${cidrhost(var.openstack_networking_subnet_cidr, var.vm_nodes_network_private_ip_last_octet + count.index % var.vm_nodes + 1)}" access_network = true } @@ -95,18 +95,18 @@ resource "openstack_compute_floatingip_associate_v2" "floatingip-associate" { # Wait for VMs to be fully up (accessible by ssh) resource "null_resource" "vms" { - count = "${var.vm_nodes * var.environment_count}" - depends_on = ["openstack_compute_floatingip_associate_v2.floatingip-associate"] + count = "${var.vm_nodes * var.environment_count}" + depends_on = ["openstack_compute_floatingip_associate_v2.floatingip-associate"] connection { type = "ssh" host = "${element(openstack_networking_floatingip_v2.floatingip.*.address, count.index)}" #private_key = "${file("~/.ssh/id_rsa")}" - user = "${var.username}" + user = "${var.username}" agent = true } provisioner "remote-exec" { - inline = [ ] + inline = [] } } diff --git a/terrafrom/openstack/variables.tf b/terrafrom/openstack/variables.tf index 05d9dbb..93a2673 100644 --- a/terrafrom/openstack/variables.tf +++ b/terrafrom/openstack/variables.tf @@ -8,7 +8,7 @@ variable "openstack_auth_url" { variable "openstack_availability_zone" { description = "Availability zone in which to create the server" - default = "nova" + default = "nova" } variable "openstack_instance_flavor_name" { @@ -21,22 +21,22 @@ variable "openstack_instance_image_name" { variable "openstack_keypair_public_key" { description = "SSH Public key location" - default = "~/.ssh/id_rsa.pub" + default = "~/.ssh/id_rsa.pub" } variable "openstack_networking_network_external_network_name" { description = "External network name" - default = "public" + default = "public" } variable "openstack_networking_subnet_cidr" { description = "CIDR for new network where all VMs will be connected" - default = "192.168.250.0/24" + default = "192.168.250.0/24" } variable "openstack_networking_subnet_dns_nameservers" { description = "DNS servers" - default = ["8.8.8.8", "8.8.4.4"] + default = ["8.8.8.8", "8.8.4.4"] } variable "openstack_networking_floatingip" { diff --git a/yaml/fluentd-istio.yaml b/yaml/fluentd-istio.yaml index a78af84..5589d02 100644 --- a/yaml/fluentd-istio.yaml +++ b/yaml/fluentd-istio.yaml @@ -34,6 +34,6 @@ metadata: spec: match: "true" # match for all requests actions: - - handler: handler.fluentd - instances: - - newlog.logentry + - handler: handler.fluentd + instances: + - newlog.logentry