Page MenuHomeDevCentral

D2973.id7590.diff
No OneTemporary

D2973.id7590.diff

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

Mime Type
text/plain
Expires
Mon, Oct 7, 18:30 (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2180779
Default Alt Text
D2973.id7590.diff (2 KB)

Event Timeline