Commit de03162f authored by Marco Ortiz's avatar Marco Ortiz

Preparación para nuevo jenkins

parent 0304cbb7
FROM nginx:1.17-alpine
LABEL maintainer "mortiz@bytesw.com"
RUN apk --no-cache add curl
RUN curl -L https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst && \
chmod +x envsubst && \
mv envsubst /usr/local/bin
EXPOSE 80
COPY ./nginx.config /etc/nginx/nginx.template
CMD ["/bin/sh", "-c", "envsubst < /etc/nginx/nginx.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"]
COPY dist/bytebot-html /usr/share/nginx/html
pipeline {
environment {
imagename = "bytesw/bytebot-html"
url = "http://192.168.27.148:5000"
tag_name = "192.168.27.148:5000"
credentials = "admin-docker-hub"
dockerImage = ''
PACKAGE_VERSION = '2.5.0'
}
agent any
parameters {
string(defaultValue: 'no', description: 'Ejecuta los procesos docker', name: 'include_docker')
}
stages {
stage('Install') {
steps {
echo "Branch is ${env.BRANCH_NAME}..."
nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
sh 'npm config ls'
sh 'npm install'
sh 'npm i -D typescript@3.4.3'
}
echo "Branch is ${PACKAGE_VERSION}..."
}
}
// stage('Test') {
// parallel {
// stage('Static code analysis') {
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'npm run-script lint'
// }
// }
// }
// }
// }
// stage('Build') {
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'ng build'
// }
// }
// }
// stage('Build Docker Image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
// }
// script {
// dockerImage = docker.build imagename
// }
// }
// }
// stage('Deploy Image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps{
// script {
// docker.withRegistry(url, credentials ) {
// dockerImage.push("$PACKAGE_VERSION")
// dockerImage.push('latest')
// }
// }
// }
// }
// stage('Remove Unused docker image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps{
// sh "docker rmi $tag_name/$imagename:$PACKAGE_VERSION"
// sh "docker rmi $tag_name/$imagename:latest"
// }
// }
}
}
server {
listen ${PORT:-80};
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $$uri /index.html;
}
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; frame-ancestors 'none'; connect-src 'self' https://*.okta.com https://*.herokuapp.com";
add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header X-XSS-Protection "1; mode=block";
add_header Feature-Policy "accelerometer 'none'; camera 'none'; microphone 'none'";
}
\ No newline at end of file
This diff is collapsed.
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