A script to update Gitea
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
Ron Nazarov 8daf625630 Replaced definition list with a normal list in README.md 9 ay önce
.gitignore First commit 9 ay önce
LICENSE First commit 9 ay önce
README.md Replaced definition list with a normal list in README.md 9 ay önce
example-macros.m4 First commit 9 ay önce
generate-macros.rb First commit 9 ay önce
generate-macros.sh First commit 9 ay önce
update-gitea.m4 First commit 9 ay önce


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