A script to update Gitea
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Ron Nazarov 8daf625630 Replaced definition list with a normal list in README.md hace 9 meses
.gitignore First commit hace 9 meses
LICENSE First commit hace 9 meses
README.md Replaced definition list with a normal list in README.md hace 9 meses
example-macros.m4 First commit hace 9 meses
generate-macros.rb First commit hace 9 meses
generate-macros.sh First commit hace 9 meses
update-gitea.m4 First commit hace 9 meses


Gitea updater script

A script to update Gitea, generated from m4 macros

Explanation of files

* generate-macros.rb: Ruby script to generate macros.m4, uses Readline
* generate-macros.sh: Shell script to generate macros.m4, does not use Readline
* macros.m4: File with various macros used by update-gitea.m4
* update-gitea.m4: File with template for update-gitea.sh
* example-macros.m4: Example macros.m4 file
* update-gitea.sh: Generated script for updating gitea

The difference between generate-macros.rb, and generate-macros.sh is that the Ruby version uses Readline, and the shell script version does not

Generate script

  1. Generate macros.m4 There are 2 methods: using generate-macros.rb/generate-macros.sh, or manually
    • Using generate-macros.rb/generate-macros.sh Use generate-macros.rb (recommended) or generate-macros.sh to generate macros.m4: Run



      and answer the questions

  • Manually Write a file like this:
    dnl -*- mode: m4 -*-
    dnl Example macro definitions
    changequote([, ])dnl
    define(start_gitea, [systemctl start gitea.service])dnl Command to start Gitea
    define(stop_gitea, [systemctl stop gitea.service])dnl Command to stop Gitea
    define(user, [git])dnl User with write access to directory containing Gitea binary
    define(do_as_user, [sudo -u])dnl Command to run as user
    define(gitea_binary_dir, [~git/gitea])dnl Directory containing Gitea binary
    define(os, linux)dnl Operating System (must be one of "darwin", "linux", or "windows-4.0")
    define(arch, amd64)dnl CPU Architechture (must be one of "386", "amd64", "arm-5", "arm-6", "mips", "mips64le", or "mipsle")

    to macros.m4

  1. Process update-gitea.m4 to generate update-gitea.sh Run
    m4 update-gitea.m4 > update-gitea.sh


Note: all commands must be run as root

Download required version of Gitea

./update-gitea.sh get <gitea-version>
where `<gitea-version>` is the version of gitea you want, to download the version of gitea you want

Update Gitea

to update Gitea, this leaves a gitea-old file in gitea\_binary\_dir, this is the old Gitea binary,
it can be used to roll-back to a previous version


./update-gitea cleanup
to delete gitea\_binary\_dir/gitea-old


update-gitea is licensed under the MIT/Expat license