Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3745867
D2973.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D2973.diff
View Options
diff --git a/roles/salt-primary/software/files/autochmod-git.sh b/roles/salt-primary/software/files/autochmod-git.sh
new file mode 100755
--- /dev/null
+++ b/roles/salt-primary/software/files/autochmod-git.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Sets permissions for a group-shared Git repository
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# If eligible, BSD-2-Clause
+# Source file: roles/salt-primary/software/files/autochmod-git.sh
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+set -e
+
+# -------------------------------------------------------------
+# Ensure user is root
+#
+# Note: POSIX shells don't always define $UID or $EUID.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ "$(id -u)" -ne 0 ]; then
+ echo "This command must be run as root." >&2
+ exit 1
+fi
+
+# -------------------------------------------------------------
+# Git information
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+dir=$(git rev-parse --show-toplevel)
+
+# -------------------------------------------------------------
+# Let's chmod
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+set -x
+
+find "$dir" -print0 -type d | xargs -0 chmod g+xw
+find "$dir" -print0 -type f | xargs -0 chmod g+w
diff --git a/roles/salt-primary/software/init.sls b/roles/salt-primary/software/init.sls
--- a/roles/salt-primary/software/init.sls
+++ b/roles/salt-primary/software/init.sls
@@ -28,3 +28,8 @@
file.managed:
- source: salt://roles/salt-primary/software/files/staging-commit-message.py
- mode: 755
+
+{{ dirs.bin }}/autochmod-git:
+ file.managed:
+ - source: salt://roles/salt-primary/software/files/autochmod-git.sh
+ - mode: 755
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 17:25 (20 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247848
Default Alt Text
D2973.diff (2 KB)
Attached To
Mode
D2973: Allow to restore chmod on shared deployment Git directories
Attached
Detach File
Event Timeline
Log In to Comment