mirror of
https://github.com/jugatsu/onec-cicd.git
synced 2024-11-16 07:09:36 +02:00
Add code to deploy CI/CD infrastructure
This commit is contained in:
parent
5e4ff2ef9e
commit
ca2a1ddff3
91
infra/ci/docker-compose.ci.yml
Normal file
91
infra/ci/docker-compose.ci.yml
Normal file
@ -0,0 +1,91 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
|
||||
jenkins:
|
||||
build:
|
||||
context: ./jenkins-master
|
||||
environment:
|
||||
- "JAVA_OPTS=-Djenkins.install.runSetupWizard=false -Dfile.encoding=UTF-8"
|
||||
- "CASC_JENKINS_CONFIG=/var/jenkins_home/jenkins.yaml"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- jenkins_home:/var/jenkins_home
|
||||
- ${PWD}/config/jenkins/jenkins.yaml:/var/jenkins_home/jenkins.yaml
|
||||
networks:
|
||||
- back_net
|
||||
|
||||
slave:
|
||||
image: odavid/jenkins-jnlp-slave:3.29-1-15-alpine
|
||||
privileged: true
|
||||
ports:
|
||||
- "6900:5900"
|
||||
volumes:
|
||||
- ${PWD}/config/slave/docker/daemon.json:/etc/docker/daemon.json
|
||||
environment:
|
||||
- "JENKINS_URL=http://jenkins:8080"
|
||||
- "JENKINS_SECRET=${JENKINS_SLAVE_SECRET}"
|
||||
- "JENKINS_AGENT_NAME=slave"
|
||||
- "DIND=true"
|
||||
networks:
|
||||
- back_net
|
||||
depends_on:
|
||||
- jenkins
|
||||
|
||||
db:
|
||||
image: postgres:9.6-alpine
|
||||
restart: always
|
||||
environment:
|
||||
- "POSTGRES_USER=gitea"
|
||||
- "POSTGRES_PASSWORD=gitea"
|
||||
- "POSTGRES_DB=gitea"
|
||||
volumes:
|
||||
- "gitea_db_data:/var/lib/postgresql/data"
|
||||
networks:
|
||||
- back_net
|
||||
|
||||
git:
|
||||
image: gitea/gitea:1.8
|
||||
restart: always
|
||||
ports:
|
||||
- "10022:22"
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- DB_TYPE=postgres
|
||||
- DB_HOST=db:5432
|
||||
- DB_NAME=gitea
|
||||
- DB_USER=gitea
|
||||
- DB_PASSWD=gitea
|
||||
- DISABLE_REGISTRATION=true
|
||||
- INSTALL_LOCK=true
|
||||
networks:
|
||||
- back_net
|
||||
volumes:
|
||||
- "gitea_data:/data"
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
registry:
|
||||
image: registry:2
|
||||
restart: always
|
||||
ports:
|
||||
- 5000:5000
|
||||
environment:
|
||||
REGISTRY_AUTH: htpasswd
|
||||
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
|
||||
REGISTRY_AUTH_HTPASSWD_REALM: "Registry Realm"
|
||||
volumes:
|
||||
- registry_data:/var/lib/registry
|
||||
- ${PWD}/config/registry/auth:/auth
|
||||
networks:
|
||||
- back_net
|
||||
|
||||
volumes:
|
||||
jenkins_home: {}
|
||||
gitea_db_data: {}
|
||||
gitea_data: {}
|
||||
registry_data: {}
|
||||
|
||||
networks:
|
||||
back_net: {}
|
6
infra/ci/jenkins-master/Dockerfile
Normal file
6
infra/ci/jenkins-master/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM jenkins/jenkins:lts-slim
|
||||
|
||||
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
|
||||
RUN xargs /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
|
||||
|
||||
COPY locale.groovy /usr/share/jenkins/ref/init.groovy.d/
|
7
infra/ci/jenkins-master/locale.groovy
Normal file
7
infra/ci/jenkins-master/locale.groovy
Normal file
@ -0,0 +1,7 @@
|
||||
println("--- Configuring Locale")
|
||||
|
||||
def pluginWrapper = jenkins.model.Jenkins.instance.getPluginManager().getPlugin('locale')
|
||||
def plugin = pluginWrapper.getPlugin()
|
||||
|
||||
plugin.setSystemLocale('en')
|
||||
plugin.ignoreAcceptLanguage = true
|
11
infra/ci/jenkins-master/plugins.txt
Normal file
11
infra/ci/jenkins-master/plugins.txt
Normal file
@ -0,0 +1,11 @@
|
||||
configuration-as-code:1.20
|
||||
locale:1.4
|
||||
job-dsl:1.74
|
||||
git:3.10.0
|
||||
github:1.29.4
|
||||
allure-jenkins-plugin:2.28.1
|
||||
junit:1.28
|
||||
cloudbees-folder:6.8
|
||||
workflow-aggregator:2.6
|
||||
scm-api:2.4.1
|
||||
templating-engine:1.1.1
|
33
infra/gitsync/docker-compose.gitsync.yml
Normal file
33
infra/gitsync/docker-compose.gitsync.yml
Normal file
@ -0,0 +1,33 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
|
||||
gitsync:
|
||||
image: ${DOCKER_REGISTRY}/gitsync:3.0.0
|
||||
command: "all"
|
||||
volumes:
|
||||
- ${PWD}/config/gitsync/config.json:/config.json
|
||||
- ${PWD}/config/lm/nethasp.ini:/opt/1C/v8.3/x86_64/conf/nethasp.ini
|
||||
- ${PWD}/src/cf:/gitsync
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix
|
||||
- gitsync_data:/home/usr1cv8/.1cv8
|
||||
environment:
|
||||
- DISPLAY=host.docker.internal:0
|
||||
- GITSYNC_DOMAIN_EMAIL=localhost
|
||||
- GITSYNC_WORKDIR=/gitsync/
|
||||
- GITSYNC_WORKDIR=/
|
||||
- GITSYNC_STORAGE_PATH=tcp://repo/ci
|
||||
- GITSYNC_STORAGE_USER=Администратор
|
||||
- GITSYNC_STORAGE_PASSWORD=
|
||||
- GITSYNC_V8VERSION=8.3.12.1714
|
||||
- GITSYNC_TEMP=./temp/sync
|
||||
- GITSYNC_ALL_TIMER=60
|
||||
- GITSYNC_ALL_CONFIG=/config.json
|
||||
networks:
|
||||
- gitsync_net
|
||||
|
||||
volumes:
|
||||
gitsync_data: {}
|
||||
|
||||
networks:
|
||||
gitsync_net: {}
|
Loading…
Reference in New Issue
Block a user