Jenkins scripts

Summary: jenkins scripts

Test Plan: tbd

Reviewers: #reviewers

Subscribers: jenkins-user

Differential Revision: https://hub.sealcode.org/D1081
master
Kuba Orlik 4 years ago
parent 3342cc8ce5
commit dd8e14ab0c

@ -20,7 +20,6 @@ module.exports = {
/* "jsdoc/require-description": 2, */
"no-await-in-loop": 2,
"with-tsc-error/all": ["warn", {}],
"@typescript-eslint/restrict-template-expressions": 0,
},
settings: { jsdoc: { mode: "typescript" } },
overrides: [

1
.gitignore vendored

@ -23,3 +23,4 @@ coverage
.nyc_output
/dist/
public/dist
/log.html

@ -1,4 +1,4 @@
# Sealious playground - hotwire version
# Sealious playground
A simple todo app written in Sealious with a Hotwire-enhanced, server-side
rendered front-end.

@ -11,8 +11,6 @@ services:
dockerfile: test.Dockerfile
volumes:
- ./:/opt/sealious/
ports:
- "127.0.0.1:${SEALIOUS_PORT:-8080}:${SEALIOUS_PORT:-8080}"
user: ${UID:-1000}:${GID:-1000}
mailcatcher:
image: schickling/mailcatcher:latest

@ -0,0 +1,18 @@
#!/bin/bash
set -e
docker-compose down
cp secrets.example.json secrets.json
export SEALIOUS_PORT=$PORT
SEALIOUS_BASE_URL=$(cat .base_url)
export SEALIOUS_BASE_URL
docker-compose up -d db
./npm.sh ci
./npm.sh run build:back;
rm -f log.html

@ -0,0 +1,14 @@
#!/bin/bash
export SEALIOUS_PORT=$PORT
SEALIOUS_BASE_URL=$(cat .base_url)
export SEALIOUS_BASE_URL
docker-compose run --user="$UID"\
-e "SEALIOUS_MONGO_PORT=27017" \
-e "SEALIOUS_MONGO_HOST=db" \
-e "SEALIOUS_PORT=$SEALIOUS_PORT" \
-e "SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL" \
-e "SEALIOUS_SANITY=true" \
test

@ -1,36 +1,22 @@
#!/bin/bash
docker-compose down
export SEALIOUS_PORT=$PORT
SEALIOUS_BASE_URL=$(cat .base_url)
export SEALIOUS_BASE_URL
set -e
export SEALIOUS_PORT=$1
export SEALIOUS_BASE_URL=$2
docker-compose down
docker-compose up -d db
./npm.sh ci
./npm.sh run build:back;
./npm.sh run build:front;
rm -f log.txt
CONTAINER=$(docker-compose run --user="$UID"\
docker-compose run --user="$UID"\
-e "SEALIOUS_MONGO_PORT=27017" \
-e "SEALIOUS_MONGO_HOST=db" \
-e "SEALIOUS_PORT=$SEALIOUS_PORT" \
-e "SEALIOUS_BASE_URL=$SEALIOUS_BASE_URL" \
-p ${SEALIOUS_PORT}:${SEALIOUS_PORT} \
-p "${SEALIOUS_PORT}:${SEALIOUS_PORT}" \
-d \
test \
/bin/sh -c "{ node . --color 2>&1; } | ./node_modules/.bin/ansi-html-stream > log.html")
echo "App started on $SEALIOUS_PORT"
echo "App running in container $CONTAINER"
sleep 1
/bin/sh -c "{ node . --color 2>&1; } | ./node_modules/.bin/ansi-html-stream > log.html" \
&& echo "App started on $SEALIOUS_PORT"
echo "Docker logs so far:"
docker logs "$CONTAINER"
echo "Deployed to https://${PORT}.dep.sealco.de"
echo "Application logs should be available at https://jenkins.sealcode.org/job/Deploy%20to%20dep.sealco.de/ws/$PORT/log.html"

@ -0,0 +1,7 @@
#!/bin/bash
export SEALIOUS_PORT=$PORT
SEALIOUS_BASE_URL=$(cat .base_url)
export SEALIOUS_BASE_URL
docker-compose down

5519
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -26,7 +26,7 @@ export default class TheApp extends App {
from_name: "Sealious playground app",
},
logger: {
level: <const>"debug",
level: <const>"info",
},
"www-server": {
port: PORT,

@ -1,6 +1,6 @@
import { Collection, FieldTypes, Policies } from "sealious";
const tasks = new (class extends Collection {
export class Tasks extends Collection {
fields = {
title: new FieldTypes.Text(),
done: new (class extends FieldTypes.Boolean {
@ -11,6 +11,6 @@ const tasks = new (class extends Collection {
})(),
};
defaultPolicy = new Policies.Public();
})();
}
export default tasks;
export default new Tasks();

@ -15,7 +15,22 @@ declare module "koa" {
}
const app = new TheApp();
void app.start();
void app
.start()
.then(() => {
//populate scripts go here
if (process.env.SEALIOUS_SANITY === "true") {
console.log("Exiting with error code 0");
process.exit(0);
}
})
.catch((error) => {
console.error(error);
if (process.env.SEALIOUS_SANITY === "true") {
console.log("EXITING WITH STATUS 1");
process.exit(1);
}
});
const router = app.HTTPServer.router;
router.use("/", homepage.routes());

@ -13,7 +13,6 @@ export function Task(task: CollectionItem<any>) {
${task.get("done") ? "checked" : ""}
/>
${task.get("title")}
<form
method="DELETE"
action="/tasks/${task.id}"

Loading…
Cancel
Save