Merge pull request #283 from myii/chore/standardise-structure
feat(yamllint): include for this repo and apply rules throughout
This commit is contained in:
13
.travis.yml
13
.travis.yml
@@ -3,7 +3,7 @@
|
|||||||
---
|
---
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- commitlint
|
- lint
|
||||||
- name: release
|
- name: release
|
||||||
if: branch = master AND type != pull_request
|
if: branch = master AND type != pull_request
|
||||||
|
|
||||||
@@ -47,16 +47,21 @@ script:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
# Define the commitlint stage
|
# Define the `lint` stage (runs `yamllint` and `commitlint`)
|
||||||
- stage: commitlint
|
- stage: lint
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js: lts/*
|
node_js: lts/*
|
||||||
before_install: skip
|
before_install: skip
|
||||||
script:
|
script:
|
||||||
|
# Install and run `yamllint`
|
||||||
|
- pip install --user yamllint
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
|
- yamllint -s . .yamllint pillar.example test/salt/pillar/postgres.sls
|
||||||
|
# Install and run `commitlint`
|
||||||
- npm install @commitlint/config-conventional -D
|
- npm install @commitlint/config-conventional -D
|
||||||
- npm install @commitlint/travis-cli -D
|
- npm install @commitlint/travis-cli -D
|
||||||
- commitlint-travis
|
- commitlint-travis
|
||||||
# Define the release stage that runs semantic-release
|
# Define the release stage that runs `semantic-release`
|
||||||
- stage: release
|
- stage: release
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js: lts/*
|
node_js: lts/*
|
||||||
|
|||||||
23
.yamllint
Normal file
23
.yamllint
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
|
# Extend the `default` configuration provided by `yamllint`
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
# Files to ignore completely
|
||||||
|
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
|
||||||
|
# 2. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
|
||||||
|
ignore: |
|
||||||
|
node_modules/
|
||||||
|
pillar.example
|
||||||
|
postgres/codenamemap.yaml
|
||||||
|
postgres/osfamilymap.yaml
|
||||||
|
postgres/osmap.yaml
|
||||||
|
postgres/repo.yaml
|
||||||
|
test/salt/pillar/postgres.sls
|
||||||
|
|
||||||
|
rules:
|
||||||
|
line-length:
|
||||||
|
# Increase from default of `80`
|
||||||
|
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
|
||||||
|
max: 88
|
||||||
@@ -1,18 +1,21 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
# Port to use for the cluster -- can be used to provide a non-standard port
|
# Port to use for the cluster -- can be used to provide a non-standard port
|
||||||
# NOTE: If already set in the minion config, that value takes priority
|
# NOTE: If already set in the minion config, that value takes priority
|
||||||
postgres.port: '5432'
|
postgres.port: '5432'
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
# UPSTREAM REPO
|
# UPSTREAM REPO
|
||||||
# Set True to configure upstream postgresql.org repository for YUM/APT/ZYPP
|
# Set true to configure upstream postgresql.org repository for YUM/APT/ZYPP
|
||||||
use_upstream_repo: False
|
use_upstream_repo: false
|
||||||
# Version to install from upstream repository (if upstream_repo: True)
|
# Version to install from upstream repository (if upstream_repo: true)
|
||||||
version: '10'
|
version: '10'
|
||||||
# Set True to add a file in /etc/profile.d adding the bin dir in $PATH
|
# Set true to add a file in /etc/profile.d adding the bin dir in $PATH
|
||||||
# as packages from upstream put them somewhere like /usr/pgsql-10/bin
|
# as packages from upstream put them somewhere like /usr/pgsql-10/bin
|
||||||
add_profile: False
|
add_profile: false
|
||||||
# If automatic package installation fails, use `fromrepo` to specify the
|
# If automatic package installation fails, use `fromrepo` to specify the
|
||||||
# upstream repo to install packages from [#133, #185] (if upstream_repo: True)
|
# upstream repo to install packages from [#133, #185] (if upstream_repo: true)
|
||||||
fromrepo: 'jessie-pgdg'
|
fromrepo: 'jessie-pgdg'
|
||||||
|
|
||||||
### MACOS
|
### MACOS
|
||||||
@@ -27,7 +30,7 @@ postgres:
|
|||||||
# service:
|
# service:
|
||||||
# name: 'postgresql'
|
# name: 'postgresql'
|
||||||
# flags: -w -s -m fast
|
# flags: -w -s -m fast
|
||||||
# sysrc: True
|
# sysrc: true
|
||||||
pkgs_extra:
|
pkgs_extra:
|
||||||
- postgresql-contrib
|
- postgresql-contrib
|
||||||
- postgresql-plpython
|
- postgresql-plpython
|
||||||
@@ -83,7 +86,7 @@ postgres:
|
|||||||
- ['users_as_appuser', 'jsmith', 'connuser']
|
- ['users_as_appuser', 'jsmith', 'connuser']
|
||||||
|
|
||||||
# Backup extension for configuration files, defaults to ``.bak``.
|
# Backup extension for configuration files, defaults to ``.bak``.
|
||||||
# Set ``False`` to stop creation of backups when config files change.
|
# Set ``false`` to stop creation of backups when config files change.
|
||||||
{%- if salt['status.time']|default(none) is callable %}
|
{%- if salt['status.time']|default(none) is callable %}
|
||||||
config_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}"
|
config_backup: ".backup@{{ salt['status.time']('%y-%m-%d_%H:%M:%S') }}"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -93,9 +96,9 @@ postgres:
|
|||||||
# If Salt is unable to detect init system running in the scope of state run,
|
# If Salt is unable to detect init system running in the scope of state run,
|
||||||
# probably we are trying to bake a container/VM image with PostgreSQL.
|
# probably we are trying to bake a container/VM image with PostgreSQL.
|
||||||
# Use ``bake_image`` setting to control how PostgreSQL will be started: if set
|
# Use ``bake_image`` setting to control how PostgreSQL will be started: if set
|
||||||
# to ``True`` the raw ``pg_ctl`` will be utilized instead of packaged init
|
# to ``true`` the raw ``pg_ctl`` will be utilized instead of packaged init
|
||||||
# script, job or unit run with Salt ``service`` state.
|
# script, job or unit run with Salt ``service`` state.
|
||||||
bake_image: True
|
bake_image: true
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
@@ -131,18 +134,18 @@ postgres:
|
|||||||
localUser:
|
localUser:
|
||||||
ensure: present
|
ensure: present
|
||||||
password: '98ruj923h4rf'
|
password: '98ruj923h4rf'
|
||||||
createdb: False
|
createdb: false
|
||||||
createroles: False
|
createroles: false
|
||||||
inherit: True
|
inherit: true
|
||||||
replication: False
|
replication: false
|
||||||
|
|
||||||
remoteUser:
|
remoteUser:
|
||||||
ensure: present
|
ensure: present
|
||||||
password: '98ruj923h4rf'
|
password: '98ruj923h4rf'
|
||||||
createdb: False
|
createdb: false
|
||||||
createroles: False
|
createroles: false
|
||||||
inherit: True
|
inherit: true
|
||||||
replication: False
|
replication: false
|
||||||
|
|
||||||
absentUser:
|
absentUser:
|
||||||
ensure: absent
|
ensure: absent
|
||||||
@@ -183,14 +186,14 @@ postgres:
|
|||||||
|
|
||||||
# optional extensions to install in schema
|
# optional extensions to install in schema
|
||||||
extensions:
|
extensions:
|
||||||
|
# postgis: {}
|
||||||
uuid-ossp:
|
uuid-ossp:
|
||||||
schema: uuid-ossp
|
schema: uuid-ossp
|
||||||
maintenance_db: db1
|
maintenance_db: db1
|
||||||
#postgis: {}
|
|
||||||
|
|
||||||
remove:
|
remove:
|
||||||
data: True
|
data: true
|
||||||
multiple_releases: True
|
multiple_releases: true
|
||||||
releases: ['9.6', '10',]
|
releases: ['9.6', '10']
|
||||||
|
|
||||||
# vim: ft=yaml ts=2 sts=2 sw=2 et
|
# vim: ft=yaml ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
### Set parameters based on PostgreSQL version supplied with particular distro
|
### Set parameters based on PostgreSQL version supplied with particular distro
|
||||||
|
|
||||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
# Default lookup dictionary
|
# Default lookup dictionary
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
use_upstream_repo: True
|
use_upstream_repo: true
|
||||||
add_profile: False # add bin_dir to $PATH, if installed from repos
|
add_profile: false # add bin_dir to $PATH, if installed from repos
|
||||||
version: '10'
|
version: '10'
|
||||||
pkg: postgresql
|
pkg: postgresql
|
||||||
pkgs_extra: []
|
pkgs_extra: []
|
||||||
@@ -17,7 +20,7 @@ postgres:
|
|||||||
group: postgres
|
group: postgres
|
||||||
|
|
||||||
prepare_cluster:
|
prepare_cluster:
|
||||||
run: True
|
run: true
|
||||||
pgcommand: initdb -D
|
pgcommand: initdb -D
|
||||||
pgtestfile: PG_VERSION
|
pgtestfile: PG_VERSION
|
||||||
user: postgres
|
user: postgres
|
||||||
@@ -38,6 +41,7 @@ postgres:
|
|||||||
tmpdir: /tmp/postgrestmp
|
tmpdir: /tmp/postgrestmp
|
||||||
postgresapp:
|
postgresapp:
|
||||||
# See: https://github.com/PostgresApp/PostgresApp/releases/
|
# See: https://github.com/PostgresApp/PostgresApp/releases/
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
url: https://github.com/PostgresApp/PostgresApp/releases/download/v2.1.1/Postgres-2.1.1.dmg
|
url: https://github.com/PostgresApp/PostgresApp/releases/download/v2.1.1/Postgres-2.1.1.dmg
|
||||||
sum: sha256=ac0656b522a58fd337931313f09509c09610c4a6078fe0b8e469e69af1e1750b
|
sum: sha256=ac0656b522a58fd337931313f09509c09610c4a6078fe0b8e469e69af1e1750b
|
||||||
homebrew:
|
homebrew:
|
||||||
@@ -69,9 +73,9 @@ postgres:
|
|||||||
|
|
||||||
service:
|
service:
|
||||||
name: postgresql
|
name: postgresql
|
||||||
sysrc: False
|
sysrc: false
|
||||||
|
|
||||||
bake_image: False
|
bake_image: false
|
||||||
|
|
||||||
fromrepo: ''
|
fromrepo: ''
|
||||||
|
|
||||||
@@ -86,6 +90,6 @@ postgres:
|
|||||||
altpriority: 0
|
altpriority: 0
|
||||||
|
|
||||||
remove:
|
remove:
|
||||||
data: False
|
data: false
|
||||||
multiple_releases: False
|
multiple_releases: false
|
||||||
releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10',]
|
releases: ['9.2', '9.3', '9.4', '9.5', '9.6', '10']
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||||
|
|
||||||
{% set release = repo.version|replace('.', '') %}
|
{% set release = repo.version|replace('.', '') %}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
{% import_yaml "postgres/repo.yaml" as repo %}
|
{% import_yaml "postgres/repo.yaml" as repo %}
|
||||||
|
|
||||||
Fedora:
|
Fedora:
|
||||||
pkg_repo:
|
pkg_repo:
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch'
|
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/fedora/fedora-$releasever-$basearch'
|
||||||
remove:
|
remove:
|
||||||
releases: ['9.4', '9.5', '9.6', '10',]
|
releases: ['9.4', '9.5', '9.6', '10']
|
||||||
|
|
||||||
# vim: ft=sls
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
# This file allows to get PostgreSQL version and upstream repo settings
|
# This file allows to get PostgreSQL version and upstream repo settings
|
||||||
# early from Pillar to set correct lookup dictionaty items
|
# early from Pillar to set correct lookup dictionaty items
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=yaml
|
||||||
|
---
|
||||||
name: default
|
name: default
|
||||||
title: postgres formula
|
title: postgres formula
|
||||||
maintainer: SaltStack Formulas
|
maintainer: SaltStack Formulas
|
||||||
|
|||||||
Reference in New Issue
Block a user