Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Demo Openshift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas PERNOUD
Demo Openshift
Commits
744734d0
Commit
744734d0
authored
2 years ago
by
Nicolas PERNOUD
Browse files
Options
Downloads
Patches
Plain Diff
feat: continuous deployment
parent
2841e287
No related branches found
No related tags found
No related merge requests found
Pipeline
#51252
passed
2 years ago
Stage: integration-continue
Stage: deploiement-continu
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+12
-1
12 additions, 1 deletion
.gitlab-ci.yml
deployment.yml
+80
-0
80 additions, 0 deletions
deployment.yml
with
92 additions
and
1 deletion
.gitlab-ci.yml
+
12
−
1
View file @
744734d0
stages
:
-
integration-continue
-
deploiement-continu
build-et-push-image
:
variables
:
...
...
@@ -12,4 +13,14 @@ build-et-push-image:
-
docker build --pull --label "created=$(date +'%Y-%m-%d')" -t "$CI_REGISTRY_IMAGE" .
-
docker push "$CI_REGISTRY_IMAGE"
tags
:
-
build-push-to-registry
\ No newline at end of file
-
build-push-to-registry
deploiement-sur-openshift
:
stage
:
deploiement-continu
script
:
-
export NO_PROXY=grandlyon.fr
-
export KUBECONFIG=$KUBECONFIG_DEV
-
oc apply -f deployment.yml
-
oc delete pod -l app=demo-openshift
tags
:
-
ns-demo-d01
\ No newline at end of file
This diff is collapsed.
Click to expand it.
deployment.yml
0 → 100644
+
80
−
0
View file @
744734d0
---
# Déploiement de l'application
kind
:
Deployment
apiVersion
:
apps/v1
metadata
:
name
:
demo-openshift-deploy
namespace
:
ns-demo-d01
labels
:
app
:
demo-openshift
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
demo-openshift
template
:
metadata
:
labels
:
app
:
demo-openshift
spec
:
containers
:
-
name
:
demo-openshift-app
image
:
registry.forge.grandlyon.com/npernoud/demo-openshift:latest
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8080
protocol
:
TCP
readinessProbe
:
httpGet
:
path
:
/
port
:
8080
timeoutSeconds
:
1
livenessProbe
:
httpGet
:
path
:
/
port
:
8080
ressources
:
requests
:
memory
:
"
50Mi"
cpu
:
100m
limits
:
memory
:
"
128Mi"
cpu
:
500m
imagePullSecrets
:
-
name
:
forge-secret
---
# Service : rends l'application visible par "elle même" au sein du cluster
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
demo-openshift-service
namespace
:
ns-demo-d01
spec
:
selector
:
app
:
demo-openshift
ports
:
-
name
:
8080-tcp
protocol
:
TCP
port
:
8080
targetPort
:
8080
---
# Route : rends l'application visible à l'extérieur du cluster
kind
:
Route
apiVersion
:
route.openshift.io/v1
metadata
:
name
:
demo-openshift-route
namespace
:
ns-demo-d01
labels
:
app
:
demo-openshift
spec
:
host
:
demo-openshift.air.grandlyon.fr
to
:
kind
:
Service
name
:
demo-openshift-service
weight
:
100
port
:
targetPort
:
8080-tcp
tls
:
termination
:
edge
insecureEdgeTerminationPolicy
:
Redirect
---
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment