-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathconfig.yml
75 lines (74 loc) · 2.25 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Set ST2DOCS_BUCKET variable in CircleCI Environment
version: 2
jobs:
st2docs:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run:
name: Clone ST2
command: |
make st2
- restore_cache:
key: v2-dependency-cache-{{ checksum "st2/requirements.txt" }}
- run: sudo apt-get update
- run: sudo apt install python3-dev
- run: sudo apt install libldap2-dev
- run: sudo apt install libsasl2-dev
- run: make docs
- run:
name: Store HTML docs in workspace dir
command: mkdir /tmp/st2docs && cp -r docs/build/html/* /tmp/st2docs/
- persist_to_workspace:
root: /tmp
paths:
- st2docs
- store_artifacts:
path: /tmp/st2docs
destination: st2docs
- save_cache:
key: v2-dependency-cache-{{ checksum "st2/requirements.txt" }}
paths:
- ~/.cache/pip
deploy:
docker:
- image: cibuilds/aws:1.16.43
steps:
- attach_workspace:
at: ./generated-site
- run:
name: Deploy to docs.stackstorm.com
command: |
if [ "${CIRCLE_BRANCH}" = "master" ]; then
aws s3 sync generated-site/st2docs/ \
s3://${ST2DOCS_BUCKET}/latest
else
S3_OBJ=$(echo "${CIRCLE_BRANCH}" | sed 's/^v\(.*\)$/\1/')
aws s3 sync generated-site/st2docs/ \
s3://${ST2DOCS_BUCKET}/${S3_OBJ}
fi
- run:
# Check the install scripts to see if this is the current GA version
name: Check if current GA branch, in which case also deploy to main site
command: |
GA_VER=$(curl -sSL https://stackstorm.com/packages/install.sh|grep ^BRANCH=|sed 's/[^0-9.]*//g')
if [ "${CIRCLE_BRANCH}" = "v${GA_VER}" ]; then
aws s3 sync generated-site/st2docs/ \
s3://${ST2DOCS_BUCKET}/
else
echo "Not current GA version"
fi
workflows:
version: 2
build-deploy:
jobs:
- st2docs
- deploy:
requires:
- st2docs
filters:
branches:
only:
- master
- /v[0-9]+\.[0-9]+/