Compare commits
No commits in common. "3bd7b3076fd69e386b1433b4434800033acf1048" and "5997105fed9db61cafe48698d8d232fabf54b102" have entirely different histories.
3bd7b3076f
...
5997105fed
63
.drone.yml
63
.drone.yml
@ -58,66 +58,6 @@ volumes:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: deploy-staging
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
branch:
|
|
||||||
- staging
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build-publish-image
|
|
||||||
image: plugins/docker
|
|
||||||
privileged: true
|
|
||||||
volumes:
|
|
||||||
- name: build
|
|
||||||
path: /drone/src/build
|
|
||||||
settings:
|
|
||||||
cache_from:
|
|
||||||
"dutchellie/${DRONE_REPO_NAME}:${DRONE_BRANCH}-latest"
|
|
||||||
username:
|
|
||||||
from_secret: org_docker_username
|
|
||||||
password:
|
|
||||||
from_secret: org_docker_password
|
|
||||||
dockerfile: staging.Dockerfile
|
|
||||||
repo: dutchellie/${DRONE_REPO_NAME}
|
|
||||||
tags:
|
|
||||||
- ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}
|
|
||||||
- ${DRONE_BRANCH}-latest
|
|
||||||
- name: deploy
|
|
||||||
image: pelotech/drone-helm3
|
|
||||||
settings:
|
|
||||||
mode: upgrade
|
|
||||||
chart: .drone/helm/chart
|
|
||||||
namespace: drone-staging
|
|
||||||
release: ${DRONE_REPO_NAME}-${DRONE_BRANCH}
|
|
||||||
skip_tls_verify: true
|
|
||||||
values_files:
|
|
||||||
- .drone/helm/prod-val.yaml
|
|
||||||
values:
|
|
||||||
- "image=dutchellie/${DRONE_REPO_NAME}:${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
- "baseURL=staging.quenten.nl"
|
|
||||||
- "name=${DRONE_REPO_NAME}-${DRONE_BRANCH}"
|
|
||||||
kube_api_server:
|
|
||||||
from_secret: org_api_server
|
|
||||||
kube_token:
|
|
||||||
from_secret: org_kube_token
|
|
||||||
kube_certificate:
|
|
||||||
from_secret: org_kube_certificate
|
|
||||||
kube_service_account: drone-deploy
|
|
||||||
dry_run: false
|
|
||||||
depends_on:
|
|
||||||
- build-publish-image
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: build
|
|
||||||
temp: {}
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: deploy
|
name: deploy
|
||||||
@ -128,7 +68,6 @@ trigger:
|
|||||||
branch:
|
branch:
|
||||||
exclude:
|
exclude:
|
||||||
- main
|
- main
|
||||||
- staging
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-publish-image
|
- name: build-publish-image
|
||||||
@ -144,7 +83,7 @@ steps:
|
|||||||
from_secret: org_docker_username
|
from_secret: org_docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: org_docker_password
|
from_secret: org_docker_password
|
||||||
dockerfile: staging.Dockerfile
|
dockerfile: Dockerfile
|
||||||
repo: dutchellie/${DRONE_REPO_NAME}
|
repo: dutchellie/${DRONE_REPO_NAME}
|
||||||
tags:
|
tags:
|
||||||
- ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}
|
- ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
baseURL: changemestaging.dutchellie.nl
|
baseURL: changemestaging.dutchellie.nl
|
||||||
name: changeme-staging
|
name: changeme-staging
|
||||||
|
replicas: 2
|
||||||
containerEnv:
|
containerEnv:
|
||||||
# - name: APIURL
|
# - name: APIURL
|
||||||
# value: https://api.quenten.nl/api/testing
|
# value: https://api.quenten.nl/api/testing
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"staging": "vite build --mode staging",
|
|
||||||
"package": "svelte-kit package",
|
"package": "svelte-kit package",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"prepare": "svelte-kit sync",
|
"prepare": "svelte-kit sync",
|
||||||
|
@ -15,11 +15,9 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { sha256 } from 'js-sha256';
|
import { sha256 } from 'js-sha256';
|
||||||
import GuestbookEntry from './guestbook/guestbook-entry.svelte';
|
import GuestbookEntry from './guestbook/guestbook-entry.svelte';
|
||||||
import { mode } from '$app/env';
|
import { page } from '$app/stores';
|
||||||
|
import { comment } from 'postcss';
|
||||||
//const ApiURL = dev ? 'https://api.quenten.nl/api/testing' : 'https://api.quenten.nl/api';
|
|
||||||
//const ApiURL = import.meta.env.APIURL;
|
|
||||||
const ApiURL = mode == 'production' ? 'https://api.quenten.nl/api' : 'https://api.quenten.nl/api/testing';
|
|
||||||
let showError = false;
|
let showError = false;
|
||||||
let errorTitle = 'Error';
|
let errorTitle = 'Error';
|
||||||
let errorMessage = 'Error message';
|
let errorMessage = 'Error message';
|
||||||
@ -60,7 +58,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const jsonData = JSON.stringify(data);
|
const jsonData = JSON.stringify(data);
|
||||||
const res = await fetch(ApiURL + '/comment', {
|
const res = await fetch('https://api.quenten.nl/api/testing/comment', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: jsonData
|
body: jsonData
|
||||||
});
|
});
|
||||||
@ -93,7 +91,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let newHash = await fetch(ApiURL + '/commenthash')
|
let newHash = await fetch('https://api.quenten.nl/api/testing/commenthash')
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((t) => {
|
.then((t) => {
|
||||||
return t;
|
return t;
|
||||||
@ -109,7 +107,7 @@
|
|||||||
|
|
||||||
async function fetchComments() {
|
async function fetchComments() {
|
||||||
let comments: Comment[];
|
let comments: Comment[];
|
||||||
comments = await fetch(ApiURL + '/comment')
|
comments = await fetch('https://api.quenten.nl/api/testing/comment')
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return data;
|
return data;
|
||||||
@ -163,15 +161,15 @@
|
|||||||
bind:value={message}
|
bind:value={message}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="bg-blue-100 dark:bg-slate-700 border-slate-400 border-2 rounded-full py-2 w-fit px-10"
|
class="bg-blue-100 border-slate-400 border-2 rounded-full py-2 w-fit px-10"
|
||||||
type="submit">Submit</button
|
type="submit">Submit</button
|
||||||
>
|
>
|
||||||
</form>
|
</form>
|
||||||
<div>
|
<div>
|
||||||
{#if DisplayComments != null}
|
{#if DisplayComments != null}
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<button class="px-5 py-2 bg-slate-400 dark:bg-slate-800 dark:ring-slate-400 dark:ring-2 rounded-xl mx-1" on:click={() => {if (commentPage > 0) commentPage -= 1}}>Previous</button>
|
<button class="px-5 py-2 bg-slate-400 rounded-xl" on:click={() => {if (commentPage > 0) commentPage -= 1}}>Previous</button>
|
||||||
<button class="px-5 py-2 bg-slate-400 dark:bg-slate-800 dark:ring-slate-400 dark:ring-2 rounded-xl mx-1" on:click={() => commentPage += 1}>Next Page</button>
|
<button class="px-5 py-2 bg-slate-400 rounded-xl" on:click={() => commentPage += 1}>Next Page</button>
|
||||||
<p class="ml-2 mt-1 w-full md:w-max">Current page: {commentPage + 1}</p>
|
<p class="ml-2 mt-1 w-full md:w-max">Current page: {commentPage + 1}</p>
|
||||||
</div>
|
</div>
|
||||||
{#each DisplayComments.slice(commentPage * pageSize, commentPage * pageSize + pageSize) as c}
|
{#each DisplayComments.slice(commentPage * pageSize, commentPage * pageSize + pageSize) as c}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
export let comment: Comment;
|
export let comment: Comment;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="rounded bg-red-100 dark:bg-slate-800 dark:ring-2 dark:ring-slate-400 mt-2 break-words">
|
<div class="rounded bg-red-100 mt-2 break-words">
|
||||||
<div class="rounded-t bg-slate-400 dark:bg-slate-700 grid grid-cols-2 gap-1 min-h-fit px-3 py-1">
|
<div class="rounded-t bg-slate-400 grid grid-cols-2 gap-1 min-h-fit px-3 py-1">
|
||||||
<p class="text-xs">Author: {comment.name}</p>
|
<p class="text-xs">Author: {comment.name}</p>
|
||||||
<p class="text-xs">
|
<p class="text-xs">
|
||||||
Time:
|
Time:
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<p class="text-xs col-span-2">Site: {comment.website}</p>
|
<p class="text-xs col-span-2">Site: {comment.website}</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="px-3 py-2">
|
<div class="px-3 ">
|
||||||
<p class="">{comment.message}</p>
|
<p class="">{comment.message}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
FROM node:18.2.0-alpine
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
RUN npm ci
|
|
||||||
RUN npm audit fix
|
|
||||||
RUN npm run staging
|
|
||||||
|
|
||||||
FROM node:18.2.0-alpine
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=0 /app/package*.json ./
|
|
||||||
RUN npm ci --ignore-scripts
|
|
||||||
RUN npm audit fix
|
|
||||||
COPY --from=0 /app/build ./
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
CMD ["node", "./index.js"]
|
|
@ -2,7 +2,7 @@ import { sveltekit } from '@sveltejs/kit/vite';
|
|||||||
|
|
||||||
/** @type {import('vite').UserConfig} */
|
/** @type {import('vite').UserConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()]
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
Loading…
Reference in New Issue
Block a user