Skip to content

Commit

Permalink
Merge pull request #39 from guilhemmarchand/testing
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
guilhemmarchand committed Aug 6, 2021
2 parents 261f171 + bdb4336 commit 7937071
Show file tree
Hide file tree
Showing 1,764 changed files with 945 additions and 459,228 deletions.
53 changes: 32 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ executors:
docker:
- image: cimg/base:stable
auth:
username: $DOCKERHUB_LOGIN # can specify string literal values
password: $DOCKERHUB_TOKEN # or project environment variable reference
username: $DOCKERHUB_LOGIN # can specify string literal values
password: $DOCKERHUB_TOKEN # or project environment variable reference
working_directory: ~/repo

jobs:
splunk-appinspect:
executor: content-executor
steps:
- run:
name: checkout repo
name: install ucc-gen and dependencies
command: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install --no-input splunk-add-on-ucc-framework
- run:
name: checkout Git repository
command: |
if [ "${CIRCLE_BRANCH}" == "" ]; then
git clone https://${GITHUB_TOKEN}@github.com/guilhemmarchand/TA-ms-teams-alert-action
Expand All @@ -29,51 +35,56 @@ jobs:
- run:
name: checkout Splunk Appinspect shell executor
command: |
git clone https://github.com/guilhemmarchand/splunk-appinspect-pipeline.git
git clone https://github.com/guilhemmarchand/splunk-appinspect-pipeline.git
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "TA-ms-teams-alert-action/TA-ms-teams-alert-action/default/app.conf" }}
key: deps1-{{ .Branch }}-{{ checksum "TA-ms-teams-alert-action/package/default/app.conf" }}
- run:
name: run appinspect API app vetting
command: |
cd TA-ms-teams-alert-action
rm -rf TA-ms-teams-alert-action/.git
rm -rf TA-ms-teams-alert-action/.circleci
rm -rf TA-ms-teams-alert-action/.gitignore
tar -zcf TA-ms-teams-alert-action.tar.gz TA-ms-teams-alert-action
mkdir dist
cp TA-ms-teams-alert-action.tar.gz dist/
cd ../
splunk-appinspect-pipeline/appinspect_vetting.sh --username=$SPLUNK_BASE_LOGIN --password=$SPLUNK_BASE_PASSWD --app=TA-ms-teams-alert-action/dist/TA-ms-teams-alert-action.tar.gz --included_tags=splunk_appinspect --excluded_tags=manual --excluded_checks=check_indexes_conf_does_not_exist --html_report_out=/tmp/appinspect_report.html
OUTDIR="output"
app="TA-ms-teams-alert-action"
version=$(grep 'version =' version.txt | head -1 | awk '{print $3}' | sed 's/\.//g')
ta_version=$(grep 'version =' version.txt | head -1 | awk '{print $3}')
ucc-gen --ta-version "$ta_version"
cd "${OUTDIR}"
find . -name "*.pyc" -type f -exec rm -f {} \;
tar -czf ${app}.tgz ${app}
echo "Wrote: ${app}.tgz"
mkdir $HOME/dist
mv ${app}.tgz $HOME/dist/
cd $HOME
$HOME/repo/splunk-appinspect-pipeline/appinspect_vetting.sh --username=$SPLUNK_BASE_LOGIN --password=$SPLUNK_BASE_PASSWD --app=$HOME/dist/${app}.tgz --included_tags=splunk_appinspect --excluded_tags=manual --excluded_checks=check_indexes_conf_does_not_exist --html_report_out=/tmp/appinspect_report.html
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "TA-ms-teams-alert-action/TA-ms-teams-alert-action/default/app.conf" }}
key: deps1-{{ .Branch }}-{{ checksum "TA-ms-teams-alert-action/package/default/app.conf" }}
paths:
- "venv"
- persist_to_workspace:
root: TA-ms-teams-alert-action/dist/
root: /home/circleci/dist
paths:
- TA-ms-teams-alert-action.tar.gz
- TA-ms-teams-alert-action.tgz
- store_artifacts:
path: /tmp/appinspect_report.html
destination: appinspect-report
publish-github-release:
docker:
- image: cibuilds/github:latest
auth:
username: $DOCKERHUB_LOGIN # can specify string literal values
password: $DOCKERHUB_TOKEN # or project environment variable reference
username: $DOCKERHUB_LOGIN # can specify string literal values
password: $DOCKERHUB_TOKEN # or project environment variable reference
steps:
- attach_workspace:
at: ~/TA-ms-teams-alert-action/dist/TA-ms-teams-alert-action.tar.gz
at: ~/dist/TA-ms-teams-alert-action.tar.gz
- run:
name: publish release on github
command: |
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ~/TA-ms-teams-alert-action/dist/TA-ms-teams-alert-action.tar.gz
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ~/dist/TA-ms-teams-alert-action.tar.gz
workflows:
version: 2.1
validate-and-build:
jobs:
- splunk-appinspect:
context:
context:
- docker-hub-creds
- splunk-base-creds
filters:
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,17 @@ appinspect_report*.html
build/*.tgz
build/release-sha256.txt

# build
build/*.tgz
build/release-sha256.txt

# output
output/*
!output/README.txt

# Python pickle
*.pickle


# Python pickle
*.pickle
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Microsoft Teams alert action for Splunk

| branch | build status |
| --- | --- |
| master | [![master status](https://circleci.com/gh/guilhemmarchand/TA-ms-teams-alert-action/tree/master.svg?style=svg)](https://circleci.com/gh/guilhemmarchand/TA-ms-teams-alert-action/tree/master)
| branch | build status |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| master | [![master status](https://circleci.com/gh/guilhemmarchand/TA-ms-teams-alert-action/tree/master.svg?style=svg)](https://circleci.com/gh/guilhemmarchand/TA-ms-teams-alert-action/tree/master) |

**This application provides alert actions for Microsoft Teams messages publication to allows advanced messages publication from Splunk, including:**

Expand All @@ -18,8 +18,8 @@ https://TA-ms-teams-alert-action.readthedocs.io

![screenshot](./docs/img/overview.png)

![screenshot1](./TA-ms-teams-alert-action/appserver/static/screenshot1.png)
![screenshot1](./package/appserver/static/screenshot1.png)

![screenshot2](./TA-ms-teams-alert-action/appserver/static/screenshot2.png)
![screenshot2](./package/appserver/static/screenshot2.png)

![screenshot3](./TA-ms-teams-alert-action/appserver/static/screenshot3.png)
![screenshot3](./package/appserver/static/screenshot3.png)
4 changes: 0 additions & 4 deletions TA-ms-teams-alert-action/README/addon_builder.conf.spec

This file was deleted.

29 changes: 0 additions & 29 deletions TA-ms-teams-alert-action/README/alert_actions.conf.spec

This file was deleted.

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 7937071

Please sign in to comment.