add kitchen ci and travis support [WIP] (#1)
* add kitchen ci, travis ci
* fine tune sudo & gem deps
* Update client_single.sls
* Update README.rst
diff --git a/.gitignore b/.gitignore
index aa8e42a..5fb9aae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,8 @@
*.swp
*.pyc
.ropeproject
+.venv/
+srv/
+.kitchen
+.vendor
+Gemfile.lock
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..1500184
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,52 @@
+---
+driver:
+ name: docker
+ hostname: git.ci.local
+ use_sudo: false
+
+provisioner:
+ name: salt_solo
+ salt_install: bootstrap
+ salt_bootstrap_url: https://bootstrap.saltstack.com
+ salt_version: latest
+ require_chef: false
+ dependencies:
+ - name: linux
+ repo: git
+ source: https://github.com/salt-formulas/salt-formula-linux
+ log_level: error
+ formula: git
+ grains:
+ noservices: True
+ state_top:
+ base:
+ "*":
+ - git
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - git
+verifier:
+ name: inspec
+ sudo: true
+
+platforms:
+ - name: ubuntu-trusty
+ driver_config:
+ image: trevorj/salty-whales:trusty
+ platform: ubuntu
+
+ - name: ubuntu-xenial
+ driver_config:
+ image: trevorj/salty-whales:xenial
+ platform: ubuntu
+
+suites:
+
+ - name: client_single
+ provisioner:
+ pillars-from-files:
+ git.sls: tests/pillar/client_single.sls
+
+# vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..43e84c7
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,25 @@
+sudo: required
+services:
+ - docker
+
+install:
+ - pip install PyYAML
+ - pip install virtualenv
+ - |
+ test -e Gemfile || cat <<EOF > Gemfile
+ source 'https://rubygems.org'
+ gem 'rake'
+ gem 'test-kitchen'
+ gem 'kitchen-docker'
+ gem 'kitchen-inspec'
+ gem 'inspec'
+ gem 'kitchen-salt', :git => 'https://github.com/epcim/kitchen-salt.git', :branch => 'dependencis-pkg-repo2'
+ #Waiting for PR#78
+ #gem 'kitchen-salt', '>=0.2.25'
+ - bundle install
+
+before_script:
+ - make test
+
+script:
+ - test ! -e .kitchen.yml || bundle exec kitchen test
diff --git a/metadata.yml b/metadata.yml
index 1d17a61..7b9cc1e 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,6 +1,6 @@
name: "git"
version: "0.2"
-source: "https://github.com/tcpcloud/salt-formula-git"
+source: "https://github.com/salt-formulas/salt-formula-git"
dependencies:
- name: linux
- source: "https://github.com/tcpcloud/salt-formula-linux"
\ No newline at end of file
+ source: "https://github.com/salt-formulas/salt-formula-linux"
diff --git a/tests/pillar/client_single.sls b/tests/pillar/client_single.sls
index b049fc4..b4a0035 100644
--- a/tests/pillar/client_single.sls
+++ b/tests/pillar/client_single.sls
@@ -1,6 +1,16 @@
git:
client:
enabled: true
+ user:
+ - user:
+ name: jdoe
+ email: j@doe.com
linux:
system:
enabled: true
+ user:
+ jdoe:
+ enabled: true
+ sudo: true
+ full_name: John Doe
+ home: /home/jdoe