mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Update repo structure as part of nixification
This commit is contained in:
parent
49e67c64fb
commit
cc0efcfdde
56 changed files with 181 additions and 154 deletions
25
legacy/puppet/production/scripts/config_version.rb
Executable file
25
legacy/puppet/production/scripts/config_version.rb
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
begin
|
||||
require 'rugged'
|
||||
rescue LoadError
|
||||
t = Time.new
|
||||
puts t.to_i
|
||||
else
|
||||
environmentpath = ARGV[0]
|
||||
environment = ARGV[1]
|
||||
|
||||
repo = Rugged::Repository.discover(File.join(environmentpath, environment))
|
||||
head = repo.head
|
||||
|
||||
# sha1 hash of the newest commit
|
||||
head_sha = head.target_id
|
||||
|
||||
# the commit message associated the newest commit
|
||||
# commit = repo.lookup(head_sha)
|
||||
|
||||
# add something to find the remote url
|
||||
|
||||
puts head_sha
|
||||
end
|
||||
5
legacy/puppet/production/scripts/config_version.sh
Executable file
5
legacy/puppet/production/scripts/config_version.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
/usr/bin/git --version > /dev/null 2>&1 &&
|
||||
/usr/bin/git --git-dir $1/../.git rev-parse HEAD ||
|
||||
date +%s
|
||||
Loading…
Add table
Add a link
Reference in a new issue