Your Home source control repository
To handle my private Go-, C- Vue- or other project repositories, I don't like to import them to a public Github repository. I had a look to alternatives for Github. After some experiences with different repositories At the very beginning of my job time I worked with different source control tools. There were some developed in the company, later CVS and SVN was used. Finally the company used GIT to handle the sources.
The handling of Git pulling the complete source tree into the user space and working with own branches works very well.
Long before working with Github I found and worked with gitea.
GIT
Early in the past I worked with different approaches of source control repositories. I worked and handle different programming languages like C, shell scripting, Perl or Java. The main topic need to work with branches to develop your own part of a bigger peace without influence others. This was possible with SVN but the best it was handled by Git. In the past each change in the repository need to be send abroad the network. No local or distributed development was possible like it is with Linux kernel or even Home Office. Creating your own versions and branches to handle special stages of the development is an additional benefit of Git.
Git was stable and got it's high usage because hard disc space is getting cheap. Instead sending the commmit to an remote server it is possible to prepare and test it locally. If ready you can send the overall branch to an remote service handling as a central repository. This Git application was developed by Linus Torwald. The development of Linux is not handled in a central company but was developed by developers distributed around the world. With this central local infrastructure containing history, changes and possible own branches was a evolution in development. Git is getting a standard that time.
Gitea
Gitea is a public source control repository server. The Server will maintain the GIT repositories and provides a graphical User Interface GUI. It is possible to quickly create the source repository, backup or integrate them in a CI/CD pipeline very quickly. It is possible to review branches and their history in an web-based UI. In summary Gitea helps to
1) create a central services storing your source as an repositories 2) CI/CD service can be triggered listening to the server for changes 3) Analysis of problems can be made in the web-UI of Gitea checking history or changes
The Gitea server needs a mariaDB Datenbank for User management and to store metadata. Both, Gitea and Mariadb, I run it inside a Podman Pod. This is an example YAML file defining the Gitea Pod:
# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-3.4.2
apiVersion: v1
kind: Service
metadata:
creationTimestamp: "2022-04-10T09:22:40Z"
labels:
app: gitea
name: gitea
spec:
ports:
- name: "22"
nodePort: 30610
port: 22
targetPort: 22
- name: "3000"
nodePort: 31999
port: 3000
targetPort: 3000
selector:
app: gitea
type: NodePort
---
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2022-04-10T09:22:40Z"
labels:
app: gitea
name: gitea_pod
spec:
containers:
- image: docker.io/gitea/gitea:1.23.8
name: gitea
ports:
- containerPort: 22
hostPort: 2422
- containerPort: 3000
hostPort: 3000
securityContext:
capabilities:
drop:
- CAP_MKNOD
- CAP_NET_RAW
- CAP_AUDIT_WRITE
volumeMounts:
- mountPath: /var/lib/mysql
name: gitea_dbdata-pvc
- mountPath: /var/lib/backup
name: gitea_dbbackup-pvc
volumes:
- hostPath:
path: /gitea/gitea-data/gitea/data
type: Directory
name: gitea_giteadata-pvc
- hostPath:
path: /gitea/gitea-data/gitea/db
type: Directory
name: gitea_dbdata-pvc
- hostPath:
path: /gitea/gitea-data/gitea/backup
type: Directory
name: gitea_dbbackup-pvc
The podman command to start the server looks like that
podman play kube gitea.yaml
You can access the service using the host and port 3000:
http://<host auf dem gitea läuft>:3000
It is very easy to create a new repository or handle permissions for the same. It describe how to initial check in the new repositories.