zuul-operator/playbooks/zuul-operator-functional/tasks/git_setup.yaml

62 lines
1.5 KiB
YAML

- name: setup gitconfig
shell: |
if ! test -f ~/.gitconfig && ! test -d ~/.config/git ; then
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
fi
- k8s:
namespace: default
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: git-server
spec:
replicas: 1
selector:
matchLabels:
app: git-server
template:
metadata:
labels:
app: git-server
spec:
volumes:
- name: git-repos
emptyDir: {}
containers:
- name: git-server
image: docker.io/sdelrio/git-daemon:latest
ports:
- containerPort: 9418
volumeMounts:
- name: git-repos
mountPath: /git
initContainers:
- name: init-config
image: docker.io/sdelrio/git-daemon:latest
command: ['/usr/bin/git', 'init', '--bare', '/git/config']
volumeMounts:
- name: git-repos
mountPath: /git
- k8s:
namespace: default
definition:
apiVersion: v1
kind: Service
metadata:
name: git-server
labels:
app: git-server
spec:
type: NodePort
ports:
- port: 9418
selector:
app: git-server
- name: Wait for scheduler deployment
command: timeout 10m kubectl rollout status deployment/git-server