Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to define how current version is stored. #2

Closed
wants to merge 5 commits into from

Conversation

arenoir
Copy link

@arenoir arenoir commented Mar 11, 2015

Implement feature to make it easy to use nginx to serve the index page. Nginx config example at ember-cli-deploy/ember-cli-deploy#91

This pr adds a config option copyToKey. When defined the activate function copies the value of the specified version to the copyToKey value record. This makes it easy to serve the index page from nginx without having to do a primary lookup.

Example.

//my-app/config/deploy.js
module.exports = {
  production: {
    store: {
      type: 'redis',
      host: 'localhost',
      port: 6379,
      copyToKey: 'current-copy'
    },
}

nginx config

#this sets a variable $app_version from a url parameter version or defaults to 'current-copy'
map $arg_version $app_version {
    default "current-copy";
    ~^\w+ $arg_version;
}
upstream redisbackend{
    server 127.0.0.1:6379;
}
server {
    location / {
        set $redis_key my-app:$app_version;
        redis_pass redisbackend;
        default_type text/html;
    }
}

@arenoir
Copy link
Author

arenoir commented Feb 24, 2016

Taken care of in ember-cli-deploy-redis ember-cli-deploy/ember-cli-deploy-redis#43

@arenoir arenoir closed this Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant