Unverified Commit 2f4480dc authored by Christopher Guindon's avatar Christopher Guindon 🌴 Committed by GitHub
Browse files

update rem deployements (#121)



* update rem deployements
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* fix staging in jenkins file
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>
parent 46140b42
......@@ -77,7 +77,7 @@ pipeline {
APP_NAME = 'eclipsefdn-react-membership'
NAMESPACE = 'foundation-internal-webdev-apps'
IMAGE_NAME = 'eclipsefdn/react-membership'
CONTAINER_NAME = 'app'
CONTAINER_NAME = 'api'
ENVIRONMENT = sh(
script: """
if [ "${env.BRANCH_NAME}" = "master" ]; then
......@@ -127,8 +127,10 @@ pipeline {
readTrusted 'src/main/docker/Dockerfile.jvm'
unstash 'target'
sh 'docker build -f src/main/docker/Dockerfile.jvm --no-cache -t ${IMAGE_NAME}:${TAG_NAME} -t ${IMAGE_NAME}:latest .'
sh '''
docker build -f src/main/docker/Dockerfile.jvm --no-cache -t ${IMAGE_NAME}:${TAG_NAME} -t ${IMAGE_NAME}:latest .
docker build -f src/main/docker/Dockerfile.www --no-cache -t ${IMAGE_NAME}-www:${TAG_NAME} -t ${IMAGE_NAME}-www:latest .
'''
}
}
......@@ -147,6 +149,8 @@ pipeline {
sh '''
docker push ${IMAGE_NAME}:${TAG_NAME}
docker push ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}-www:${TAG_NAME}
docker push ${IMAGE_NAME}-www:latest
'''
}
}
......@@ -200,6 +204,12 @@ pipeline {
containerName: "${env.CONTAINER_NAME}",
newImageRef: "${env.IMAGE_NAME}:${env.TAG_NAME}"
])
updateContainerImage([
namespace: "${env.NAMESPACE}",
selector: "app=${env.APP_NAME},environment=${env.ENVIRONMENT}",
containerName: "nginx",
newImageRef: "${env.IMAGE_NAME}-www:${env.TAG_NAME}"
])
}
}
}
......
server {
listen 8080;
server_name localhost;
port_in_redirect off;
#access_log /var/log/nginx/host.access.log main;
location = /api {
return 302 /api/;
}
location /api/ {
proxy_pass http://api:8090/; # note the trailing slash here, it matters!
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
/ $ cat /etc/nginx/nginx.conf
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
ARG NGINX_IMAGE_TAG=stable-alpine-for-hugo
FROM eclipsefdn/nginx:${NGINX_IMAGE_TAG}
COPY config/nginx/nginx.conf /etc/nginx/nginx.conf
COPY src/main/www/build /usr/share/nginx/html/
\ No newline at end of file
......@@ -29,7 +29,7 @@ spec:
- fast
weight: 1
containers:
- name: app
- name: api
image: eclipsefdn/eclipsefdn-react-membership:latest
imagePullPolicy: Always
ports:
......@@ -41,13 +41,44 @@ spec:
requests:
cpu: 200m
memory: 128Mi
env:
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/react-membership-app/secret.properties"
volumeMounts:
- name: secret-properties
mountPath: "/run/secrets/react-membership-app"
readOnly: true
- name: app
image: eclipsefdn/eclipsefdn-react-membership:latest
imagePullPolicy: Always
ports:
- containerPort: 8090
resources:
limits:
cpu: '1'
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/react-membership-app/secret.properties"
volumeMounts:
- name: secret-properties
mountPath: "/run/secrets/react-membership-app"
readOnly: true
- name: nginx
image: eclipsefdn/eclipsefdn-react-membership-www:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
limits:
cpu: '1'
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
volumes:
- name: secret-properties
secret:
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: eclipsefdn-react-membership
name: eclipsefdn-react-membership-staging
namespace: foundation-internal-webdev-apps
labels:
app: eclipsefdn-react-membership
......@@ -29,7 +29,7 @@ spec:
- fast
weight: 1
containers:
- name: app
- name: api
image: eclipsefdn/eclipsefdn-react-membership:latest
imagePullPolicy: Always
ports:
......@@ -41,14 +41,45 @@ spec:
requests:
cpu: 200m
memory: 128Mi
env:
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/react-membership-app/secret.properties"
volumeMounts:
- name: secret-properties
mountPath: "/run/secrets/react-membership-app"
readOnly: true
volumes:
- name: app
image: eclipsefdn/eclipsefdn-react-membership:latest
imagePullPolicy: Always
ports:
- containerPort: 8090
resources:
limits:
cpu: '1'
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
env:
- name: CONFIG_SECRET_PATH
value: "/run/secrets/react-membership-app/secret.properties"
volumeMounts:
- name: secret-properties
mountPath: "/run/secrets/react-membership-app"
readOnly: true
- name: nginx
image: eclipsefdn/eclipsefdn-react-membership-www:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
limits:
cpu: '1'
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
volumes:
- name: secret-properties
secret:
secretName: react-membership-app-staging
......@@ -56,7 +87,7 @@ spec:
apiVersion: "v1"
kind: "Service"
metadata:
name: eclipsefdn-react-membership
name: eclipsefdn-react-membership-staging
namespace: foundation-internal-webdev-apps
spec:
ports:
......@@ -71,7 +102,7 @@ spec:
apiVersion: "route.openshift.io/v1"
kind: "Route"
metadata:
name: eclipsefdn-react-membership
name: eclipsefdn-react-membership-staging
namespace: foundation-internal-webdev-apps
annotations:
haproxy.router.openshift.io/timeout: 20s
......@@ -87,5 +118,5 @@ spec:
termination: "edge"
to:
kind: "Service"
name: eclipsefdn-react-membership
name: eclipsefdn-react-membership-staging
weight: 100
quarkus.log.level=INFO
quarkus.http.port=8080
quarkus.http.port=8090
## EXTERNAL API CLIENT CONFIG
fdn-api/mp-rest/url=https://api.eclipse.org/public
......
......@@ -27,7 +27,7 @@
},
"scripts": {
"start": "concurrently --kill-others \"less-watch-compiler\" \"react-scripts start\"",
"build": "lessc src/less/App.less src/App.css && react-scripts build && mkdir -p ../resources/META-INF/resources/ && cp -rf build/* ../resources/META-INF/resources/",
"build": "lessc src/less/App.less src/App.css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test-spec": "swagger-repo validate -b ../../../spec",
......
......@@ -5,7 +5,7 @@
* just hope to use consistent variables for strings.
*/
export const api_prefix = () => {
return '//' + window.location.host;
return '//' + window.location.host + '/api';
};
export const API_PREFIX_FORM = api_prefix() + '/form';
......
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