Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
salt-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
salt-formula
Commits
9362277f
Commit
9362277f
authored
6 years ago
by
nb
Committed by
sticky-note
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(per-formula-opts): configure git.latest state per formula
parent
1c03133e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pillar.example
+8
-0
8 additions, 0 deletions
pillar.example
salt/formulas.jinja
+2
-1
2 additions, 1 deletion
salt/formulas.jinja
salt/formulas.sls
+5
-2
5 additions, 2 deletions
salt/formulas.sls
with
15 additions
and
3 deletions
pillar.example
+
8
−
0
View file @
9362277f
...
...
@@ -424,10 +424,18 @@ salt_formulas:
base
:
-
salt-formula
-
postfix-formula
-
nginx-formula
:
# We can also override some options per formula
rev
:
'
v1.1.0'
# Pin a version
-
openssh-formula
:
rev
:
'
3e01ad8'
# or pin a commit id
dev
:
-
salt-formula
-
postfix-formula
-
openssh-formula
-
nginx-formula
:
# You can also pull from another location
name
:
'
https://github.com/another-fork-location/salt-formula.git'
rev
:
'
feat/feature'
# Likewise for the alternative method (single directory, multiple branches)
production
:
-
salt-formula
...
...
This diff is collapsed.
Click to expand it.
salt/formulas.jinja
+
2
−
1
View file @
9362277f
...
...
@@ -25,7 +25,8 @@
{%- macro formulas_roots(env) -%}
{%- set value = [] -%}
{%- for dir in formulas.get(env, []) -%}
{%- for formula in formulas.get(env, []) -%}
{%- set dir = formula | first if formula is mapping else formula %}
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml -%}
{%- do value.append('{0}/{1}'.format(basedir, dir)) -%}
{%- endfor -%}
...
...
This diff is collapsed.
Click to expand it.
salt/formulas.sls
+
5
−
2
View file @
9362277f
...
...
@@ -13,9 +13,11 @@
# Loop over all formulas listed in pillar data
{%- for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %}
{%- for entry in entries %}
{%- set f_name = entry | first if entry is mapping else entry %}
{%- set f_opts = entry[f_name] if entry is mapping else {} %}
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml %}
{%- set gitdir = '{0}/{1}'.format(basedir,
entry
) %}
{%- set gitdir = '{0}/{1}'.format(basedir,
f_name
) %}
{%- set update = formulas_git_opt(env, 'update')|load_yaml %}
{%- if formulas_settings.checkout_orig_branch %}
...
...
@@ -45,11 +47,12 @@
{%- if gitdir_env not in processed_gitdir_envs %}
{%- do processed_gitdir_envs.append(gitdir_env) %}
{%- set options = formulas_opts_for_git_latest(env)|load_yaml %}
{%- do options.update(f_opts) %}
{%- set baseurl = formulas_git_opt(env, 'baseurl')|load_yaml %}
{{ gitdir_env }}:
git.latest:
- name: {{ baseurl }}/{{
entry
}}.git
- name: {{ baseurl }}/{{
f_name
}}.git
- target: {{ gitdir }}
{%- for key, value in options.items() %}
- {{ key }}: {{ value }}
...
...
This diff is collapsed.
Click to expand it.
Jan Philipp Timme
@timmej
mentioned in commit
8eab9350
·
5 years ago
mentioned in commit
8eab9350
mentioned in commit 8eab9350438d7b425182a9682a36b3e136467bfd
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment