From: David Galloway Date: Tue, 21 Dec 2021 21:13:30 +0000 (-0500) Subject: Cut upstream releases from $BRANCH-release branch X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fdash-release;p=ceph-build.git Cut upstream releases from $BRANCH-release branch This will stop the use of the ceph-releases.git repo. This will also allow us to cut a hotfix release without doing the "branch dance." Signed-off-by: David Galloway --- diff --git a/ansible/roles/ceph-release/tasks/main.yml b/ansible/roles/ceph-release/tasks/main.yml index 11fc0d533..cc9596a64 100644 --- a/ansible/roles/ceph-release/tasks/main.yml +++ b/ansible/roles/ceph-release/tasks/main.yml @@ -12,34 +12,33 @@ accept_hostkey: yes when: ceph_repo.stat.exists is defined and ceph_repo.stat.exists == false -- name: add origin - command: git remote add origin git@github.com:ceph/ceph-releases.git chdir=ceph - # because if the repo exists then it probably has the origin already in there - ignore_errors: yes +- name: fetch upstream + command: git fetch upstream -v chdir=ceph -- name: reset --hard to upstream - command: git reset --hard origin/{{ branch }} chdir=ceph - ignore_errors: yes - when: clean +- name: "check if {{ branch }}-release branch exists" + command: git ls-remote --heads upstream {{ branch }}-release chdir=ceph + register: release_branch_exists -- name: force git checkout {{ branch }} branch - command: git checkout -f {{ branch }} chdir=ceph +- name: "create {{ branch }}-release branch" + command: git checkout -b {{ branch }}-release {{ branch }} chdir=ceph + when: '"{{ branch }}" not in release_branch_exists.stdout' -- name: fetch upstream - command: git fetch upstream -v chdir=ceph +- name: "push new {{ branch }}-release branch" + command: git push -f origin {{ branch }}-release chdir=ceph + when: '"{{ branch }}" not in release_branch_exists.stdout' -- name: git submodule update - command: git submodule update --init chdir=ceph +- name: "force git checkout {{ branch }}-release branch" + command: git checkout -f {{ branch }}-release chdir=ceph -- name: check if configure.ac exists (pre-kraken) - stat: path=ceph/configure.ac - register: configure_ac +- name: reset --hard to upstream + command: git reset --hard upstream/{{ branch }} chdir=ceph + ignore_errors: yes + when: + - clean + - not hotfix|bool -- name: replace the version in configure.ac (pre-kraken) - lineinfile: dest=ceph/configure.ac - regexp='^AC_INIT\(\[ceph\],' - line='AC_INIT([ceph], [{{ version }}], [ceph-devel@vger.kernel.org])' - when: configure_ac.stat.exists +- name: git submodule update + command: git submodule update --init chdir=ceph - name: check if CMakeLists.txt exists stat: path=ceph/CMakeLists.txt @@ -69,7 +68,7 @@ when: clean - name: clear the previous remote tag - command: git push origin :v{{ version }} chdir=ceph + command: git push upstream :v{{ version }} chdir=ceph ignore_errors: yes when: clean @@ -84,8 +83,11 @@ # official ceph repo it is ok to forcefully push "losing" changes. This may # come up if we need to re-do a release which means doing a fresh commit to # the debian changelog and rpm files and tagging. -- name: force push changes to ceph-releases git repo - command: git push -f origin {{ branch }} chdir=ceph +- name: "force push version commit to working and release {{ branch }} branch" + command: git push -f upstream {{ branch }}-release chdir=ceph + +- name: "force push the version commit to the {{ branch }} branch" + command: git push -f upstream {{ branch }}-release:{{ branch }} chdir=ceph - name: push the newly created tag - command: git push origin v{{ version }} chdir=ceph + command: git push upstream v{{ version }} chdir=ceph diff --git a/ceph-setup/config/definitions/ceph-setup.yml b/ceph-setup/config/definitions/ceph-setup.yml index 73792a22d..19ad997e8 100644 --- a/ceph-setup/config/definitions/ceph-setup.yml +++ b/ceph-setup/config/definitions/ceph-setup.yml @@ -24,7 +24,7 @@ scm: - git: - url: git@github.com:ceph/ceph-releases.git + url: git@github.com:ceph/ceph.git # Use the SSH key attached to the ceph-jenkins GitHub account. credentials-id: 'jenkins-build' # not really a branch, this builds the TAG that was previously diff --git a/ceph-tag/build/build b/ceph-tag/build/build index 32b7aa6e4..34db34ff5 100644 --- a/ceph-tag/build/build +++ b/ceph-tag/build/build @@ -16,4 +16,4 @@ install_python_packages $TEMPVENV "pkgs[@]" # run ansible to do all the tagging and release specifying # a local connection and 'localhost' as the host where to execute cd "$WORKSPACE/ceph-build/ansible/" -$VENV/ansible-playbook -i "localhost," -c local release.yml --extra-vars="version=$VERSION branch=$BRANCH force_version=$FORCE_VERSION release=stable clean=true project=ceph" +$VENV/ansible-playbook -i "localhost," -c local release.yml --extra-vars="version=$VERSION branch=$BRANCH force_version=$FORCE_VERSION hotfix=$HOTFIX release=stable clean=true project=ceph" diff --git a/ceph/config/definitions/ceph.yml b/ceph/config/definitions/ceph.yml index 6128f4f8a..1feddb1bc 100644 --- a/ceph/config/definitions/ceph.yml +++ b/ceph/config/definitions/ceph.yml @@ -34,6 +34,11 @@ If this is checked, then the builds will be pushed to chacra under the 'test' re Defaults to checked." default: true + - string: + name: HOTFIX + description: "When this is checked, the $BRANCH-release branch will *not* rebase on its parent $BRANCH branch like a regular release would. This is useful for hotfixes because we can just merge a hotfix into $BRANCH-release then build that branch. (This is a string because we pass it to `ansible-playbook` as a variable.)" + default: 'False' + - bool: name: THROWAWAY description: "