Launch a new service on Short Cloud in 10 minutes
Project | Status | Impacts |
---|---|---|
Framework CLI | In Progress | All the following manual work will be automated with this CLI! |
-
Clone this repo.
git clone https://github.com/short-d/app-template.git
-
Replace all occurrences of
sampleapp
in.drone.yml
with the name of your service. -
Replace all occurrences of
sampleapp
ink8s
with the name of your service. -
Remove
.git
and initialize repo.rm -rf .git git init
-
Add and commit all files to
Git
.git add -A git commit -m "Initialize service"
-
Create a new repo on
Github
and push all local changes to that repo. -
Request permission for Drone CI and sync repos.
-
Enable the newly created
Github
repo onDrone CI
. -
Set the following secrets for the new repo on
Drone CI
:Secret Name Secret Value DOCKERHUB_ORG_ID DockerHub org ID or your username DOCKERHUB_USERNAME DockerHub username DOCKERHUB_PASSWORD DockerHub password -
Create
secrets
directory insidek8s
.mkdir k8s/secrets
-
Create
db-secret.staging.yaml
with the following content and update the secrets with real DB config:apiVersion: v1 kind: Secret metadata: name: sampleapp-db namespace: staging type: Opaque data: host: db hostname in base 64 format port: db port in base 64 format user: db user in base 64 format password: db password in base 64 format name: db name in base 64 format
-
Create
db-secret.production.yaml
with the following content and update the secrets with real DB config:apiVersion: v1 kind: Secret metadata: name: sampleapp-db namespace: production type: Opaque data: host: db hostname in base 64 format port: db port in base 64 format user: db user in base 64 format password: db password in base 64 format name: db name in base 64 format
-
Request permission for Kubernetes cluster and install
kubectl
. -
Enable service on Kubernetes:
./scripts/deploy
-
Request permission for
Digitalocean
. -
add A records for your service and replace
service_name
with the name of your service:Hostname Will Direct To service_name External gql-service_name External service_name-staging External gql-service_name-staging External -
Visit
service_name-staging.short-d.com
. You should see the sample site is polling change logs from the backend! -
Create
production
branch.git check -b prouduction
-
Deploy the service onto
production
.git push origin -u production
-
Visit
service_name.short-d.com
. You should see the sample site is running onproduction
! -
Request permission for DockerHub org and create web hooks for all staging & production images for your service:
Webhook Name Webhook URL Keel https://deploy.short-d.com/v1/webhooks/dockerhub