2023-05-09 08:14:20 +02:00
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-gitutils
2023-05-09 05:46:40 +02:00
Utilities to use with smeserver on Koozali.org GITEA instance
2023-05-12 02:31:25 +02:00
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
2023-05-09 05:46:40 +02:00
2023-07-18 07:10:38 +02:00
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)
2023-06-01 06:38:29 +02:00
## config
2023-05-10 02:49:40 +02:00
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
2023-05-09 09:53:44 +02:00
2023-06-01 06:38:29 +02:00
## git-cvs2git.sh
copy current cvs version of a package across to git in new structure
git-cvs2git.sh < repository > < organisation > [< local > ]
2023-06-01 06:40:10 +02:00
* \<repository\> repository (package) to be migrated (e.g. smeserver-yum)
* \<organisation\> can ONLY be smeserver or smecontribs
2023-06-02 03:59:49 +02:00
optional parameters, can appear in any order
2023-06-01 06:38:29 +02:00
* \<local\> will migrate into your local GITEA (in config), otherwise remote GITEA
2023-06-02 03:59:49 +02:00
* \<debug\> run in debug mode
2023-06-01 06:38:29 +02:00
## git-get-and-build-repo.sh
bring down current git repository and run mockbuild
2023-07-23 07:17:45 +02:00
git-get-and-build.sh < repository > < organisation > [branch=< branch > < local > < debug > ]
2023-06-01 06:38:29 +02:00
2023-07-23 07:17:45 +02:00
* \<branch=< branch \> will bring back a specific branch , otherwise Master
2023-06-01 06:40:10 +02:00
* \<repository\> repository (package) to be built (e.g. smeserver-yum)
2023-06-02 03:59:49 +02:00
* \<organisation\> can be any organisation or user on the remote GITEA instance
optional parameters, can appear in any order
2023-06-01 06:38:29 +02:00
* \<local\> will build from local GITEA (in config), otherwise from remote GITEA
2023-06-02 03:59:49 +02:00
* \<debug\> run in debug mode
2023-06-01 06:38:29 +02:00
## git-migrate-repo.sh
create mirror or copy of src.koozali.org repository in a local GITEA instance
2023-06-04 02:44:39 +02:00
git-migrate-repo.sh < repository > < organisation > [< target organisation > < copy | mirror > < local > < debug > ]
2023-06-01 06:38:29 +02:00
2023-06-01 06:40:10 +02:00
* \<repository\> repository (package) to be copied (e.g. smeserver-yum)
2023-06-02 03:59:49 +02:00
* \<organisation\> can be any organisation or user on the remote GITEA instance
optional parameters, can appear in any order
2023-06-01 06:38:29 +02:00
* \<target organisation\> within your local GITEA, otherwise local user - must exist already
2023-06-04 02:44:39 +02:00
* \<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)
2023-06-02 03:59:49 +02:00
* \<debug\> run in debug mode
2023-06-01 06:38:29 +02:00
2023-06-05 07:41:58 +02:00
## git-transfer-repo.sh
Transfer a repo to a different user (or organisation)
2023-06-01 06:38:29 +02:00
2023-06-05 07:41:58 +02:00
git-transfer-repo.sh < repository > < source organization > < target organisation > [< local > < force > < debug > < silent > ]
2023-06-02 03:59:49 +02:00
2023-06-05 07:41:58 +02:00
* \<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)
2023-06-02 03:59:49 +02:00
optional parameters, can appear in any order
2023-06-01 06:38:29 +02:00
2023-06-05 07:41:58 +02:00
\<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
2023-06-01 06:38:29 +02:00
2023-11-17 05:00:14 +01:00
## git-retag.sh
2024-12-20 10:09:10 +01:00
Create a new tag based on %version-%release in spec file (without trailing el7.sme) and optionally remove old tags
2023-11-17 05:00:14 +01:00
git-retag.sh < repository > < organisation > [< local > < debug > < noisy > ]
* \<repository\> repository to be retagged
* \<organisation\> organisation\owner that the repository belongs to
optional parameters, can appear in any order
2024-12-20 10:09:10 +01:00
* \<purge\> will remove all existing tags
2024-02-16 01:11:43 +01:00
* \<local\> will use parameters set for local repository, else it will use remote
* \<debug\> run with debug output
* \<noisy\> will will print a line showing how it was called
2023-11-17 05:00:14 +01:00
2023-06-02 03:47:11 +02:00
## parse-list.sh
Parse a list of parameters and execute script with those parameters
2023-06-04 02:44:39 +02:00
parse-list.sh < param file | org = 'organisation' > < script > [ < l o c a l > < n o i s y > < r e v i e w > < a d d i t i o n a l * > ]
2023-06-02 03:47:11 +02:00
2023-06-03 09:06:40 +02:00
* \<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\>
2023-06-02 03:47:11 +02:00
* \<script\> script to run (e.g. rename-e-smith-pkg.sh)
optional params can appear in any order
2023-06-03 09:07:31 +02:00
* \<local\> used with org= and will use local GITEA instance, default remote - will be passed to \<script\>
2023-06-02 03:47:11 +02:00
* \<noisy\> show line being executed
2023-06-04 02:44:39 +02:00
* \<review\> show line to be executed, but NOT executing
2023-06-02 15:34:55 +02:00
* \<additional\> additional params to be passed (up to 3) e.g. debug,force,local
2023-06-04 02:44:39 +02:00
### 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
...
2023-06-02 15:34:55 +02:00
## 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:
2023-06-02 15:36:24 +02:00
* \<repository\> repository (package) to be editted (e.g. smeserver-yum)
* \<organisation\> can be any organisation or user on the remote or local GITEA instance
2023-06-02 15:34:55 +02:00
optional:
* \<local\> will migrate into your local GITEA (in config), otherwise remote GITEA
Does:
Rename spec file
2023-06-02 15:36:24 +02:00
Set current date in change log
2023-06-02 15:34:55 +02:00
Set Wiki and Issues links external (SME Wiki and Bugzilla)
2023-07-09 12:52:15 +02:00
## 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)
2023-07-19 14:20:02 +02:00
* \<draft | prerelease> create draft or prerelease else it will create full stable release
2023-07-09 12:52:15 +02:00
* \<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
2023-07-19 13:22:50 +02:00
* \<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
2023-07-09 12:52:15 +02:00
2023-07-09 12:56:38 +02:00
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)
2023-07-09 12:52:15 +02:00
2023-07-19 14:20:02 +02:00
## 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
2023-07-20 21:00:36 +02:00
* \<asseturls\> Show the URLs of the assets associated with the release
2023-07-19 14:20:02 +02:00
Does:
Display a "table" of each repo and the optional extras requested.
2023-07-20 12:55:03 +02:00
## git-update-release-in-one-repo.sh
2023-07-20 12:58:26 +02:00
Update the release (draft/prerelease/release)
2023-07-20 12:55:03 +02:00
* \<organisation\> can be any organisation or user on the remote or local GITEA instance
* \<repo\> name of the repo (package)
2023-07-20 12:58:26 +02:00
* \<releasetag\> Full tag of the release (inc SME if applicable) OR
* \<id\>
2023-07-20 12:55:03 +02:00
* 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.
2024-03-12 21:41:40 +01:00
2024-03-12 21:43:12 +01:00
## git-get-latest-tag.sh
2024-03-12 21:41:40 +01:00
Return the newest tag for the repo
* \<repo\> name of the repo (package)
* \<organisation\> can be any organisation or user on the remote or local GITEA instance
2024-05-26 21:18:34 +02:00
## github-make-push-mirror.sh
Create a repo on github.com and add a push mirror entry to the equivalent gitea repo.
* \<repo\> Name of the repo
* \<organisation\> Name of the organisation in GITEA
* \<github organisation\> Name of the organisation in GITHUB
2024-05-26 21:24:58 +02:00
Note that .smegit/conf needd GITHUBTOKEN and GITHUBLOGIN the token must have the necessary permissions. Either fine-grain token or one of the orginal tokens. Created through settings/developer tools/api tokens on github.com.
Also need to login in to github using `gh auth login` before running the command.
2024-05-26 21:22:14 +02:00