Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

triggers added to the jenkins file #32

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
sh '''
cd myapp
python3 hello.py
python3 hello.py --name=Brad
python3 hello.py --name=Sathiyan
'''
}
}
Expand All @@ -35,5 +35,13 @@ pipeline {
'''
}
}

stage('Deploying App to Kubernetes') {
steps {
script {
kubernetesDeploy(configs: "deploymentservice.yml", kubeconfigId: "kubernetes")
}
}
}
}
}
7 changes: 5 additions & 2 deletions Jenkinsfile.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
pipeline {
agent {
node {
label 'jenkins-agent-goes-here'
label 'docker-agent-python'
}
}
triggers {
pollSCM '*/5 * * * *'
}
stages {
stage('Build') {
steps {
Expand All @@ -17,7 +20,7 @@ pipeline {
steps {
echo "Testing.."
sh '''
echo "doing test stuff..
echo "doing test stuff.."
'''
}
}
Expand Down
38 changes: 38 additions & 0 deletions deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins101-deployment
labels:
app: nodeapp
spec:
replicas: 1
selector:
matchLabels:
app: jenkins101
template:
metadata:
labels:
app: jenkins101
spec:
containers:
- name: jenkins101server
image: sathiyan97/jenkins101:latest
ports:
- containerPort: 3000


---

apiVersion: v1
kind: Service
metadata:
name: jenkins101-service
spec:
selector:
app: jenkins101
type: LoadBalancer
ports:
- protocol: TCP
port: 5000
targetPort: 3000
nodePort: 31110