Commit f8386d31 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'ci/update-manifest' into 'master'

CI: update both master and internal manifest versions

See merge request fsl/conda/installer!5
parents 5b47a4f8 58175bab
......@@ -57,7 +57,7 @@ def update_manifest(version):
f.write(line)
def checkout_and_update_manifest(server, token, tag):
def checkout_and_update_manifest(server, token, tag, base_branch):
manifest_url = gen_repository_url(MANIFEST_PATH, server, token)
branch = f'mnt/installer-{tag}'
......@@ -68,7 +68,7 @@ def checkout_and_update_manifest(server, token, tag):
with indir('manifest'):
sprun(f'git config user.name {USERNAME}')
sprun(f'git config user.email {EMAIL}')
sprun(f'git checkout -b {branch} master')
sprun(f'git checkout -b {branch} {base_branch}')
update_manifest(tag)
sprun( 'git add *')
sprun(f'git commit -m "{msg}"')
......@@ -83,13 +83,14 @@ def main(server=None, token=None, tag=None):
if token is None: token = os.environ['FSL_CI_API_TOKEN']
if tag is None: tag = os.environ['CI_COMMIT_TAG']
branch = checkout_and_update_manifest(server, token, tag)
open_merge_request(MANIFEST_PATH,
branch,
MERGE_REQUEST_MSG,
server,
token)
for destination in ['master', 'internal']:
branch = checkout_and_update_manifest(server, token, tag, destination)
open_merge_request(MANIFEST_PATH,
branch,
MERGE_REQUEST_MSG,
server,
token,
destination)
if __name__ == '__main__':
......
......@@ -13,13 +13,11 @@ stages:
- test
- release
# Only run pipeline on master branch, tags, and MRs
# Don't run pipeline on MRs
workflow:
rules:
- if: '$CI_COMMIT_TAG != null'
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_MERGE_REQUEST_ID != null'
- when: never
- if: '$CI_MERGE_REQUEST_ID == null'
when: never
# These variables should be set as CI/CD variables in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment