Compare commits

..

No commits in common. "3bd7b3076fd69e386b1433b4434800033acf1048" and "5997105fed9db61cafe48698d8d232fabf54b102" have entirely different histories.

7 changed files with 15 additions and 96 deletions

View File

@ -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
type: kubernetes
name: deploy
@ -128,7 +68,6 @@ trigger:
branch:
exclude:
- main
- staging
steps:
- name: build-publish-image
@ -144,7 +83,7 @@ steps:
from_secret: org_docker_username
password:
from_secret: org_docker_password
dockerfile: staging.Dockerfile
dockerfile: Dockerfile
repo: dutchellie/${DRONE_REPO_NAME}
tags:
- ${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}

View File

@ -1,5 +1,6 @@
baseURL: changemestaging.dutchellie.nl
name: changeme-staging
replicas: 2
containerEnv:
# - name: APIURL
# value: https://api.quenten.nl/api/testing

View File

@ -4,7 +4,6 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
"staging": "vite build --mode staging",
"package": "svelte-kit package",
"preview": "vite preview",
"prepare": "svelte-kit sync",

View File

@ -15,11 +15,9 @@
import { onMount } from 'svelte';
import { sha256 } from 'js-sha256';
import GuestbookEntry from './guestbook/guestbook-entry.svelte';
import { mode } from '$app/env';
//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';
import { page } from '$app/stores';
import { comment } from 'postcss';
let showError = false;
let errorTitle = 'Error';
let errorMessage = 'Error message';
@ -60,7 +58,7 @@
};
const jsonData = JSON.stringify(data);
const res = await fetch(ApiURL + '/comment', {
const res = await fetch('https://api.quenten.nl/api/testing/comment', {
method: 'POST',
body: jsonData
});
@ -93,7 +91,7 @@
return;
}
let newHash = await fetch(ApiURL + '/commenthash')
let newHash = await fetch('https://api.quenten.nl/api/testing/commenthash')
.then((res) => res.text())
.then((t) => {
return t;
@ -109,7 +107,7 @@
async function fetchComments() {
let comments: Comment[];
comments = await fetch(ApiURL + '/comment')
comments = await fetch('https://api.quenten.nl/api/testing/comment')
.then((res) => res.json())
.then((data) => {
return data;
@ -163,15 +161,15 @@
bind:value={message}
/>
<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
>
</form>
<div>
{#if DisplayComments != null}
<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 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={() => {if (commentPage > 0) commentPage -= 1}}>Previous</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>
</div>
{#each DisplayComments.slice(commentPage * pageSize, commentPage * pageSize + pageSize) as c}

View File

@ -3,8 +3,8 @@
export let comment: Comment;
</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-t bg-slate-400 dark:bg-slate-700 grid grid-cols-2 gap-1 min-h-fit px-3 py-1">
<div class="rounded bg-red-100 mt-2 break-words">
<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">
Time:
@ -18,7 +18,7 @@
<p class="text-xs col-span-2">Site: {comment.website}</p>
{/if}
</div>
<div class="px-3 py-2">
<div class="px-3 ">
<p class="">{comment.message}</p>
</div>
</div>

View File

@ -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"]

View File

@ -2,7 +2,7 @@ import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
plugins: [sveltekit()]
};
export default config;