Bundling the grains generation in a script for Travis

This commit is contained in:
Elijah Lazkani 2017-03-03 23:10:12 -05:00
parent b6d23d640e
commit 73e9342004
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,7 @@ install:
# Copy these states # Copy these states
- sudo mkdir -p /srv/salt/states - sudo mkdir -p /srv/salt/states
- sudo cp -r salty/base/* /srv/salt/states - sudo cp -r salty/base/* /srv/salt/states
- sudo cp .travis/minion /etc/salt/minion - sudo cp -r .travis/* /etc/salt/
- sudo service salt-minion restart - sudo service salt-minion restart
# Additional debug help # Additional debug help
@ -19,7 +19,7 @@ install:
# See what kind of travis box you're on # See what kind of travis box you're on
# to help with making your states compatible with travis # to help with making your states compatible with travis
#- sudo salt-call --local --config=./ --state-output=changes grains.setvals "{ \"user\": \"$(whoami)\", \"group\": \"$(id -g -n $(whoami))\", \"homedir\": \"$HOME\" }" - sudo sh grains.sh
script: script:
- sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.apply - sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.apply

3
.travis/grains.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
sudo salt-call --local --config=./ --state-output=changes grains.setvals "{ \"user\": \"$(whoami)\", \"group\": \"$(id -g -n $(whoami))\", \"homedir\": \"$home\" }"