Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Rails: assets:precompile #12

Closed
ajgon opened this issue Apr 17, 2016 · 8 comments
Closed

Rails: assets:precompile #12

ajgon opened this issue Apr 17, 2016 · 8 comments
Assignees
Milestone

Comments

@ajgon
Copy link
Owner

ajgon commented Apr 17, 2016

No description provided.

@ajgon ajgon self-assigned this Apr 17, 2016
@ajgon ajgon added this to the 0.1.0 milestone Apr 17, 2016
@ajgon ajgon closed this as completed Apr 18, 2016
@cickes
Copy link

cickes commented May 26, 2017

Unable to override assets_precompile. Thoughts?

Including the following custom json in layer settings

{
  "app-being-deployed-shortname":  
   {
      "framework": {
        "assets_precompile": false
      }
    }
}

This is not overriding the default "true". In turn, I receive the following error.

================================================================================
Error executing action `run` on resource 'execute[assets:precompile]'
================================================================================
 
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/bundle exec rake assets:precompile ----
STDOUT: 
STDERR: rake aborted!
Don't know how to build task 'assets:precompile' (see --tasks)

@ajgon
Copy link
Owner Author

ajgon commented May 26, 2017

Which framework do you use? Rails?

@ajgon ajgon reopened this May 26, 2017
@cickes
Copy link

cickes commented May 26, 2017

Yes, Rails framework. I did not specify this in any attributes though. Did I miss something? Should "rails" replace "framework" in the custom json?

@ajgon
Copy link
Owner Author

ajgon commented May 26, 2017

No, your JSON is correct, I'll try to debug this issue today and let you know what's going on...

@ajgon
Copy link
Owner Author

ajgon commented May 30, 2017

Ok, I tried to reproduce your error, but with no luck. I also added tests to cover up this case - no luck either. Can you paste me a full Stack JSON you are using (with sensitive data redacted)?

@cickes
Copy link

cickes commented May 30, 2017

{
  "appname": {
    "framework": {
      "assets_precompile": false
    }
  },
  "applications": ["appname"] 
}

Very basic install, essentially testing. Using Rails API, if that matters. Obviously API version does not include asset precompilation which is why I'm trying to skip the command.
rails new appname --api

@ajgon
Copy link
Owner Author

ajgon commented May 31, 2017

Ok, I nailed the issue - something changed in Chef API (again). I know how to fix it, but it's bigger issue, so I'll fix it on weekend.

Thanks for catching this!

@ajgon
Copy link
Owner Author

ajgon commented Jun 4, 2017

Ok, I don't know how I didn't notice it... but we were missing the 'deploy' keyword in the Stack JSON 😊 Because that was the original format of Chef 11 Stack for Amazon.

So, your config should state:

{
  "deploy": {
    "appname": {
      "framework": {
        "assets_precompile": false
      }
    },
    "applications": ["appname"] 
  }
}

and everything would work as expected. However, I need to fix the JSON Generator tool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants