Compare commits

..

2 commits

Author SHA1 Message Date
Actaeus Curabitur
b518fd1263 rename merge to squash and update branch names 2022-09-08 06:31:27 -05:00
Actaeus Curabitur
66bfffb930 updated saltmaster git 2022-09-08 06:25:50 -05:00
4 changed files with 34 additions and 18 deletions

View file

@ -6,19 +6,13 @@ branches:
{%- endfor %}
git:
salt:
{%- for branch in branches %}
salt_{{branch}}:
repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git"
path: "/srv/salt/prod"
branch: "master"
path: "/srv/salt/{{branch}}"
branch: "{{branch}}"
key: "git_actcur"
force: true
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
force: {{ "True" if branch == "prod" else "false" }}
email: "actcur@actcur.com"
name: "Actaeus Curabitur"
{%- endfor %}

View file

@ -3,17 +3,17 @@ git fetch --all;
#copy dev to history to ensure we don't lose changes if something goes wrong
git checkout history;
git reset --hard dev;
git reset --hard qual;
git push --force;
#merge to master
git checkout -B master origin/master;
git merge --squash dev;
git checkout -B prod origin/master;
git merge --squash qual;
git commit -am "$cm";
git push;
#clean dev
git checkout dev;
git reset --hard master;
git checkout qual;
git reset --hard prod;
git push --force;
git reset --hard origin/dev;
git reset --hard origin/qual;

18
states/test Normal file
View 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
View file

@ -0,0 +1,4 @@
/test:
file.managed:
- source: salt://test
- template: jinja