Skip to content

Commit

Permalink
refactor(rewrite): modernize formula and fresh start
Browse files Browse the repository at this point in the history
- align tom template formula
- fix bugs
- add Windows support
- Add saltstack dockercompose module support
- Get rid of confusing old legacy spagetti jinja conditionals
- Travis CI (package/archive) is passing
- Windows is passing
- Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191
- Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74

BREAKING CHANGE: This version is not backwards compatible. Update
 your states and pillar data to align with new formula.

 - MacOS was not tested in this PR but hopefully no regression.
 - docker.containers: sls was simplified (raise PR if regression)
  • Loading branch information
noelmcloughlin committed Nov 11, 2020
1 parent eb3bc72 commit 9a867fe
Show file tree
Hide file tree
Showing 121 changed files with 3,995 additions and 1,254 deletions.
76 changes: 47 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ version: '~> 1.0'
language: 'ruby'
cache: 'bundler'

env:
global:
- CHANGE_MINIKUBE_NONE_USER=true
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config

## Services config
services:
- docker

## Script to run for the test stage
script:
- env
- bin/kitchen verify "${INSTANCE}"

## Stages and jobs matrix
Expand Down Expand Up @@ -72,35 +82,43 @@ jobs:
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
# - env: INSTANCE=default-fedora-31-master-py3
# - env: INSTANCE=default-opensuse-leap-151-master-py3
# - env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-debian-10-2019-2-py3
- env: INSTANCE=default-debian-9-2019-2-py3
- env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=default-centos-8-2019-2-py3
# - env: INSTANCE=default-fedora-31-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=default-centos-7-2019-2-py2
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
- env: INSTANCE=default-arch-base-latest-2019-2-py2
# - env: INSTANCE=default-fedora-30-2018-3-py3
- env: INSTANCE=default-debian-9-2018-3-py2
# - env: INSTANCE=default-ubuntu-1604-2018-3-py2
# - env: INSTANCE=default-centos-7-2018-3-py2
# - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
# - env: INSTANCE=default-amazonlinux-1-2018-3-py2
# - env: INSTANCE=default-arch-base-latest-2018-3-py2
# - env: INSTANCE=default-debian-8-2017-7-py2
- env: INSTANCE=default-ubuntu-1604-2017-7-py2
# - env: INSTANCE=default-centos-6-2017-7-py2
# - env: INSTANCE=default-fedora-30-2017-7-py2
# - env: INSTANCE=default-opensuse-leap-151-2017-7-py2
# - env: INSTANCE=default-amazonlinux-1-2017-7-py2
# - env: INSTANCE=default-arch-base-latest-2017-7-py2
# env: INSTANCE=archive-debian-10-master-py3
- env: INSTANCE=package-debian-10-master-py3
- env: INSTANCE=archive-ubuntu-1804-master-py3
- env: INSTANCE=clean-ubuntu-1804-master-py3
- env: INSTANCE=package-ubuntu-1804-master-py3
- env: INSTANCE=archive-centos-8-master-py3
- env: INSTANCE=package-centos-8-master-py3
# env: INSTANCE=archive-fedora-31-master-py3
- env: INSTANCE=package-fedora-31-master-py3
- env: INSTANCE=archive-opensuse-leap-151-master-py3
- env: INSTANCE=package-opensuse-leap-151-master-py3
- env: INSTANCE=archive-amazonlinux-2-master-py3
# env: INSTANCE=package-amazonlinux-2-master-py3
# - env: INSTANCE=archive-debian-10-3000-2-py3
# - env: INSTANCE=archive-debian-9-3000-2-py3
# - env: INSTANCE=archive-ubuntu-1804-3000-2-py3
# - env: INSTANCE=archive-centos-8-3000-2-py3
# - env: INSTANCE=archive-centos-7-3000-2-py3
# - env: INSTANCE=archive-fedora-31-3000-2-py3
# - env: INSTANCE=archive-opensuse-leap-151-3000-2-py3
# - env: INSTANCE=archive-amazonlinux-2-3000-2-py3
# - env: INSTANCE=archive-ubuntu-1804-3000-2-py2
# - env: INSTANCE=archive-ubuntu-1604-3000-2-py2
# - env: INSTANCE=archive-archive-base-latest-3000-2-py2
# - env: INSTANCE=archive-debian-10-2019-2-py3
# - env: INSTANCE=archive-debian-9-2019-2-py3
# - env: INSTANCE=archive-ubuntu-1804-2019-2-py3
# - env: INSTANCE=archive-ubuntu-1604-2019-2-py3
# - env: INSTANCE=archive-centos-8-2019-2-py3
# - env: INSTANCE=archive-centos-7-2019-2-py3
# - env: INSTANCE=archive-fedora-31-2019-2-py3
# env: INSTANCE=archive-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=archive-amazonlinux-2-2019-2-py3
# - env: INSTANCE=archive-centos-6-2019-2-py2
# - env: INSTANCE=archive-amazonlinux-1-2019-2-py2
- env: INSTANCE=archive-arch-base-latest-2019-2-py2
- env: INSTANCE=package-arch-base-latest-2019-2-py2

## Define the release stage that runs `semantic-release`
- stage: 'release'
Expand Down
54 changes: 4 additions & 50 deletions docker/clean.sls
Original file line number Diff line number Diff line change
@@ -1,53 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{% from "docker/map.jinja" import docker with context %}

docker-packages-cleaned-service-dead:
service.dead:
- name: docker
{% if "process_signature" in docker %}
- sig: {{ docker.process_signature }}
- onlyif: ps -ef | grep "{{ docker.process_signature }}" ##stop stderr from sig
{% endif %}
- require_in:
- pkg: docker-packages-cleaned
docker-packages-cleaned:
pkg.removed:
- pkgs:
- {{ docker.pkg.old_name if docker.use_old_repo else docker.pkg.name }}
- docker
- docker.io
- docker-client
- docker-client-latest
- docker-common
- docker-latest
- docker-latest-logrotate
- docker-logrotate
- docker-selinux
- docker-engine-selinux
- docker-engine
{# remove pip packages installed by formula #}
docker-pips-removed:
pip.removed:
- onlyif: python -m pip --version >/dev/null 2>&1
- names:
{% if docker.compose_version -%}
- docker-compose == {{ docker.compose_version }}
{% else -%}
- docker-compose
{% endif -%}
{% if docker.install_docker_py -%}
{% if "python_package" in docker -%}
- {{ docker.python_package }}
{% elif "pip_version" in docker -%}
- docker-py {{ docker.pip_version }}
{% else -%}
- docker-py
{%- endif -%}
{% endif %}
{%- if docker.proxy %}
- proxy: {{ docker.proxy }}
{%- endif %}
include:
# .containers.clean
- .compose.clean
- .software.clean
39 changes: 14 additions & 25 deletions docker/codenamemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,31 @@
# vim: ft=yaml
---
wheezy:
kernel:
pkg:
pkg:
deps:
name: linux-image-amd64
fromrepo: wheezy-backports
pkgrepo:
name: deb http://http.debian.net/debian wheezy-backports main
humanname: Wheezy Backports
dist: wheezy-backports
pkgs: []

jessie:
kernel:
pkg:
pkg:
deps:
name: linux-image-amd64
fromrepo: jessie-backports
pkgrepo:
name: deb http://http.debian.net/debian jessie-backports main
humanname: Jessie Backports
dist: jessie-backports
pkgs: []

trusty:
kernel:
pkgs:
pkg:
deps:
- linux-image-extra-virtual
- linux-image-extra-{{ grains.kernelrelease }}

precise:
kernel:
pkgs:
pkg:
deps:
- linux-image-generic-lts-raring
- linux-headers-generic-lts-raring

CentOS Linux 7 (Core):
pkgs:
- yum-plugin-versionlock
- python2-pip
# python-docker
- rpmdevtools
pkg:
deps:
- yum-plugin-versionlock
- python2-pip
- python-docker-py
- rpmdevtools
130 changes: 0 additions & 130 deletions docker/compose-ng.sls

This file was deleted.

25 changes: 0 additions & 25 deletions docker/compose.sls

This file was deleted.

22 changes: 22 additions & 0 deletions docker/compose/build.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import data as d with context %}
{%- set formula = d.formula %}
{%- if 'wanted' in d.compose and d.compose.wanted %}
{%- for service in d.compose.wanted|unique %}
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
{{ formula }}-compose-{{ service }}-build:
module.run:
- name: dockercompose.build
- path: {{ d.compose[service]['path'] }}
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
- service_names: {{ d.compose[service]['service_names'] }}
{%- endif %}
{% endif %}
{%- endfor %}
{%- endif %}
5 changes: 5 additions & 0 deletions docker/compose/clean.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .software.clean
Loading

0 comments on commit 9a867fe

Please sign in to comment.