Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Nov 28, 2023
1 parent a675dab commit 9f47cb9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 29 deletions.
8 changes: 7 additions & 1 deletion bin/ops/export-all-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ kubectl -n $NS wait --for=condition=Ready pod/${POD}

for d in ${DATABASES}; do
DUMP_FILE="${DIR}/${d}.sql"
APP_POD=$(kubectl -n $NS get pod -l tier=${d}-api-php -o jsonpath="{.items[0].metadata.name}") || continue

dpod="$d"
if [ "$dpod" = "upload" ]; then
dpod="uploader"
fi

APP_POD=$(kubectl -n $NS get pod -l tier=${dpod}-api-php -o jsonpath="{.items[0].metadata.name}") || continue
DB_NAME=$(kubectl -n $NS exec ${APP_POD} -- /bin/ash -c 'echo $DB_NAME')
if [ -z "${DB_NAME}" ]; then
DB_NAME="${d}"
Expand Down
7 changes: 6 additions & 1 deletion bin/ops/import-all-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ for d in ${DATABASES}; do
continue
fi

APP_POD=$(kubectl -n $NS get pod -l tier=${d}-api-php -o jsonpath="{.items[0].metadata.name}")
dpod="$d"
if [ "$dpod" = "upload" ]; then
dpod="uploader"
fi

APP_POD=$(kubectl -n $NS get pod -l tier=${dpod}-api-php -o jsonpath="{.items[0].metadata.name}")
DB_NAME=$(kubectl -n $NS exec ${APP_POD} -- /bin/ash -c 'echo $DB_NAME')
CONN_ARGS="-U ${DB_USER} --host ${DB_HOST} --port ${DB_PORT} ${DB_NAME}"

Expand Down
8 changes: 8 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
target: client-build
volumes:
- ./expose/client:/srv/workspace/expose/client:rw
- ./lib/js:/lib/js
environment:
- WDS_SOCKET_PORT=443

Expand All @@ -47,6 +48,7 @@ services:
- PHP_IDE_CONFIG=serverName=${PS_DEBUG_SERVER_NAME_PREFIX}expose
volumes:
- ./expose/api:/srv/app
- ./lib/php:/lib/php

expose-api-nginx:
volumes:
Expand All @@ -57,6 +59,7 @@ services:
expose-worker:
volumes:
- ./expose/api:/srv/app
- ./lib/php:/lib/php
- ./expose/api/docker/supervisor:/etc/supervisor.d

uploader-api-php:
Expand All @@ -67,10 +70,12 @@ services:
- PHP_IDE_CONFIG=serverName=${PS_DEBUG_SERVER_NAME_PREFIX}uploader
volumes:
- ./uploader/api:/srv/app
- ./lib/php:/lib/php

uploader-worker:
volumes:
- ./uploader/api:/srv/app
- ./lib/php:/lib/php
- ./uploader/api/docker/supervisor:/etc/supervisor.d

uploader-api-nginx:
Expand All @@ -85,6 +90,7 @@ services:
- PHP_IDE_CONFIG=serverName=${PS_DEBUG_SERVER_NAME_PREFIX}notify
volumes:
- ./notify/api:/srv/app
- ./lib/php:/lib/php

notify-api-nginx:
volumes:
Expand All @@ -93,6 +99,7 @@ services:
notify-worker:
volumes:
- ./notify/api:/srv/app
- ./lib/php:/lib/php
- ./notify/api/docker/supervisor:/etc/supervisor.d

databox-api-php:
Expand All @@ -113,6 +120,7 @@ services:
databox-worker:
volumes:
- ./databox/api:/srv/app
- ./lib/php:/lib/php
- ./databox/api/docker/supervisor:/etc/supervisor.d

elasticsearch:
Expand Down
38 changes: 19 additions & 19 deletions expose/client/index.tpl.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#41A688" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="/public/favicon.ico" />
<link rel="manifest" href="/public/manifest.json" />
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.css" rel="stylesheet" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
Expand All @@ -26,20 +26,20 @@
<title>Expose.</title>
__TPL_CONFIG__
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
16 changes: 8 additions & 8 deletions expose/client/src/component/PublicationNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class PublicationNavigation extends PureComponent {
}

class NavTree extends PureComponent {
static propTypes = {
publications: PropTypes.array.isRequired,
current: PropTypes.object.isRequired,
depth: PropTypes.number.isRequired,
openChildren: PropTypes.bool,
onSelect: PropTypes.func.isRequired,
loading: PropTypes.string,
}
// static propTypes = {
// publications: PropTypes.array.isRequired,
// current: PropTypes.object.isRequired,
// depth: PropTypes.number.isRequired,
// openChildren: PropTypes.bool,
// onSelect: PropTypes.func.isRequired,
// loading: PropTypes.string,
// }

state = {
publicationChildren: {},
Expand Down
4 changes: 4 additions & 0 deletions expose/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ export default defineConfig({
include: "**/*.svg?react",
})
],
server: {
port: 3000,
host: '0.0.0.0'
}
})

0 comments on commit 9f47cb9

Please sign in to comment.