Sha256: 7731e713172e221cd17096ee4e32663d24f0f9bb24c9b560a33cece0331044e5

Contents?: true

Size: 1.75 KB

Versions: 12

Compression:

Stored size: 1.75 KB

Contents

#!/bin/sh
# 
# A script to maintain a local working copy of an oxidized configuration
# repository and mail out diffs for configuration changes
# 
# Copyright 2016 Nick Hilliard <nick@foobar.org>, All Rights Reserved
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# 20170615 - Andre Sencioles <asenci@gmail.com>
#            Removed requirement for Git working directory
#            Check job status
#
#
# usage: add the following hook to the oxidized config file:
# 
# hooks:
#  email_output:
#    type: exec
#    events: [post_store, node_fail]
#    cmd: '/home/oxidized/extra/oxidized-report-git-commits | mail -s "Oxidized updates for ${OX_NODE_NAME}" update-recipient@example.com'
#    async: true
#    timeout: 120
# 
#

echo "Node name: ${OX_NODE_NAME}"
echo "Group name: ${OX_NODE_GROUP}"
echo "Job status: ${OX_JOB_STATUS}"
echo "Job time: ${OX_JOB_TIME}"

if [ "${OX_EVENT}" = "node_fail" ]; then
    echo 'Job failed'
    exit 64
fi

if [ -z "${OX_REPO_COMMITREF}" ]; then
	echo '$OX_REPO_COMMITREF not set'
	exit 64
fi

if [ -z "${OX_REPO_NAME}" ]; then
	echo '$OX_REPO_NAME not set'
	exit 64
fi
	
echo "Git repo: ${OX_REPO_NAME}"
echo "Git commit ID: ${OX_REPO_COMMITREF}"
echo ""

git --bare --git-dir="${OX_REPO_NAME}" show --pretty='' --no-color "${OX_REPO_COMMITREF}"

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
oxidized-0.28.0 extra/oxidized-report-git-commits
oxidized-0.27.0 extra/oxidized-report-git-commits
oxidized-0.26.3 extra/oxidized-report-git-commits
oxidized-0.26.2 extra/oxidized-report-git-commits
oxidized-0.26.1 extra/oxidized-report-git-commits
oxidized-0.26.0 extra/oxidized-report-git-commits
oxidized-0.25.1 extra/oxidized-report-git-commits
oxidized-0.25.0 extra/oxidized-report-git-commits
oxidized-0.24.0 extra/oxidized-report-git-commits
oxidized-0.23.0 extra/oxidized-report-git-commits
oxidized-0.22.0 extra/oxidized-report-git-commits
oxidized-0.21.0 extra/oxidized-report-git-commits