Commit 75bccf9f authored by Spiros Koulouzis's avatar Spiros Koulouzis

added ingress controller

parent 45e30176
pipeline {
agent none
stages {
stage('Build java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps {
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
sh "mvn -Dmaven.test.skip=true install"
}
}
stage('Build python-code') {
agent {
docker { image 'python:3.7-buster' }
}
steps {
sh 'cd drip-planner && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt'
sh "cd ../"
sh "cd sure_tosca-flask-server && python3.7 -m venv venv && venv/bin/pip3 install -r requirements.txt && venv/bin/pip3 install -r test-requirements.txt"
}
}
stage('Test java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps {
sh "mvn test"
}
}
stage('Test python-code') {
agent {
docker { image 'python:3.7-buster' }
}
steps {
sh "cd drip-planner && venv/bin/python3.7 -m unittest discover"
sh "cd sure_tosca-flask-server && venv/bin/python3.7 -m unittest discover"
}
}
stage('Package java-code') {
agent any
tools {
maven "maven-3.6.2"
jdk "openjdk-11"
}
steps {
sh "cd drip-manager && mvn -Dmaven.test.skip=true install dockerfile:build"
}
}
stage('Package python-code') {
agent any
steps {
sh "cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 ."
sh "cd ../"
sh "cd drip-planner && docker build -t drip-planner:3.0.0 ."
}
}
}
}
node {
def app
stage('Clone repository') {
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
}
}
node('docker') {
stage('Clone repository on slave') {
git branch: 'DRIP_3.0', url: 'https://github.com/skoulouzis/DRIP.git'
}
stage('Build image') {
/* This builds the actual image; synonymous to
* docker build on the command line */
sh "cd sure_tosca-flask-server"
app = docker.build("sure-tosca/alogo53")
}
stage('Test image') {
app.inside {
sh 'echo "Tests passed"'
}
}
stage('Push image') {
//docker.withRegistry('https://registry.hub.docker.com', 'docker-hub') {
// app.push("${env.BUILD_NUMBER}")
// app.push("latest")
//}
}
}
#!/bin/bash
kubectl create -f ../k8s/CONF/
kubectl delete -f ../k8s/CONF/
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
rabbit:
image: rabbitmq:3.8-management
#ports:
......
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required'
#nginx.ingress.kubernetes.io/auth-url: "https://$host/oauth2/auth"
#nginx.ingress.kubernetes.io/auth-signin: "https://$host/oauth2/start?rd=$escaped_request_uri"
name: conf-ingress
spec:
rules:
- host: fry.lab.uvalight.net
http:
paths:
#- path: /
#backend:
#serviceName: manager
#servicePort: 8080
- path: /semaphore
backend:
serviceName: semaphore
servicePort: 3000
- path: /sure-tosca
backend:
serviceName: sure-tosca
servicePort: 8081
......@@ -9,10 +9,15 @@ metadata:
io.kompose.service: semaphore
name: semaphore
spec:
type: NodePort
#type: NodePort
#ports:
#- port: 3000
#nodePort: 30002
ports:
- port: 3000
nodePort: 30002
- name: "3000"
port: 3000
targetPort: 3000
selector:
io.kompose.service: semaphore
status:
......
......@@ -9,10 +9,10 @@ metadata:
io.kompose.service: sure-tosca
name: sure-tosca
spec:
type: NodePort
ports:
- port: 8081
nodePort: 30001
- name: "8081"
port: 8081
targetPort: 8081
selector:
io.kompose.service: sure-tosca
status:
......
......@@ -2,8 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3f84153d-6ed1-4691-94d6-53105266f15e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../docker-compose.yml" beforeDir="false" afterPath="$PROJECT_DIR$/../docker-compose.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -21,7 +21,7 @@
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../semaphore-python-client-generated" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../playbooks/install_nfs.yaml" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RunManager">
......@@ -59,10 +59,10 @@
<servers />
</component>
<component name="WindowStateProjectService">
<state x="723" y="257" width="530" height="598" key="FileChooserDialogImpl" timestamp="1587046856074">
<state x="723" y="257" width="770" height="700" key="FileChooserDialogImpl" timestamp="1587904825236">
<screen x="67" y="34" width="1853" height="1046" />
</state>
<state x="723" y="257" width="530" height="598" key="FileChooserDialogImpl/67.34.1853.1046@67.34.1853.1046" timestamp="1587046856074" />
<state x="723" y="257" width="770" height="700" key="FileChooserDialogImpl/67.34.1853.1046@67.34.1853.1046" timestamp="1587904825236" />
<state width="1825" height="255" key="GridCell.Tab.0.bottom" timestamp="1587047773485">
<screen x="67" y="34" width="1853" height="1046" />
</state>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment