fp/Makefile

133 lines
5.4 KiB
Makefile
Raw Normal View History

2024-03-29 07:28:02 +00:00
include .env
2024-04-20 22:34:14 +00:00
dev: minikube secrets tilt
all: bootstrap secrets helmsman
2024-04-02 14:49:33 +00:00
2024-04-22 00:14:48 +00:00
crds:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.crds.yaml
2024-04-20 22:34:14 +00:00
2024-04-22 00:14:48 +00:00
cert-manager:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.yaml
2024-04-27 19:54:50 +00:00
flux:
flux bootstrap git --url="ssh://git@gitea.futureporn.net:2222/futureporn/fp" --branch=main --path="clusters/production" --private-key-file=/home/chris/.ssh/fp-flux
2024-04-22 00:14:48 +00:00
2024-04-22 15:57:57 +00:00
argo:
helmsman --apply -f ./helmsman.argocd.yaml
2024-04-22 00:14:48 +00:00
namespaces:
kubectl create namespace cert-manager
2024-04-27 19:54:50 +00:00
kubectl create namespace futureporn
2024-04-18 20:51:09 +00:00
helmsman:
helmsman --apply -f ./helmsman.yaml
2024-04-20 22:34:14 +00:00
deploy: helmsman secrets
2024-04-18 20:51:09 +00:00
2024-04-02 14:49:33 +00:00
tilt:
tilt up
2024-03-29 07:28:02 +00:00
secrets:
2024-05-27 22:20:58 +00:00
kubectl --namespace futureporn delete secret frp --ignore-not-found
kubectl --namespace futureporn create secret generic frp \
--from-literal=token=${FRP_TOKEN}
kubectl --namespace futureporn delete secret scout --ignore-not-found
kubectl --namespace futureporn create secret generic scout \
--from-literal=recentsToken=${SCOUT_RECENTS_TOKEN} \
--from-literal=strapiApiKey=${SCOUT_STRAPI_API_KEY} \
--from-literal=imapServer=${SCOUT_IMAP_SERVER} \
--from-literal=imapPort=${SCOUT_IMAP_PORT} \
--from-literal=imapUsername=${SCOUT_IMAP_USERNAME} \
--from-literal=imapPassword=${SCOUT_IMAP_PASSWORD} \
--from-literal=imapAccessToken=${SCOUT_IMAP_ACCESS_TOKEN} \
2024-04-26 22:19:45 +00:00
kubectl --namespace futureporn delete secret link2cid --ignore-not-found
kubectl --namespace futureporn create secret generic link2cid \
2024-03-29 07:28:02 +00:00
--from-literal=apiKey=${LINK2CID_API_KEY}
2024-04-20 22:34:14 +00:00
kubectl --namespace cert-manager delete secret vultr --ignore-not-found
kubectl --namespace cert-manager create secret generic vultr \
--from-literal=apiKey=${VULTR_API_KEY}
2024-04-26 22:19:45 +00:00
kubectl --namespace futureporn delete secret vultr --ignore-not-found
kubectl --namespace futureporn create secret generic vultr \
2024-04-18 20:51:09 +00:00
--from-literal=containerRegistryUsername=${VULTR_CONTAINER_REGISTRY_USERNAME} \
--from-literal=apiKey=${VULTR_API_KEY}
2024-03-29 07:28:02 +00:00
2024-04-26 22:19:45 +00:00
kubectl --namespace futureporn delete secret postgres --ignore-not-found
kubectl --namespace futureporn create secret generic postgres \
2024-04-11 08:17:51 +00:00
--from-literal=password=${POSTGRES_PASSWORD}
2024-04-26 22:19:45 +00:00
kubectl --namespace futureporn delete secret pgadmin --ignore-not-found
kubectl --namespace futureporn create secret generic pgadmin \
2024-04-11 08:17:51 +00:00
--from-literal=defaultEmail=${PGADMIN_DEFAULT_EMAIL} \
--from-literal=defaultPassword=${PGADMIN_DEFAULT_PASSWORD}
2024-04-26 22:19:45 +00:00
kubectl --namespace futureporn delete secret strapi --ignore-not-found
kubectl --namespace futureporn create secret generic strapi \
2024-04-02 14:49:33 +00:00
--from-literal=adminJwtSecret=${STRAPI_ADMIN_JWT_SECRET} \
--from-literal=apiTokenSalt=${STRAPI_API_TOKEN_SALT} \
2024-04-11 08:17:51 +00:00
--from-literal=appKeys=${STRAPI_APP_KEYS} \
2024-05-27 22:20:58 +00:00
--from-literal=databaseUrl=postgres.futureporn.svc.cluster.local://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} \
2024-05-27 22:36:44 +00:00
--from-literal=databaseUrl=postgres.futureporn.svc.cluster.local://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} \
2024-04-02 14:49:33 +00:00
--from-literal=jwtSecret=${STRAPI_JWT_SECRET} \
--from-literal=muxPlaybackRestrictionId=${MUX_PLAYBACK_RESTRICTION_ID} \
--from-literal=muxSigningKeyPrivateKey=${MUX_SIGNING_KEY_PRIVATE_KEY} \
--from-literal=s3UscBucketApplicationKey=${S3_USC_BUCKET_APPLICATION_KEY} \
--from-literal=s3UscBucketEndpoint=${S3_USC_BUCKET_ENDPOINT} \
--from-literal=s3UscBucketName=${S3_USC_BUCKET_NAME} \
--from-literal=s3UscBucketKeyId=${S3_USC_BUCKET_KEY_ID} \
--from-literal=s3UscBucketRegion=${S3_USC_BUCKET_REGION} \
--from-literal=muxSigningKeyId=${MUX_SIGNING_KEY_ID} \
--from-literal=strapiAdminEmail=${STRAPI_ADMIN_EMAIL} \
--from-literal=sendgridApiKey=${SENDGRID_API_KEY} \
--from-literal=cdnBucketUscUrl=${CDN_BUCKET_USC_URL} \
--from-literal=transferTokenSalt=${TRANSFER_TOKEN_SALT}
2024-05-27 22:20:58 +00:00
kubectl --namespace futureporn delete secret realtime --ignore-not-found
kubectl --namespace futureporn create secret generic realtime \
--from-literal=postgresRealtimeConnectionString=${POSTGRES_REALTIME_CONNECTION_STRING}
2024-03-29 07:28:02 +00:00
define _script
cat <<'EOF' | ctlptl apply -f -
apiVersion: ctlptl.dev/v1alpha1
kind: Cluster
product: minikube
registry: ctlptl-registry
kubernetesVersion: v1.28.3
EOF
endef
export script = $(value _script)
2024-03-29 10:14:18 +00:00
minikube:
2024-03-29 07:28:02 +00:00
@ eval "$$script"
minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver
minikube addons enable metrics-server
2024-05-27 22:20:58 +00:00
kind:
bash -x ./scripts/kind-with-local-registry.sh
deps:
sudo pamac install make entr nvm minikube kubectl docker helm
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
echo "go to https://github.com/txn2/kubefwd/releases/latest to get kubefwd"
echo "go to https://github.com/tilt-dev/ctlptl/releases/latest to get ctlptl"
sudo systemctl enable docker
sudo systemctl start docker
usermod -aG docker cj
newgrp docker
2024-03-29 07:28:02 +00:00
# A gitea act runner which runs locally
# https://docs.gitea.com/next/usage/actions/overview
2024-03-29 10:14:18 +00:00
# this doesnt work because of missing docker in docker
# I'm running this using systemd instead
#runner:
# docker run -d --rm -e GITEA_INSTANCE_URL=https://gitea.futureporn.net -e GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN} -v /var/run/docker.sock:/var/run/docker.sock -v $$HOME/.local/share/applications/fp/act-runner-data:/data --privileged --name fp-gitea-act-runner gitea/act_runner