Skip to content

Commit 1dfd9e3

Browse files
committed
Bootstrap a StackStorm Exchange pack repository for pack sql.
0 parents  commit 1dfd9e3

File tree

2 files changed

+241
-0
lines changed

2 files changed

+241
-0
lines changed

.circleci/config.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
version: 2
2+
3+
jobs:
4+
build_and_test_python27:
5+
docker:
6+
- image: circleci/python:2.7
7+
- image: rabbitmq:3
8+
- image: mongo:3.4
9+
10+
working_directory: ~/repo
11+
12+
environment:
13+
VIRTUALENV_DIR: "~/virtualenv"
14+
# Don't install various StackStorm dependencies which are already
15+
# installed by CI again in the various check scripts
16+
ST2_INSTALL_DEPS: "0"
17+
18+
steps:
19+
- checkout
20+
- restore_cache:
21+
key: v1-dependency-cache-py27-{{ checksum "requirements.txt" }}
22+
- run:
23+
name: Download dependencies
24+
command: |
25+
git clone -b master git://github.com/stackstorm-exchange/ci.git ~/ci
26+
~/ci/.circle/dependencies
27+
- run:
28+
name: Run tests (Python 2.7)
29+
command: ~/ci/.circle/test
30+
- save_cache:
31+
key: v1-dependency-cache-py27-{{ checksum "requirements.txt" }}
32+
paths:
33+
- ~/.cache/pip
34+
- ~/.apt-cache
35+
# NOTE: We use virtualenv files from Python 2.7 step in "deploy" job so we
36+
# only persist paths from this job
37+
- persist_to_workspace:
38+
root: /
39+
paths:
40+
- home/circleci/ci
41+
- home/circleci/virtualenv
42+
- tmp/st2
43+
- home/circleci/repo
44+
- home/circleci/.gitconfig
45+
46+
# NOTE: Until we add "python_version" metadata attribute to pack.yaml and
47+
# explicitly call which packs work with Python 3.x, Python 3.x failures are
48+
# not considered fatal
49+
build_and_test_python36:
50+
docker:
51+
- image: circleci/python:3.6
52+
- image: rabbitmq:3
53+
- image: mongo:3.4
54+
55+
working_directory: ~/repo
56+
57+
environment:
58+
VIRTUALENV_DIR: "~/virtualenv"
59+
# Don't install various StackStorm dependencies which are already
60+
# installed by CI again in the various check scripts
61+
ST2_INSTALL_DEPS: "0"
62+
63+
steps:
64+
- checkout
65+
- restore_cache:
66+
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
67+
- run:
68+
name: Download dependencies
69+
# NOTE: We don't want to use default "-e" option because this means
70+
# step will fail immediately on one of the commands failures and we
71+
# can't intercept the error and cause non-fatal exit in case pack
72+
# doesn't declare support for Python 3
73+
shell: /bin/bash
74+
command: |
75+
git clone -b master git://github.com/stackstorm-exchange/ci.git ~/ci
76+
~/ci/.circle/dependencies ; ~/ci/.circle/exit_on_py3_checks $?
77+
- run:
78+
name: Run tests (Python 3.6)
79+
# NOTE: We don't want to use default "-e" option because this means
80+
# step will fail immediately on one of the commands failures and we
81+
# can't intercept the error and cause non-fatal exit in case pack
82+
# doesn't declare support for Python 3
83+
shell: /bin/bash
84+
command: ~/ci/.circle/test ; ~/ci/.circle/exit_on_py3_checks $?
85+
- save_cache:
86+
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
87+
paths:
88+
- ~/.cache/pip
89+
- ~/.apt-cache
90+
91+
deploy:
92+
docker:
93+
- image: circleci/python:2.7
94+
95+
working_directory: ~/repo
96+
97+
environment:
98+
VIRTUALENV_DIR: "~/virtualenv"
99+
100+
steps:
101+
- checkout
102+
- restore_cache:
103+
key: v1-dependency-cache-py27-{{ checksum "requirements.txt" }}
104+
- attach_workspace:
105+
at: /
106+
- run:
107+
name: Install dependencies
108+
command: sudo apt -y install gmic optipng
109+
- run:
110+
# NOTE: We try to retry the script up to 5 times if it fails. The command could fail due
111+
# to the race (e.g. we try to push changes to index, but index has been updated by some
112+
# other pack in the mean time)
113+
name: Update exchange.stackstorm.org
114+
command: ~/ci/.circle/retry_on_failure.sh ~/ci/.circle/deployment
115+
116+
workflows:
117+
version: 2
118+
# Workflow which runs on each push
119+
build_test_deploy_on_push:
120+
jobs:
121+
- build_and_test_python27
122+
- build_and_test_python36
123+
- deploy:
124+
requires:
125+
- build_and_test_python27
126+
filters:
127+
branches:
128+
only: master
129+
build_test_weekly:
130+
jobs:
131+
- build_and_test_python27
132+
- build_and_test_python36
133+
# Workflow which runs nightly - note we don't perform deploy job on nightly
134+
# build
135+
triggers:
136+
# Run nightly build for the pack
137+
- schedule:
138+
# NOTE: We run it at 1 am UTC on every Sunday
139+
cron: "0 1 * * 0"
140+
filters:
141+
branches:
142+
only:
143+
- 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

0 commit comments

Comments
 (0)