Skip to content

Feature/sequence graph #14

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

Open
wants to merge 3 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
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:21-alpine3.18

RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY package.json .
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start"]
50 changes: 50 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

// В качестве DinD не стоит использовать версии образа ниже, поскольку на исполнении некоторых команд
podTemplate(yaml: '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: docker
image: docker:20.10.17-dind
command: ["dockerd-entrypoint.sh", "--insecure-registry=docker:5000", "--insecure-registry=docker.keepup:5000"]
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ""
imagePullSecrets:
- name: regcred
''')
{
environment {
DOCKERHUB_CREDENTIALS=credentials('jenkins-gitlab')
}
node(POD_LABEL) {
stage('Prepare environment') {
container('docker') {
sh "echo 192.168.10.135 docker >> /etc/hosts "
sh "echo 192.168.10.35 docker.keepup >> /etc/hosts "
}
}
stage('Build Docker image') {
git url: 'https://github.com/FedorSergeev/graph-visualizer.git', branch: 'feature/sequence-graph'
container('docker') {
sh "docker build -t docker.keepup:5000/ckeepup/graph-visualizer:0.1.5-${currentBuild.number} --network host ."
}
}
stage('Docker login') {
withCredentials([usernamePassword(credentialsId: 'jenkins-gitlab', passwordVariable: 'DOCKER_CREDS_PASSWORD', usernameVariable: 'DOCKER_CREDS_USERNAME')]) {
container('docker') {
sh 'echo "$DOCKER_CREDS_PASSWORD" | docker login docker.keepup:5000 --username jenkins --password-stdin'
}
}
}
stage('Push to docker registry') {
container('docker') {
sh "docker push docker.keepup:5000/ckeepup/graph-visualizer:0.1.5-${currentBuild.number}"
}
}
}
}

48 changes: 48 additions & 0 deletions pub/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#parent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо выпилить всю директорию pub

display: flex;
}

#text {
width: 500px;
background: lightblue;
}

#graph {
flex: 1;
background: #9ba39b;
}

#editor {
width: 100%;
height: 100%;
}


#container {
width: 100%;
height: 100%;
}

* {
padding: 0;
margin: 0;
}

.split {
width: 50%;
height: 500px;
float: left;
}

#a {
background-color: #999;
}

#b {
background-color: rgb(81, 81, 76);
}

#flowInput {
width: 100%;
height: 100%;
}
53 changes: 53 additions & 0 deletions pub/view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
</head>

<body>
<div id="container">

<div id="a" class="split">

<div><p>Вставьте XML<button id="startDraw" onclick="visualize()">Нарисовать</button></p></div>

<textarea id="flowInput" name="text"></textarea>

</div>
<div id="b" class="split">
<div id="graph">
<p>Граф бизнес-процесса</p>
</div>
</div>

</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="js/visualizer.js"></script>
<script>
$("#a").resizable({
resize: function() {
$("#b").width($(window).width() - $(this).width());

$("#b").height($(this).height());

$("#flowInput").width($("#a").width());
$("#flowInput").height($("#a").height());
}
});
$("#b").resizable({
resize: function() {
$("#a").width($(window).width() - $(this).width());

$("#a").height($(this).height());
$("#flowInput").width($("#a").width());
$("#flowInput").height($("#a").height());
}
});
</script>
</body>

</html>