[OS-BUILD PATCH] CI: use common code for merge and release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Don Zickus <dzickus@xxxxxxxxxx>

CI: use common code for merge and release

Small cleanup to simplify code by re-using duplicated sections through
extends.

Also remove legacy config branch push (now done through merge_upstream).

Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index blahblah..blahblah 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -101,7 +101,7 @@ rhel9_baseline:
 
 
 # scheduled job
-merge_upstream:
+.scheduled_setup
   image: registry.gitlab.com/cki-project/containers/builder-fedora
   variables:
     GIT_DEPTH: "0"
@@ -121,10 +121,13 @@ merge_upstream:
     - chmod 644 ~/.ssh/known_hosts
     - git remote add gitlab git@xxxxxxxxxx:cki-project/kernel-ark.git
     - gpg2 --import "$TORVALDS_GPG_KEY"
-  script:
     - git checkout --track origin/master && git describe
-    - git checkout --track origin/os-build && git describe
     - export PROJECT_ID="$CI_PROJECT_ID"
+
+merge_upstream:
+  extends: .scheduled_setup
+  script:
+    - git checkout --track origin/os-build && git describe
     - make dist-merge-upstream-push || exit 1
   retry: 2
   rules:
@@ -132,43 +135,15 @@ merge_upstream:
 
 # scheduled job
 rawhide_release:
-  image: registry.gitlab.com/cki-project/containers/builder-fedora
-  variables:
-    GIT_DEPTH: "0"
-    GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/kernel-ark
-  before_script:
-    - echo "fastestmirror=true" >> /etc/dnf/dnf.conf
-    - dnf -y install python3-gitlab git openssh-clients dnf-utils gnupg2
-    - git config user.name "Fedora Kernel Team"
-    - git config user.email "kernel-team@xxxxxxxxxxxxxxxxx"
-    - echo "$PYTHON_GITLAB_CONFIG" >> ~/.python-gitlab.cfg
-    # Need SSH since the clone is set up without write access.
-    - eval $(ssh-agent -s)
-    - echo "$PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
-    - mkdir -p ~/.ssh
-    - chmod 700 ~/.ssh
-    - echo "$GITLAB_KNOWN_HOSTS" >> ~/.ssh/known_hosts
-    - chmod 644 ~/.ssh/known_hosts
-    - git remote add gitlab git@xxxxxxxxxx:cki-project/kernel-ark.git
-    - gpg2 --import "$TORVALDS_GPG_KEY"
+  extends: .scheduled_setup
   script:
-    - git checkout --track origin/master && git describe
     - git checkout --track origin/ark-latest && git describe
     - git checkout --track origin/ark-infra && git describe
     - git checkout --track origin/os-build && git describe
-    - export PROJECT_ID="$CI_PROJECT_ID"
     - redhat/scripts/ci/ark-create-release.sh "master" "$CI_PROJECT_ID" || exit_code=$?
     - if [ $exit_code -eq 3 ]; then echo "Tag exists, halting" && exit 0; fi;
     - if [ $exit_code -ne 0 ]; then echo "Unable to create release tag" && exit 1; fi;
     - git push gitlab os-build
-    - >
-      for branch in $(git branch | grep configs/"$(date +%F)"); do
-        git push \
-          -o merge_request.create \
-          -o merge_request.target=os-build \
-          -o merge_request.remove_source_branch \
-          gitlab "$branch"
-      done;
     # ark-create-release.sh creates a tag for ark-latest to be pushed.
     # Make sure the ark-latest branch is checked out.
     - git checkout ark-latest

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1264
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux