saltstack-formulas / salter

Salter orchestrates software profiles onto Linux/MacOS/FreeBSD/Windows without fuss.
Apache License 2.0
6 stars 5 forks source link

Easy integration into your site #14

Closed noelmcloughlin closed 5 years ago

noelmcloughlin commented 5 years ago

While designed for easy reuse and extension, a reference solution is undocumented. Therefore It may be unclear how to integrate with your sites. Here is a simple three-step guide explaining how a site named BigCorp could integrate salt-desktop....... a generic solution.

1. Your site-specific repo: https://git.bigcorp.com/bigcorp-desktop.git

bigcorp-desktop/
      profiles/
          bigcorp.sls
          bigcorp/
              profleA
              profileB
      sbin/
      bigcorp.sh
      README.md

2. Your site specific readme: https://git.bigcorp.com/bigcorp-desktop/raw/README.md

====== readme start ======

Salt Desktop orchestrates useful software onto Linux/MacOS without fuss.

Setup

curl -o salt.sh https://raw.githubusercontent.com/saltstack-formulas/salt-desktop/master/bin/salt.sh && sudo bash salt.sh sudo -s rm -fr /srv/salt && git clone https://git.bigcorp.com/bigcorp-desktop.git /srv/salt cd /srv/salt ./bigcorp.sh exit

For generic usage, see https://github.com/saltstack-formulas/salt-desktop#stack-profiles

BigCorp next step

bla bla bla bla bla

==== readme end =====

3. Your site-specific bigcorp.sh script

#!/usr/bin/env bash
git config user.email "not@important.com"
git config user.name "not important"
git init
git remote add salt https://github.com/saltstack-formulas/salt-desktop.git
git pull salt master --allow-unrelated-histories -f >/dev/null
if (( $? == 0 ))
then
    mv ./sbin/* ./bin/
    mv ./profiles/bigcorp.sls ./profiles/config.sls
    git init
else
    [[ -x "/usr/bin/xcode-select" ]] && /usr/bin/xcode-select --install
    echo "Error - something is not right"
    echo "Ensure your OS is uptodate (git 2.9 or later)"
    exit 1 
fi

Maybe formula should be expanded to add this basic integration guidance.

noelmcloughlin commented 5 years ago

Git 2.9 or later is required.

noelmcloughlin commented 5 years ago

PR #21 introduces the solution I have developed for my workplace.