Skip to content

Commit c3b8f27

Browse files
Bootstrap a StackStorm Exchange pack repository for pack cisco_ise.
0 parents  commit c3b8f27

File tree

3 files changed

+234
-0
lines changed

3 files changed

+234
-0
lines changed

.circleci/config.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# WARNING: Minimize edits to this file!
2+
#
3+
# This file is part of the CI infrastructure for the StackStorm-Exchange.
4+
# As such, it gets overwritten periodically in CI infrastructure updates.
5+
# Check out `tests/setup_testing_env.sh` for how to customize the test env.
6+
# If you need to add jobs, docker images, or other changes that do not work
7+
# in `tests/setup_testing_env.sh`, then please add what you need and avoid
8+
# changing the standard build_and_test and deploy jobs.
9+
#
10+
# Thanks for your contribution!
11+
---
12+
version: 2
13+
14+
jobs:
15+
build_and_test_python36:
16+
docker:
17+
- image: circleci/python:3.6
18+
- image: rabbitmq:3
19+
- image: mongo:3.4
20+
21+
working_directory: ~/repo
22+
23+
environment:
24+
VIRTUALENV_DIR: "~/virtualenv"
25+
# Don't install various StackStorm dependencies which are already
26+
# installed by CI again in the various check scripts
27+
ST2_INSTALL_DEPS: "0"
28+
29+
steps:
30+
- checkout
31+
- restore_cache:
32+
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
33+
- run:
34+
name: Download dependencies
35+
# NOTE: We don't want to use default "-e" option because this means
36+
# step will fail immediately on one of the commands failures and we
37+
# can't intercept the error and cause non-fatal exit in case pack
38+
# doesn't declare support for Python 3
39+
shell: /bin/bash
40+
command: |
41+
git clone -b master git://github.com/stackstorm-exchange/ci.git ~/ci
42+
~/ci/.circle/dependencies ; ~/ci/.circle/exit_on_py3_checks $?
43+
- run:
44+
name: Run tests (Python 3.6)
45+
# NOTE: We don't want to use default "-e" option because this means
46+
# step will fail immediately on one of the commands failures and we
47+
# can't intercept the error and cause non-fatal exit in case pack
48+
# doesn't declare support for Python 3
49+
shell: /bin/bash
50+
command: ~/ci/.circle/test ; ~/ci/.circle/exit_on_py3_checks $?
51+
- save_cache:
52+
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
53+
paths:
54+
- ~/.cache/pip
55+
- ~/.apt-cache
56+
# NOTE: We use virtualenv files from Python 3.6 step in "deploy" job so we
57+
# only persist paths from this job
58+
- persist_to_workspace:
59+
root: /
60+
paths:
61+
- home/circleci/ci
62+
- home/circleci/virtualenv
63+
- tmp/st2
64+
- home/circleci/repo
65+
- home/circleci/.gitconfig
66+
67+
68+
deploy:
69+
docker:
70+
- image: circleci/python:3.6
71+
72+
working_directory: ~/repo
73+
74+
environment:
75+
VIRTUALENV_DIR: "~/virtualenv"
76+
77+
steps:
78+
- checkout
79+
- restore_cache:
80+
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
81+
- attach_workspace:
82+
at: /
83+
- run:
84+
name: Install dependencies
85+
command: |
86+
sudo apt-get update
87+
sudo apt -y install gmic optipng
88+
~/ci/.circle/install_gh
89+
- run:
90+
# NOTE: We try to retry the script up to 5 times if it fails. The command could fail due
91+
# to the race (e.g. we try to push changes to index, but index has been updated by some
92+
# other pack in the mean time)
93+
name: Update exchange.stackstorm.org
94+
command: ~/ci/.circle/retry_on_failure.sh ~/ci/.circle/deployment
95+
96+
workflows:
97+
version: 2
98+
# Workflow which runs on each push
99+
build_test_deploy_on_push:
100+
jobs:
101+
- build_and_test_python36
102+
- deploy:
103+
requires:
104+
- build_and_test_python36
105+
filters:
106+
branches:
107+
only: master
108+
build_test_weekly:
109+
jobs:
110+
- build_and_test_python36
111+
# Workflow which runs nightly - note we don't perform deploy job on nightly
112+
# build
113+
triggers:
114+
# Run nightly build for the pack
115+
- schedule:
116+
# NOTE: We run it at 1 am UTC on every Sunday
117+
cron: "0 1 * * 0"
118+
filters:
119+
branches:
120+
only:
121+
- master

.gitignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
./lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
48+
# Translations
49+
*.mo
50+
*.pot
51+
52+
# Django stuff:
53+
*.log
54+
local_settings.py
55+
56+
# Flask stuff:
57+
instance/
58+
.webassets-cache
59+
60+
# Scrapy stuff:
61+
.scrapy
62+
63+
# Sphinx documentation
64+
docs/_build/
65+
66+
# PyBuilder
67+
target/
68+
69+
# IPython Notebook
70+
.ipynb_checkpoints
71+
72+
# pyenv
73+
.python-version
74+
75+
# celery beat schedule file
76+
celerybeat-schedule
77+
78+
# dotenv
79+
.env
80+
81+
# virtualenv
82+
venv/
83+
ENV/
84+
85+
# Spyder project settings
86+
.spyderproject
87+
88+
# Rope project settings
89+
.ropeproject
90+
91+
# Mr Developer
92+
.idea
93+
.DS_Store
94+
._*
95+
.vscode
96+
*.sublime-project
97+
*.sublime-workspace# PyCharm
98+
.idea

tests/setup_testing_env.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# For python deps, please use requirements.txt or requirements-test.txt.
4+
# Do not install python requirements with this script.
5+
6+
# Some packs need to install and configure additional packages to properly
7+
# run their test suite. Other packs need to clone other repositories to
8+
# reuse standardized testing infrastructure. And other functional or end-to-end
9+
# tests might need additional system setup to access external APIs via
10+
# an enterprise bus or something else.
11+
# That is the purpose of this script. Setup the testing environment
12+
# to do mock-less regression or end-to-end testing.
13+
14+
# This script is called by `deployment` housed in StackStorm-exchange/ci.
15+
# `deployment` will only run this script if it is executable.

0 commit comments

Comments
 (0)