GithubHelp home page GithubHelp logo

jpmartinspt / demoservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canonical-web-and-design/demoservice

0.0 0.0 0.0 94 KB

Django / Celery powered demo service https://drive.google.com/open?id=1Yw0uU9zp1Tc2l01loDSTdhc72LibSHYytWRLTVhCB58

Home Page: https://run.demo.haus

License: Other

Dockerfile 1.86% Python 81.98% HTML 14.35% Shell 1.81%

demoservice's Introduction

Demo service

Spin up ./run demos!

This service starts demos automatically from GitHub webhooks, as well as manually. For a full overview of this application, view OVERVIEW.md.

Information about our deployments can be found on our Google Drive document

Quickstart development

The demoservice app

Docker Compose

A close version to the production set up can be started using docker compose. All services are defined under docker-compose.yml in the project root.

docker-compose up

(or if you want to run it in the background, use docker-compose up -d)

This runs on the web app on http://0.0.0.0:8099. It should work well for simple development.

Check the instructions below for running fake demos if you want to quickly update templates.

Dependencies require a rebuild:

Every time dependencies change, you'll need to recreate the images before running the app again:

docker-compose build
docker-compose up

The hard way (Python virtual env)

The current recommended method for starting the server is to set up a Python 3 virtual env and run:

DJANGO_DEBUG=True CELERY_TASK_ALWAYS_EAGER=True python3 ./app/manage.py runserver

Running the service with DJANGO_DEBUG=True will run the database as sqlite and run the message queue tasks immediately without using a message queue.

The official Python documentation has a page on virtual environments. Another great option is pyenv with pyenv-virtualenv.

Running fake demos

The UI isn't useful without running demos. If you want to run a demo, there is a helper script for a lightweight demo:

# ./bin/create_fake_demo [repo_name] [pull_request_id]
./bin/create_fake_demo www.ubuntu.com 123

They will run in the background. Delete all the demos with:

./bin/delete_fake_demos

Sending fake webhooks in development

If you need to test the webhook views or simply need to fake a webhook, you can use the scripts provided in bin/. You will find sample payloads to use with the scripts in bin/data. Webhook signature validation should be disabled in DEBUG mode. It's highly likely that you will need to customize this sample payloads to use them.

./bin/send_fake_github_webhook bin/data/github.json
./bin/send_fake_launchpad_webhook bin/data/launchpad.json

demoservice's People

Contributors

anthonydillon avatar b-m-f avatar barrymcgee avatar caldav avatar deadlight avatar jpmartinspt avatar lukewh avatar nottrobin avatar renovate-bot avatar tbille avatar willmoggridge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.