Compare commits
2 commits
c0d27e13d7
...
b518fd1263
Author | SHA1 | Date | |
---|---|---|---|
|
b518fd1263 | ||
|
66bfffb930 |
4 changed files with 34 additions and 18 deletions
|
@ -6,19 +6,13 @@ branches:
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
git:
|
git:
|
||||||
salt:
|
{%- for branch in branches %}
|
||||||
|
salt_{{branch}}:
|
||||||
repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git"
|
repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git"
|
||||||
path: "/srv/salt/prod"
|
path: "/srv/salt/{{branch}}"
|
||||||
branch: "master"
|
branch: "{{branch}}"
|
||||||
key: "git_actcur"
|
key: "git_actcur"
|
||||||
force: true
|
force: {{ "True" if branch == "prod" else "false" }}
|
||||||
email: "actcur@actcur.com"
|
|
||||||
name: "Actaeus Curabitur"
|
|
||||||
salt_dev:
|
|
||||||
repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git"
|
|
||||||
path: "/srv/salt/dev"
|
|
||||||
branch: "dev"
|
|
||||||
key: "git_actcur"
|
|
||||||
force: true
|
|
||||||
email: "actcur@actcur.com"
|
email: "actcur@actcur.com"
|
||||||
name: "Actaeus Curabitur"
|
name: "Actaeus Curabitur"
|
||||||
|
{%- endfor %}
|
||||||
|
|
|
@ -3,17 +3,17 @@ git fetch --all;
|
||||||
|
|
||||||
#copy dev to history to ensure we don't lose changes if something goes wrong
|
#copy dev to history to ensure we don't lose changes if something goes wrong
|
||||||
git checkout history;
|
git checkout history;
|
||||||
git reset --hard dev;
|
git reset --hard qual;
|
||||||
git push --force;
|
git push --force;
|
||||||
|
|
||||||
#merge to master
|
#merge to master
|
||||||
git checkout -B master origin/master;
|
git checkout -B prod origin/master;
|
||||||
git merge --squash dev;
|
git merge --squash qual;
|
||||||
git commit -am "$cm";
|
git commit -am "$cm";
|
||||||
git push;
|
git push;
|
||||||
|
|
||||||
#clean dev
|
#clean dev
|
||||||
git checkout dev;
|
git checkout qual;
|
||||||
git reset --hard master;
|
git reset --hard prod;
|
||||||
git push --force;
|
git push --force;
|
||||||
git reset --hard origin/dev;
|
git reset --hard origin/qual;
|
18
states/test
Normal file
18
states/test
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{%- set branches=salt.cmd.shell('git ls-remote https://git.actcur.com/actcur/salt.git | grep -o -P "(?<=refs/heads/).*" | grep -Pv "(^temp$)|(^history$)"').split('\n') -%}
|
||||||
|
branches:
|
||||||
|
saltmaster:
|
||||||
|
{%- for branch in branches %}
|
||||||
|
- {{branch}}
|
||||||
|
{%- endfor %}
|
||||||
|
|
||||||
|
git:
|
||||||
|
{%- for branch in branches %}
|
||||||
|
salt_{{branch}}:
|
||||||
|
repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git"
|
||||||
|
path: "/srv/salt/{{branch}}"
|
||||||
|
branch: "{{branch}}"
|
||||||
|
key: "git_actcur"
|
||||||
|
force: {{ "True" if branch == "prod" else "false" }}
|
||||||
|
email: "actcur@actcur.com"
|
||||||
|
name: "Actaeus Curabitur"
|
||||||
|
{%- endfor %}
|
4
states/test.sls
Normal file
4
states/test.sls
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
/test:
|
||||||
|
file.managed:
|
||||||
|
- source: salt://test
|
||||||
|
- template: jinja
|
Loading…
Add table
Reference in a new issue