mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add salt's git repo as upstream and fetch tags if using a custom git url
This commit is contained in:
parent
1274a8ea15
commit
3a1cdd13fc
1 changed files with 30 additions and 0 deletions
|
@ -47,6 +47,8 @@ try:
|
|||
except ImportError:
|
||||
HAS_GITHUB = False
|
||||
|
||||
SALT_GIT_URL = 'https://github.com/saltstack/salt.git'
|
||||
|
||||
|
||||
def generate_vm_name(platform):
|
||||
'''
|
||||
|
@ -312,6 +314,34 @@ def run(opts):
|
|||
sys.stdout.flush()
|
||||
time.sleep(5)
|
||||
|
||||
# Do we need extra setup?
|
||||
if opts.salt_url != SALT_GIT_URL:
|
||||
cmds = (
|
||||
'salt -t 100 {vm_name} git.remote_set /testing name={0!r} url={1!r}'.format(
|
||||
'upstream',
|
||||
SALT_GIT_URL,
|
||||
vm_name=vm_name
|
||||
),
|
||||
'salt -t 100 {vm_name} git.fetch /testing \'upstream --tags\''.format(
|
||||
vm_name=vm_name
|
||||
)
|
||||
)
|
||||
for cmd in cmds:
|
||||
print('Running CMD: {0}'.format(cmd))
|
||||
sys.stdout.flush()
|
||||
|
||||
proc = subprocess.Popen(
|
||||
cmd,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
)
|
||||
stdout, _ = proc.communicate()
|
||||
|
||||
if stdout:
|
||||
print(stdout)
|
||||
sys.stdout.flush()
|
||||
|
||||
# Run tests here
|
||||
cmd = (
|
||||
'salt -t 1800 {vm_name} state.sls {sls} pillar="{pillar}" '
|
||||
|
|
Loading…
Add table
Reference in a new issue