GithubHelp home page GithubHelp logo

fastly-deploy-nodejs's Introduction

Usage

You'll need an Fastly API key and also to configure a new service in fastly and get hold of it's 'service id'.

npm install https://github.com/commuterjoy/fastly/archive/v2.0.0.tar.gz

export DEBUG=fastly; \
export fastly_apikey=<your-fastly-api-key>; \
export fastly_service=<your-fastly-service-id>; \
node deploy.js

You should see a trickle of requests being made to the API,

fastly Request: GET, /service/f9935BOx.../version +0ms
fastly Request: PUT, /service/f9935BOx.../version/40/clone +1s
fastly Request: GET, /service/f9935BOx.../version/41/vcl +669ms
...

Workflow

The workflow to configure the CDN is simple,

  • Update VCL in ./src/vcl
  • Type make deploy test

If the tests pass then you've not broken anything and can deploy to production.

Notes

This is the strategy theguardian.com used when deploying fastly VCL updates,

  • Find the active VCL version.
  • Clone the active version.
  • Delete all the VCL file(s) in the cloned version ready for the new ones.
  • Upload you new VCL file(s).
  • Define the main VCL file.
  • Validate the cloned version.
  • Activate the cloned version.

This is based on the Fastly node client library.

to-do

Done

  • Deploy (or rollback) in under 6 seconds using the Fastly API.
  • A developer-oriented workflow - deploy to staging -> execute a test suite -> deploy to production.
  • Multi-region routing (eu, us) based on request origin.
  • System state can be emulated with request headers.
  • Can serve one or more editions on the same URL.

Not done

  • Map editions to a preference cookie.
  • Fail-over to EU or US. Nb. should just be a case of deleting the region look-up switch.

fastly-deploy-nodejs's People

Contributors

commuterjoy avatar

Watchers

 avatar  avatar

fastly-deploy-nodejs's Issues

How to support flag overrides for next-*

How does something like this sound:-

  • A tool like http://app.ft.com/qatool that lists the flags with their default states and buttons to override. [maybe with origami tech docs]
  • … which sets cookies in the form something like next-flag-{flagname}=true.
  • … which fastly reworks to be headers something like X-Next-Flag-{flagname}: true, which are stripped out on deliver
  • … the express app, if it wants to vary on a flag it sets res.vary(['Accept-Encoding', 'X-Next-Flag-Ads']);

cc @richard-still-ft @wheresrhys @commuterjoy @laurent-muchacho @adgad @leanne1

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.