Scripts to help in the creation and maintenance of the GITEA git repos for SMEServer and SMEContribs.
Go to file
2023-07-20 11:55:03 +01:00
changelog add in changelog script 2023-05-30 12:44:27 +10:00
config put back USER for local & remote 2023-05-10 13:04:48 +10:00
git-cvs2git.sh Delete reference to make-archive - no longer in use. 2023-07-12 09:18:36 +02:00
git-delete-release-in-one-rep.sh Add in update and delete release scripts 2023-07-20 11:55:03 +01:00
git-get-repo-and-build.sh Delete reference to make-archive - no longer used 2023-07-14 14:15:58 +10:00
git-list-all-org-repos.sh Update list-all-ord-repos to include all releases 2023-07-19 13:20:02 +01:00
git-make-release.sh Take out early exit - left in by mistake! 2023-07-19 12:31:00 +01:00
git-migrate-repo.sh variable names wrong 2023-06-04 21:43:34 +10:00
git-post-create-repo.sh Add post create frm template script 2023-06-02 14:26:42 +01:00
git-transfer-repo.sh add git-transfer-repo.sh script 2023-06-05 15:31:16 +10:00
git-update-release-in-one-repo.sh Add in update and delete release scripts 2023-07-20 11:55:03 +01:00
parse-list.sh show return code on non-zero exit 2023-06-15 10:19:59 +10:00
README.md Add in update and delete release scripts 2023-07-20 11:55:03 +01:00
rename-e-smith-pkg.sh Updated comments 2023-06-21 16:53:28 +10:00

smeserver-gitutils

Utilities to use with smeserver on Koozali.org GITEA instance

Just a repackaging of some of Brian Read's tools with some modifications for the new git structure and some tidy-up of the ini file and debug statements

It's a good idea to have the scripts somewhere in your path (some do call others). You can put them in ~/bin (you may need to create this if it doesn't exist)

config

sample ~/.smegit/config or /etc/smegit.ini file - fill in your details
It will use the user config first and system ini, if user config does not exist

git-cvs2git.sh

copy current cvs version of a package across to git in new structure

git-cvs2git.sh <repository> <organisation> [<local>]
  • <repository> repository (package) to be migrated (e.g. smeserver-yum)
  • <organisation> can ONLY be smeserver or smecontribs

optional parameters, can appear in any order

  • <local> will migrate into your local GITEA (in config), otherwise remote GITEA
  • <debug> run in debug mode

git-get-and-build-repo.sh

bring down current git repository and run mockbuild

git-get-and-build.sh <repository> <organisation> [<local> <debug>]
  • <repository> repository (package) to be built (e.g. smeserver-yum)
  • <organisation> can be any organisation or user on the remote GITEA instance

optional parameters, can appear in any order

  • <local> will build from local GITEA (in config), otherwise from remote GITEA
  • <debug> run in debug mode

git-migrate-repo.sh

create mirror or copy of src.koozali.org repository in a local GITEA instance

git-migrate-repo.sh <repository> <organisation> [<target organisation> <copy|mirror> <local> <debug>]
  • <repository> repository (package) to be copied (e.g. smeserver-yum)
  • <organisation> can be any organisation or user on the remote GITEA instance

optional parameters, can appear in any order

  • <target organisation> within your local GITEA, otherwise local user - must exist already
  • <copy|mirror> will create local repo as either a copy or a mirror of the remote repo (default = copy)
  • <local> use local GITEA as source (i.e. copy between organisations on local GITEA)
  • <debug> run in debug mode

git-transfer-repo.sh

Transfer a repo to a different user (or organisation)

git-transfer-repo.sh <repository> <source organization> <target organisation> [<local> <force> <debug> <silent>]
  • <repository> repository name to be transferred (e.g. smeserver-clamav)
  • <source organisation> to be transferred from (any valid organisation or user)
  • <target organisation> to be transferred to (any valid organisation or user - you need owner privileges)

optional parameters, can appear in any order

<local> will use parameters set for local repository, else it will use remote <force> will automagically delete an existing target repo, otherwise it will prompt <debug> run in debug mode <silent> suppress success message

rename-e-smith-pkg.sh

Rename an e-smith package as smeserver and change relevant files

rename-emith-pkg.sh <pkg> [<organisation> <local> <force> <debug>]
  • <pkg> Module name to be renamed e.g. e-smith-dnscache

optional parameters, can appear in any order

  • <organisation> (any gitea organisation smeserver, smecontribs or user - defaults to smeserver)
  • <local> will use parameters set for local repository else it will use remote
  • <force> will automagically delete an existing repo, otherwise it will prompt
  • <transfer> will transfer the updated repository to the source org (need to be owner)
  • <debug> run in debug mode
  • <silent> will suppress the finished Ok message

This works whether the repo and local files exist of not (it deletes them if necessary)

parse-list.sh

Parse a list of parameters and execute script with those parameters

parse-list.sh <param file|org='organisation'> <script> [<local> <noisy> <review> <additional*>]
  • <param file|org='organisation'> name of file containing parameters or organisation which will be used to generate a list of all repos for input to <script>
  • <script> script to run (e.g. rename-e-smith-pkg.sh)

optional params can appear in any order

  • <local> used with org= and will use local GITEA instance, default remote - will be passed to <script>
  • <noisy> show line being executed
  • <review> show line to be executed, but NOT executing
  • <additional> additional params to be passed (up to 3) e.g. debug,force,local

example:

parse-list.sh org=smeserver git-migrate-repo.sh review

will echo the command that would be run for each repo in the smeserver organisation on the remote GITEA instance

git-migrate-repo.sh perl-Moo smeserver
git-migrate-repo.sh buildsys-macros smeserver
git-migrate-repo.sh clamav smeserver
...

git-post-create-repo.sh

Update a repo created from a template (contribs,base or 3rd party) with things not able to be updated from the template:

  • <repository> repository (package) to be editted (e.g. smeserver-yum)
  • <organisation> can be any organisation or user on the remote or local GITEA instance

optional:

  • <local> will migrate into your local GITEA (in config), otherwise remote GITEA

Does:

Rename spec file
Set current date in change log
Set Wiki and Issues links external (SME Wiki and Bugzilla)

git-make-release.sh

Create a release and upload the rpm (src and bin) as attachments to that release

  • <repository> repository (package) to be editted (e.g. smeserver-yum)
  • <draft | prerelease> create draft or prerelease else it will create full stable release
  • <organisation> can be any organisation or user on the remote or local GITEA instance
  • <release-tag> will have "SME" added to the front of it (so e.g. 10.2 -> SME10.2)

optional: (in any order)

  • <local> used with org= and will use local GITEA instance, default remote - will be passed to <script>
  • <noisy> show line being executed
  • <debug> run in debug mode
  • <draft> create a draft release
  • <prerelease> create a pre-release

Note that no release type will give a full stable release

Does:

Create the release (deleting one that is the same tag),
Then uploads the .src.rpm and .rpm as an attachment (deleting any one of the same name)

git-list-all-org-repos.sh

List the repos in any one organisation and optionally show the release and some associated fields

  • <organisation> can be any organisation or user on the remote or local GITEA instance

optional: (in any order)

  • <local> used with org= and will use local GITEA instance, default remote - will be passed to <script>
  • <noisy> show line being executed
  • <debug> run in debug mode
  • <draftrelease> Show all draft releases
  • <prerelease> Show all prereleases
  • <release> Show all full releases
  • <allreleases> Show all releases
  • <cloneurl> Show the url to use to clone this repo
  • <zipurl> Show the url to get the zipped contents of the repo

Does:

Display a "table" of each repo and the optional extras requested.

git-update-release-in-one-repo.sh

Update the release (draft/prerelease/release) git-update-release-in-one-repo.sh [ | ] [draft|prerelease|release] [local] [debug]

  • <organisation> can be any organisation or user on the remote or local GITEA instance
  • <repo> name of the repo (package)
  • <releasetag> Full tag of the release (inc SME if applicable)
  • <id>
  • draft|prerelease|release

optional: (in any order)

  • <local> used with org= and will use local GITEA instance, default remote - will be passed to <script>
  • <debug> run in debug mode

Does:

Resets the release specified to the type specified.