mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
ci: improve compatibility for docker-compose execution
This commit is contained in:
@@ -9,10 +9,10 @@ import { getBaseUrl } from "./utils/url-builder";
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, "../", "");
|
||||
const isSslEnabled = env.SSL_ENABLED === "true";
|
||||
let ssl_certs: { key: Buffer; cert: Buffer };
|
||||
let sslCerts: { key: Buffer; cert: Buffer } | undefined;
|
||||
|
||||
if (isSslEnabled) {
|
||||
ssl_certs = {
|
||||
sslCerts = {
|
||||
key: fs.readFileSync(
|
||||
path.resolve(__dirname, "../certs/localhost-key.pem"),
|
||||
),
|
||||
@@ -35,7 +35,7 @@ export default defineConfig(({ mode }) => {
|
||||
server: {
|
||||
port: Number(env.FRONTEND_PORT),
|
||||
host: env.FRONTEND_DOMAIN,
|
||||
https: isSslEnabled ? ssl_certs : undefined,
|
||||
https: isSslEnabled ? sslCerts : undefined,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
+7
-2
@@ -3,6 +3,7 @@ set -e
|
||||
|
||||
# Use podman if available. Not everyone has it
|
||||
CONTAINER_BIN=$(command -v podman || command -v docker)
|
||||
echo "Using $CONTAINER_BIN for container operations..."
|
||||
|
||||
ENV_FILE="./.env.e2e"
|
||||
|
||||
@@ -24,8 +25,12 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Starting Database..."
|
||||
$CONTAINER_BIN compose -f "./docker-compose.e2e.yml" up -d
|
||||
echo "Starting Database and Mail server..."
|
||||
if [ "$CONTAINER_BIN" = "podman" ]; then
|
||||
podman compose -f "./docker-compose.e2e.yml" up -d
|
||||
else
|
||||
docker-compose -f "./docker-compose.e2e.yml" up -d
|
||||
fi
|
||||
|
||||
# postgress will take some time, so we wait, and no race condition. Also, no point in logging this output
|
||||
until $CONTAINER_BIN exec "$DB_NAME" pg_isready -U "${DB_USER:-test}" >/dev/null 2>&1; do
|
||||
|
||||
Reference in New Issue
Block a user