Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
test: updated review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devangmehta-crest committed Feb 12, 2021
1 parent 872326d commit 953e570
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sc4s_matrix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check Package Version
on:
schedule:
- cron: "0 22 * * SAT"
- cron: "0 15 * * SAT"

jobs:
build:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
- name: Run Test
- name: Update SC4S Version
env:
GITHUB_USER: ${{ secrets.GH_USER }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/splunk_matrix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check Package Version
on:
schedule:
- cron: "0 22 * * SUN"
- cron: "0 15 * * SUN"

jobs:
build:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
- name: Run Test
- name: Update Splunk Builds
env:
GITHUB_USER: ${{ secrets.GH_USER }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions sc4s_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ if [[ $GITHUB_USER && ${GITHUB_USER-x} ]]
then
echo "GITHUB_USER Found"
else
echo "GITHUB_USER Not found"
echo "GITHUB_USER Not Found"
exit 1
fi
if [[ $GITHUB_TOKEN && ${GITHUB_TOKEN-x} ]]
then
echo "GITHUB_TOKEN Found"
else
echo "GITHUB_TOKEN Not found"
echo "GITHUB_TOKEN Not Found"
exit 1
fi

Expand All @@ -25,18 +25,16 @@ latest_tag=$(curl -s https://api.github.com/repos/splunk/splunk-connect-for-sysl
new_value=$(echo $latest_tag | rev | cut -c3- | rev)
new_value=$(echo $new_value | cut -c3-)
echo $new_value
sudo apt-get install -y python3 python3.7 python3-pip

pip install pip --upgrade
python -m pip install packaging

git checkout test/version-change
var=`python -c "from packaging import version; print('True' if(version.parse(str('$new_value')) > version.parse(str('$current_tag'))) else 'False')"`
echo $var

if [ "$var" = "True" ];
then

# Logic for to raise pull request
git config --global user.email "addonfactory@splunk.com"
git config --global user.name "Addon Factory template"
BRANCH=test/sc4s-version-update
Expand All @@ -45,11 +43,13 @@ then
git diff
git add SC4S_matrix.conf
git status
git commit -m "test: updated new $new_value version to matrix file"
git commit -m "test: new sc4s version $new_value update"
git push -f --set-upstream origin $BRANCH
git log | head
git checkout master
git merge test/sc4s-version-update
git push origin master
git branch -d test/sc4s-version-update
else
echo "Latest $new_value version is only available in Matrix"
echo "SC4S version update not required"
fi
15 changes: 6 additions & 9 deletions splunk_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,38 @@ if [[ $GITHUB_USER && ${GITHUB_USER-x} ]]
then
echo "GITHUB_USER Found"
else
echo "GITHUB_USER Not found"
echo "GITHUB_USER Not Found"
exit 1
fi
if [[ $GITHUB_TOKEN && ${GITHUB_TOKEN-x} ]]
then
echo "GITHUB_TOKEN Found"
else
echo "GITHUB_TOKEN Not found"
echo "GITHUB_TOKEN Not Found"
exit 1
fi

sudo apt-get install -y python3 python3.7 python3-pip
pip install pip --upgrade

git checkout test/version-change

python -m pip install -r requirements.txt
splunk_version=$(python splunk_matrix_update.py)
echo $splunk_version

if [ "$splunk_version" = "True" ];
then

# Logic for to raise pull request
git config --global user.email "addonfactory@splunk.com"
git config --global user.name "Addon Factory template"
BRANCH=test/splunk-version-update
git checkout -b $BRANCH
git diff
git add .
git status
git commit -m "test: updated new Splunk version to matrix file"
git commit -m "test: splunk build update"
git push -f --set-upstream origin $BRANCH
git checkout master
git merge test/splunk-version-update
git push origin master
git branch -d test/splunk-version-update
else
echo "Latest Splunk version is only available in Matrix"
echo "Splunk build update not required"
fi

0 comments on commit 953e570

Please sign in to comment.