mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-28 21:25:55 +01:00
Remove ruby dependency while build portal
Python is already intalled in node image. so we can use python to parse yaml file Signed-off-by: Qian Deng <dengq@vmware.com>
This commit is contained in:
parent
303471563f
commit
89d6370201
@ -2,15 +2,21 @@ FROM node:10.15.0 as nodeportal
|
||||
|
||||
RUN mkdir -p /portal_src && mkdir -p /build_dir
|
||||
|
||||
COPY make/photon/portal/entrypoint.sh /
|
||||
COPY src/portal /portal_src
|
||||
COPY ./docs/swagger.yaml /portal_src
|
||||
|
||||
WORKDIR /portal_src
|
||||
WORKDIR /build_dir
|
||||
|
||||
RUN npm install && \
|
||||
chmod u+x /entrypoint.sh
|
||||
RUN /entrypoint.sh
|
||||
RUN cp -r /portal_src/* /build_dir \
|
||||
&& ls -la \
|
||||
&& apt-get update \
|
||||
&& apt-get install python-yaml \
|
||||
&& cat swagger.yaml | python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' > swagger.json \
|
||||
&& cat ./package.json \
|
||||
&& npm install \
|
||||
&& npm run build_lib \
|
||||
&& npm run link_lib \
|
||||
&& npm run release
|
||||
|
||||
|
||||
FROM photon:2.0
|
||||
|
@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd /build_dir
|
||||
cp -r /portal_src/* .
|
||||
ls -la
|
||||
|
||||
# Update
|
||||
apt-get update
|
||||
apt-get install -y ruby
|
||||
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' swagger.yaml>swagger.json
|
||||
|
||||
cat ./package.json
|
||||
npm install
|
||||
|
||||
## Build harbor-portal and link it
|
||||
npm run build_lib
|
||||
npm run link_lib
|
||||
|
||||
## Build production
|
||||
npm run release
|
@ -1,5 +1,4 @@
|
||||
|
||||
user nginx nginx;
|
||||
worker_processes auto;
|
||||
pid /tmp/nginx.pid;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user