Skip to content

Commit

Permalink
app working almost minting
Browse files Browse the repository at this point in the history
  • Loading branch information
neotheprogramist committed Jan 31, 2024
1 parent 5a15fab commit 4b300d4
Show file tree
Hide file tree
Showing 45 changed files with 1,944 additions and 1,239 deletions.
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
plugins: ['prettier-plugin-tailwindcss'],
}
4 changes: 2 additions & 2 deletions deploy-to-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

podman build -t webapp . && \
podman push --tls-verify=false webapp:latest localhost:30500/webapp:latest && \
podman build -t treasure-hunt . && \
podman push --tls-verify=false treasure-hunt:latest localhost:30500/treasure-hunt:latest && \
kubectl config use-context kind-kind && \
kubectl apply -k k8s/patches/dev
27 changes: 27 additions & 0 deletions deploy-to-production.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# Load environment variables
source .env && \
source .env.local && \

# Create namespace
kubectl create namespace treasure-hunt-production --dry-run=client -o yaml | kubectl apply -f - && \

# Delete old deployment
kubectl delete -k k8s/patches/production && \

# Build the Docker image
podman build -t treasure-hunt:latest . && \

# Push the Docker image
podman push --creds $REGISTRY_USER:$REGISTRY_PASS treasure-hunt:latest registry.visoft.dev/treasure-hunt:latest && \

# Create or update the Docker registry secret
kubectl -n treasure-hunt-production create secret docker-registry regcred \
--docker-server=$REGISTRY_URL \
--docker-username=$REGISTRY_USER \
--docker-password=$REGISTRY_PASS \
--dry-run=client -o yaml | kubectl apply -f - && \

# Apply Kubernetes manifests
kubectl apply -k k8s/patches/production
18 changes: 0 additions & 18 deletions deploy-to-staging.sh

This file was deleted.

3 changes: 0 additions & 3 deletions k8s/patches/dev/pull.patch.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: default
namespace: treasure-hunt-production

resources:
- ../../resources
Expand All @@ -11,7 +11,7 @@ patches:
- path: pull.patch.yaml
target:
kind: Deployment
labelSelector: "app.kubernetes.io/name=webapp-template"
labelSelector: "app.kubernetes.io/name=treasure-hunt"

configMapGenerator:
- name: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
- name: regcred
- op: add
path: /spec/template/spec/containers/0/image
value: registry.visoft.dev/webapp:latest
value: registry.visoft.dev/treasure-hunt:latest
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: webapp-template
name: treasure-hunt
spec:
parentRefs:
- kind: Gateway
name: nginx-gateway
namespace: nginx-gateway
name: nginx-production-gateway
namespace: nginx-production-gateway
hostnames:
- localhost
- hunters.visoft.dev
rules:
- matches:
backendRefs:
- name: webapp-template
- name: treasure-hunt
port: 80
24 changes: 0 additions & 24 deletions k8s/patches/staging/kustomization.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions k8s/patches/staging/routes.yaml

This file was deleted.

14 changes: 7 additions & 7 deletions k8s/resources/base.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-template
name: treasure-hunt
labels:
app.kubernetes.io/name: webapp-template
app.kubernetes.io/name: treasure-hunt
spec:
selector:
matchLabels:
app.kubernetes.io/name: webapp-template
app.kubernetes.io/name: treasure-hunt
template:
metadata:
labels:
app.kubernetes.io/name: webapp-template
app.kubernetes.io/name: treasure-hunt
spec:
containers:
- name: webapp-template
- name: treasure-hunt
envFrom:
- secretRef:
name: secret
Expand All @@ -26,10 +26,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: webapp-template
name: treasure-hunt
spec:
selector:
app.kubernetes.io/name: webapp-template
app.kubernetes.io/name: treasure-hunt
ports:
- name: tcp
protocol: TCP
Expand Down
8 changes: 4 additions & 4 deletions kind/install.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Load dotenv
ansible.builtin.import_playbook: playbooks/dotenv.yaml
# - name: Load dotenv
# ansible.builtin.import_playbook: playbooks/dotenv.yaml

- name: Install Cert-Manager
ansible.builtin.import_playbook: playbooks/cert-manager.yaml
Expand All @@ -11,5 +11,5 @@
- name: Install NGINX Gateway Fabric
ansible.builtin.import_playbook: playbooks/gateway.yaml

- name: Install SurrealDB
ansible.builtin.import_playbook: playbooks/surrealdb.yaml
# - name: Install SurrealDB
# ansible.builtin.import_playbook: playbooks/surrealdb.yaml
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,30 @@
"@types/node": "^20.11.6",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"autoprefixer": "^10.4.14",
"dotenv": "^16.3.2",
"eslint": "^8.56.0",
"eslint-plugin-qwik": "^1.4.1",
"fastify": "^4.17.0",
"fastify-plugin": "^4.5.0",
"postcss": "^8.4.31",
"prettier": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.4",
"tailwindcss": "3.3.3",
"typescript": "5.3.3",
"undici": "*",
"vite": "^5.0.12",
"vite-tsconfig-paths": "^4.2.1"
},
"dependencies": {
"@dnlup/fastify-traps": "^3.0.2"
"@arx-research/libhalo": "^1.2.26",
"@dnlup/fastify-traps": "^3.0.2",
"@nightlylabs/wallet-selector-polkadot": "^0.1.19",
"@polkadot/api": "^8.14.1",
"@polkadot/api-contract": "^8.14.1",
"@polkadot/types-codec": "^8.14.1",
"@polkadot/types-create": "^8.14.1",
"buffer": "^6.0.3",
"viem": "^2.6.1"
}
}
6 changes: 6 additions & 0 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Loading

0 comments on commit 4b300d4

Please sign in to comment.