This repository has been archived by the owner on Jul 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Added a version controller and used proper ruby gems to gather data. #103
Open
aaronlippold
wants to merge
7
commits into
master
Choose a base branch
from
disp_ver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc8f321
Added a version controller and used proper ruby gems to gather data.
aaronlippold 717c867
Update app.json
aaronlippold c5e39b9
added cmake build pack
aaronlippold 323f3fb
fixed missing comma in json
aaronlippold 2831348
updated scripts for postdeploy and predestroy in app.json
aaronlippold a68c8cd
fixed postdeploy script
aaronlippold d4f318b
further tweaking on the app.json rake tasks
aaronlippold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
--- | ||
before: | ||
- 'export SECRET_KEY_BASE=xxx' | ||
after_install: 'setup-secrets.sh' | ||
- "export SECRET_KEY_BASE=xxx" | ||
after_install: "setup-secrets.sh" | ||
build_dependencies: | ||
- ImageMagick-devel | ||
- libxml2-devel | ||
- libxslt-devel | ||
- gcc | ||
- make | ||
- cmake | ||
- cmake-devel | ||
- automake | ||
dependencies: | ||
- mongodb-org-server | ||
- ImageMagick | ||
- cmake | ||
targets: | ||
centos-7: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Place all the styles related to the version controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class VersionController < ApplicationController | ||
def index | ||
g = Git.open(Rails.root, :log => Logger.new(STDOUT)) | ||
repo = Rugged::Repository.discover(Rails.root) | ||
version = { | ||
version: g.describe, | ||
branch: repo.head.name.split('/').last, | ||
sha: repo.head.target_id | ||
} | ||
render json: version | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module VersionHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"version": "v2.0.3-36-ga68c8cd", | ||
"branch": "disp_ver", | ||
"sha": "a68c8cdfd00ef3e5d066cd8f3f085bb5f6d083a0" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# config/initializers/version.rb | ||
|
||
if Rails.env.development? | ||
# we will hae to use both the `git` and `rugged` gem until | ||
# rugged implaments `git describe` | ||
g = Git.open(Rails.root) | ||
repo = Rugged::Repository.discover(Rails.root) | ||
|
||
version = { | ||
version: g.describe, | ||
branch: repo.head.name.split('/').last, | ||
sha: repo.head.target_id | ||
} | ||
|
||
File.open('config/VERSION','w') do |f| | ||
f.write(JSON.pretty_generate(version)) | ||
end | ||
end | ||
|
||
module MyApp | ||
# Read JSON from a file, iterate over objects | ||
parsed = JSON.parse(File.read('config/VERSION'), :symbolize_names => true) | ||
VERSION = parsed[:version] | ||
BRANCH = parsed[:branch] | ||
SHA = parsed[:sha] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe VersionController, type: :controller do | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the VersionHelper. For example: | ||
# | ||
# describe VersionHelper do | ||
# describe "string concat" do | ||
# it "concats two strings with spaces" do | ||
# expect(helper.concat_strings("this","that")).to eq("this that") | ||
# end | ||
# end | ||
# end | ||
RSpec.describe VersionHelper, type: :helper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure this will work as intended. It actually might be completely impossible to add a version in this manner since adding the version to the hash itself will change what the hash should be. Also, any squashes or merges done on Github will all have the wrong SHA since rails is not run on those. Heroku used to provide a
SOURCE_VERSION
ENV but is seems they have removed it.