mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 12:02:47 +00:00
docker laten werken hiermee is zo moeilijk
This commit is contained in:
10
README.md
10
README.md
@@ -3,8 +3,7 @@
|
||||
|
||||
## teamcity
|
||||
|
||||
voor teamcity was het opstellen van de server heel simpel aangezien dit via een docker container kan.
|
||||
Er moet wel een aparte agent opgesteld worden, maar dit kan ook via een docker container.
|
||||
installatie teamcity via docker containers
|
||||
|
||||
server:
|
||||
|
||||
@@ -18,9 +17,14 @@ agent:
|
||||
|
||||
docker run -it -e SERVER_URL="localhost:8080" -v /Users/beppe/teamcity/agent/:/data/teamcity_agent/conf jetbrains/teamcity-agent
|
||||
|
||||
de reden dat we een agent nodig hebben is om docker images te builden en pushen.
|
||||
gewone installatie:
|
||||
|
||||
-zorg dat de gewenste tools aanwezig/geconfigureerd zijn (in ons geval docker en helm) op de agent (in ons geval gebruiken we de main server ook als agent)
|
||||
(copy kubeconfig naar agent voor helm)
|
||||
|
||||
-in project settings. voeg docker stappen toe om container images te builden en pushen. voeg stap toe voor helm remove (verwijdert huidig runnende container) en voeg laatste stap toe helm install (specifieer altijd helm config locatie)
|
||||
|
||||
voordeel is dat deze kunnen geconfigureerd worden in ide (dus local build settings kunnen geexport worden naar build server als men een intellij ide gebruikt)
|
||||
|
||||
|
||||
## tekton
|
||||
|
63
deploy.yaml
63
deploy.yaml
@@ -1,41 +1,15 @@
|
||||
---
|
||||
kind: service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: server-check
|
||||
spec:
|
||||
selector:
|
||||
server: http
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 5000
|
||||
---
|
||||
kind: service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: expose-server
|
||||
spec:
|
||||
selector:
|
||||
expose: true
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
targetPort: 5000
|
||||
port: 5000
|
||||
nodePort: 30036
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: server-a
|
||||
labels:
|
||||
server: http
|
||||
expose: true
|
||||
server: "http"
|
||||
expose: "true"
|
||||
spec:
|
||||
containers:
|
||||
- name: front-end
|
||||
image: IMAGE-A
|
||||
image: beppev/server-a:latest
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
---
|
||||
@@ -44,11 +18,38 @@ kind: Pod
|
||||
metadata:
|
||||
name: server-b
|
||||
labels:
|
||||
server: http
|
||||
server: "http"
|
||||
spec:
|
||||
containers:
|
||||
- name: front-end
|
||||
image: IMAGE-B
|
||||
image: beppev/server-b:latest
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: server-check
|
||||
spec:
|
||||
selector:
|
||||
server: "http"
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 5000
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: expose-server
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
expose: "true"
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
targetPort: 5000
|
||||
port: 5000
|
||||
nodePort: 30036
|
||||
|
||||
|
@@ -69,9 +69,9 @@ spec:
|
||||
- build-and-push-b
|
||||
params:
|
||||
- name: pathToContext
|
||||
value: "$(params.pathToContext)"
|
||||
value: "."
|
||||
- name: pathToYamlFile
|
||||
value: "$(params.pathToYamlFile)"
|
||||
value: "deploy.yaml"
|
||||
- name: imageUrl-a
|
||||
value: "$(params.imageUrl-a)"
|
||||
- name: imageTag-a
|
||||
|
@@ -29,5 +29,5 @@ spec:
|
||||
- /kaniko/executor
|
||||
args:
|
||||
- "--dockerfile=dockerfile"
|
||||
- "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)"
|
||||
- "--destination=beppev/$(inputs.params.imageUrl):$(inputs.params.imageTag)"
|
||||
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/"
|
||||
|
@@ -50,4 +50,4 @@ spec:
|
||||
args:
|
||||
- "apply"
|
||||
- "-f"
|
||||
- "$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/$(inputs.params.pathToYamlFile)"
|
||||
- "$(inputs.resources.git-source.path)/deploy.yaml"
|
||||
|
Reference in New Issue
Block a user