Compare commits
4 Commits
0.2.1+18.2
...
feat-runne
| Author | SHA1 | Date | |
|---|---|---|---|
| d190828088 | |||
| 0d4fccf5f8 | |||
| 4dfd52e234 | |||
| b47095b29b |
@ -18,9 +18,11 @@ LETS_ENCRYPT_ENV=production
|
|||||||
GITLAB_ROOT_EMAIL="gitlab_admin@example.com"
|
GITLAB_ROOT_EMAIL="gitlab_admin@example.com"
|
||||||
SECRET_INITIAL_ROOT_PASSWORD_VERSION=v1
|
SECRET_INITIAL_ROOT_PASSWORD_VERSION=v1
|
||||||
SECRET_RUNNER_TOKEN_VERSION=v1
|
SECRET_RUNNER_TOKEN_VERSION=v1
|
||||||
|
SECRET_REGISTRATION_TOKEN_VERSION=v1
|
||||||
|
|
||||||
SSO=false
|
SSO=false
|
||||||
## Authentik Configuration
|
## Authentik Configuration
|
||||||
|
|
||||||
# SSO=true
|
# SSO=true
|
||||||
# ORG_NAME="My Organization"
|
# ORG_NAME="My Organization"
|
||||||
# SSO_PROVIDER_URL="https://authentik.mydomain.com/application/o/gitlab/"
|
# SSO_PROVIDER_URL="https://authentik.mydomain.com/application/o/gitlab/"
|
||||||
|
|||||||
8
abra.sh
8
abra.sh
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
GITLAB_CONF_VERSION=v1
|
GITLAB_CONF_VERSION=v1
|
||||||
ENTRYPOINT_VERSION=v1
|
ENTRYPOINT_VERSION=v1
|
||||||
|
RUNNER_ENTRYPOINT_VERSION=v1
|
||||||
|
RUNNER_CONF_VERSION=v1
|
||||||
|
|
||||||
run_rails_command() {
|
run_rails_command() {
|
||||||
su -p root -s /bin/sh -c "gitlab-rails runner '$@'"
|
su -p root -s /bin/sh -c "gitlab-rails runner '$@'"
|
||||||
@ -29,3 +31,9 @@ enable_signups () {
|
|||||||
run_rails_command 'Gitlab::CurrentSettings.update!(signup_enabled: true)'
|
run_rails_command 'Gitlab::CurrentSettings.update!(signup_enabled: true)'
|
||||||
reconfigure
|
reconfigure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register_runner() {
|
||||||
|
RUNNER_TOKEN="$1"
|
||||||
|
|
||||||
|
gitlab-runner register --non-interactive --url "https://$CI_SERVER_URL" --token "$RUNNER_TOKEN" --executor "docker"
|
||||||
|
}
|
||||||
83
compose.runner.yml
Normal file
83
compose.runner.yml
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
runner:
|
||||||
|
image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
|
||||||
|
depends_on:
|
||||||
|
- dind
|
||||||
|
environment:
|
||||||
|
- CI_SERVER_URL=${DOMAIN}
|
||||||
|
- DOCKER_HOST=tcp://socket-proxy:2375
|
||||||
|
- RUNNER_TIMEOUT
|
||||||
|
- RUNNER_CONCURENCY
|
||||||
|
configs:
|
||||||
|
- source: runner_conf
|
||||||
|
target: /etc/gitlab-runner/config.toml
|
||||||
|
- source: entrypoint
|
||||||
|
target: /custom-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
volumes:
|
||||||
|
- "runnner_config:/etc/gitlab-runner"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
entrypoint: /custom-entrypoint.sh
|
||||||
|
|
||||||
|
socket-proxy:
|
||||||
|
image: lscr.io/linuxserver/socket-proxy:3.2.6
|
||||||
|
environment:
|
||||||
|
- PROXY_READ_TIMEOUT=5000
|
||||||
|
- ALLOW_START=1
|
||||||
|
- ALLOW_STOP=1
|
||||||
|
- ALLOW_RESTARTS=1
|
||||||
|
- AUTH=1
|
||||||
|
- BUILD=1
|
||||||
|
- COMMIT=1
|
||||||
|
- CONFIGS=1
|
||||||
|
- CONTAINERS=1
|
||||||
|
- DISABLE_IPV6=0
|
||||||
|
- DISTRIBUTION=0
|
||||||
|
- EVENTS=1
|
||||||
|
- EXEC=1
|
||||||
|
- IMAGES=1
|
||||||
|
- INFO=1
|
||||||
|
- NETWORKS=1
|
||||||
|
- NODES=1
|
||||||
|
- PING=1
|
||||||
|
- POST=1
|
||||||
|
- PLUGINS=1
|
||||||
|
- SECRETS=1
|
||||||
|
- SERVICES=1
|
||||||
|
- SESSION=1
|
||||||
|
- SWARM=1
|
||||||
|
- SYSTEM=1
|
||||||
|
- TASKS=1
|
||||||
|
- VERSION=1
|
||||||
|
- VOLUMES=1
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
ports:
|
||||||
|
- "2375:2375"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
runnner_config:
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
registration_token:
|
||||||
|
name: ${STACK_NAME}_registration_token_${SECRET_REGISTRATION_TOKEN_VERSION}
|
||||||
|
external: true
|
||||||
|
|
||||||
|
configs:
|
||||||
|
runner_conf:
|
||||||
|
name: ${STACK_NAME}_runner_config_${RUNNER_CONF_VERSION}
|
||||||
|
file: runner-config.toml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
entrypoint:
|
||||||
|
name: ${STACK_NAME}_runner_entrypoint_${RUNNER_ENTRYPOINT_VERSION}
|
||||||
|
file: runner-entrypoint.sh.tmpl
|
||||||
|
template_driver: golang
|
||||||
@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: 'gitlab/gitlab-ce:18.2.4-ce.0'
|
image: 'gitlab/gitlab-ce:18.3.0-ce.0'
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- internal
|
- internal
|
||||||
@ -34,7 +34,7 @@ services:
|
|||||||
- "backupbot.backup=true"
|
- "backupbot.backup=true"
|
||||||
- "backupbot.backup.path=/etc/gitlab/,/var/log/gitlab/,/var/opt/gitlab/"
|
- "backupbot.backup.path=/etc/gitlab/,/var/log/gitlab/,/var/opt/gitlab/"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-240}"
|
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-240}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=0.2.1+18.2.4-ce.0"
|
- "coop-cloud.${STACK_NAME}.version=0.2.2+18.3.0-ce.0"
|
||||||
secrets:
|
secrets:
|
||||||
- initial_root_password
|
- initial_root_password
|
||||||
- runner_token
|
- runner_token
|
||||||
|
|||||||
10
runner-entrypoint.sh.tmpl
Normal file
10
runner-entrypoint.sh.tmpl
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
while [ ! -s /etc/gitlab-runner/config.toml ]
|
||||||
|
do
|
||||||
|
echo "The runner was not registered yet. Next try in 5 seconds."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
Reference in New Issue
Block a user