First commit
This commit is contained in:
commit
03d0f42308
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -0,0 +1,26 @@
|
||||||
|
FROM registry.verdnatura.es/vn-apache
|
||||||
|
ENV TZ Europe/Madrid
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
ca-certificates \
|
||||||
|
gnupg2 \
|
||||||
|
libfontconfig \
|
||||||
|
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
nodejs \
|
||||||
|
&& apt-get purge -y --auto-remove \
|
||||||
|
gnupg2 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /usr/local/apache2/htdocs
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm install --only=prod
|
||||||
|
|
||||||
|
COPY js js
|
||||||
|
COPY \
|
||||||
|
LICENSE \
|
||||||
|
README.md \
|
||||||
|
./
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
environment {
|
||||||
|
PROJECT_NAME = 'time-tracker'
|
||||||
|
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
setEnv()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build') {
|
||||||
|
environment {
|
||||||
|
CREDENTIALS = credentials('docker-registry')
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
dockerBuild()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy') {
|
||||||
|
environment {
|
||||||
|
DOCKER_HOST = "${env.SWARM_HOST}"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh "docker stack deploy --with-registry-auth --prune --compose-file docker-compose.yml ${env.STACK_NAME}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sendEmail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
Copyright (C) 2021 - Verdnatura Levante S.L.
|
||||||
|
|
||||||
|
This package is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
On Debian systems, the complete text of the GNU General Public
|
||||||
|
License can be found in "/usr/share/common-licenses/GPL-3".
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Time tracker
|
||||||
|
|
||||||
|
Launch application in development environment.
|
||||||
|
```
|
||||||
|
$ php -S 0.0.0.0:9090 -t .
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
version: '3.7'
|
||||||
|
services:
|
||||||
|
main:
|
||||||
|
image: registry.verdnatura.es/time-tracker
|
||||||
|
ports:
|
||||||
|
- 80
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == worker
|
Loading…
Reference in New Issue