Skip to content

feat: test

feat: test #5

name: Chef_install_test
on:
workflow_dispatch:
# schedule:
# Scheduled to run at 6 a.m on mondays.
#- cron: "0 6 * * 1"
push:
jobs:
chef-install:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up and execute Chef installation
run: |
set -e # Exit immediately if a command exits with a non-zero status
# Download and install Cinc (Chef)
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash
# Download and unpack newrelic-install cookbook
wget https://supermarket.chef.io/cookbooks/newrelic-install/download -O newrelic-install.tar.gz
mkdir cookbooks
tar -xzf newrelic-install.tar.gz -C cookbooks/.
# Execute newrelic install
sudo chef-client --local-mode --runlist 'recipe[newrelic-install::default]'
- name: Check for successful installation
run: |
if grep -qE "Agent Control\s*\(installed\)" output.log; then
echo "Installation successful: Agent Control is installed."
else
echo "Installation failed: Agent Control is not installed."
exit 1
fi
# notify-failure:
# if: ${{ always() && failure() }}
# needs: [puppet-install]
# runs-on: ubuntu-latest
# steps:
# - name: Notify failure via Slack
# uses: slackapi/slack-github-action@v1.22.0
# with:
# payload: |
# {
# "text": ":warning: [Puppet installation workflow failed] @hero check <${{ env.GITHUB_JOB_URL }}>"
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.AC_SLACK_WEBHOOK }}
# GITHUB_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}