Skip to content

Commit b1b6bdb

Browse files
committed
Add redirects functionality to circle build
1 parent 2eb64c7 commit b1b6bdb

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.circleci/config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ jobs:
6161
source /tmp/env
6262
docbuilder publish /tmp/workspace/artifacts/$CIRCLE_BRANCH_NO_SLASH iot-doc-builds $CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH_NO_SLASH/$CIRCLE_SHA1
6363
64+
push_redirects_to_s3:
65+
executor: doc_builder
66+
steps:
67+
- checkout
68+
- setup_aws_credentials
69+
- write_env_variables
70+
- *attach_workspace
71+
- run:
72+
name: Upload redirects.json to s3
73+
command: |
74+
source /tmp/env
75+
docbuilder upload_file ~/project/redirects.json iot-doc-builds $CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH_NO_SLASH/redirects.json
76+
6477
zip_documentation:
6578
machine: true
6679
steps:
@@ -73,6 +86,18 @@ jobs:
7386
- store_artifacts:
7487
path: /tmp/workspace/docs.zip
7588

89+
list_pages:
90+
machine: true
91+
steps:
92+
- write_env_variables
93+
- *attach_workspace
94+
- run:
95+
name: List all built docs pages
96+
command: |
97+
source /tmp/env
98+
cd /tmp/workspace/artifacts/$CIRCLE_BRANCH_NO_SLASH
99+
find -maxdepth 2 -type f -name '*.html' -printf '%P\n'
100+
76101
make_live:
77102
executor: doc_builder
78103
steps:
@@ -92,9 +117,15 @@ workflows:
92117
- publish_to_s3:
93118
requires:
94119
- build
120+
- push_redirects_to_s3:
121+
requires:
122+
- build
95123
- zip_documentation:
96124
requires:
97125
- build
126+
- list_pages:
127+
requires:
128+
- build
98129
# - await_approval:
99130
# type: approval
100131
# requires:

redirects.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}

0 commit comments

Comments
 (0)