-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e801dc9
commit 9afc6d7
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
# | ||
|
||
dependencies: | ||
cache_directories: | ||
- "~/.apt-cache" | ||
pre: | ||
- sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial | ||
|
||
apt-run: &apt-install | ||
name: install system packages | ||
command: | | ||
sudo apt update -qq | ||
sudo apt install -y python-pip | ||
version: 2.1 | ||
|
||
executors: | ||
content-executor: | ||
docker: | ||
- image: circleci/python:2.7.13 | ||
working_directory: ~/repo | ||
|
||
jobs: | ||
validate-content: | ||
executor: content-executor | ||
steps: | ||
- run: | ||
name: checkout repo | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "" ]; then | ||
git clone https://${GITHUB_TOKEN}@github.com/guilhemmarchand/TA-kafka-streaming-platform | ||
else | ||
git clone --branch ${CIRCLE_BRANCH} https://${GITHUB_TOKEN}@github.com/guilhemmarchand/TA-kafka-streaming-platform | ||
fi | ||
- restore_cache: | ||
key: deps1-{{ .Branch }}-{{ checksum "TA-kafka-streaming-platform/TA-kafka-streaming-platform/default/app.conf" }} | ||
- run: *apt-install | ||
- run: | ||
name: grab appinspect | ||
command: | | ||
curl -Ls http://dev.splunk.com/goto/appinspectdownload -o appinspect-lastest.tar.gz | ||
mkdir appinspect-latest | ||
tar -zxvf appinspect-lastest.tar.gz -C appinspect-latest --strip-components=1 | ||
- run: | ||
name: install appinspect | ||
command: | | ||
cd appinspect-latest | ||
rm -rf venv | ||
sudo pip install --upgrade pip setuptools | ||
sudo pip install virtualenv | ||
virtualenv --clear venv | ||
source venv/bin/activate | ||
pip install . | ||
- run: | ||
name: run appinspect | ||
command: | | ||
cd TA-kafka-streaming-platform | ||
rm -rf TA-kafka-streaming-platform/.git | ||
rm -rf TA-kafka-streaming-platform/.circleci | ||
rm -rf TA-kafka-streaming-platform/.gitignore | ||
tar -zcvf TA-kafka-streaming-platform.tar.gz TA-kafka-streaming-platform | ||
mkdir dist | ||
cp TA-kafka-streaming-platform.tar.gz dist/ | ||
cd ../ | ||
cd appinspect-latest | ||
pwd | ||
ls -ltr | ||
source venv/bin/activate | ||
splunk-appinspect inspect ../TA-kafka-streaming-platform/TA-kafka-streaming-platform.tar.gz --included-tags=cloud | ||
- save_cache: | ||
key: deps1-{{ .Branch }}-{{ checksum "TA-kafka-streaming-platform/TA-kafka-streaming-platform/default/app.conf" }} | ||
paths: | ||
- "venv" | ||
- persist_to_workspace: | ||
root: TA-kafka-streaming-platform/dist/ | ||
paths: | ||
- TA-kafka-streaming-platform.tar.gz | ||
publish-github-release: | ||
docker: | ||
- image: cibuilds/github:0.10 | ||
steps: | ||
- attach_workspace: | ||
at: ~/TA-kafka-streaming-platform/dist/TA-kafka-streaming-platform.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-kafka-streaming-platform/dist/TA-kafka-streaming-platform.tar.gz | ||
workflows: | ||
version: 2.1 | ||
validate-and-build: | ||
jobs: | ||
- validate-content: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- publish-github-release: | ||
requires: | ||
- validate-content | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters