简体   繁体   中英

pushing rails engine to github

我刚写完第一个引擎,我能找到的是我应该运行gem build my_gem.gemspec使其成为一个gem,我实际上想做的就是将其推送到github,但是我不知道应该使用哪个文件夹我忽略了要保留的内容,对此有什么特殊命令吗?

The engine app structure that Rails generates is designed to be deployed and mounted as a gem, so if you want to use Github as your gem's repository you can just push the entire folder structure.

For example:

cd path/to/engine
git commit -m "latest engine changes"
git push origin

will push it to Github when your Github repository has been configured as the remote origin.

Then it can be added as a gem from the main app's Gemfile:

gem "engine_name", github: 'github_user/engine_name'

Just make sure that you do not include any credentials, access keys, passwords, etc.. when pushing to Github. These should be referenced in your engine's code as ENV variables: for example: ENV["my_secret_credential"] and provided by the runtime environment in production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM