Skip to content
This repository has been archived by the owner on Dec 27, 2020. It is now read-only.
/ app-template Public archive

Launch a new service on Short Cloud in 10 minutes

Notifications You must be signed in to change notification settings

short-d/app-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppTemplate

Launch a new service on Short Cloud in 10 minutes

New Initiatives

Project Status Impacts
Framework CLI In Progress All the following manual work will be automated with this CLI!

Getting Started

  1. Clone this repo.

    git clone https://github.com/short-d/app-template.git
  2. Replace all occurrences of sampleapp in .drone.yml with the name of your service.

  3. Replace all occurrences of sampleapp in k8s with the name of your service.

  4. Remove .git and initialize repo.

    rm -rf .git
    git init
  5. Add and commit all files to Git.

    git add -A
    git commit -m "Initialize service"
  6. Create a new repo on Github and push all local changes to that repo.

  7. Request permission for Drone CI and sync repos.

  8. Enable the newly created Github repo on Drone CI.

  9. 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
  10. Create secrets directory inside k8s.

    mkdir k8s/secrets
  11. 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
    
  12. 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
    
  13. Request permission for Kubernetes cluster and install kubectl.

  14. Enable service on Kubernetes:

    ./scripts/deploy
  15. Request permission for Digitalocean.

  16. 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
  17. Visit service_name-staging.short-d.com. You should see the sample site is polling change logs from the backend!

    Staging

  18. Create production branch.

    git check -b prouduction
  19. Deploy the service onto production.

    git push origin -u production
  20. Visit service_name.short-d.com. You should see the sample site is running on production!

    Staging

  21. 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

About

Launch a new service on Short Cloud in 10 minutes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published