Skip to content

Commit cb52f2c

Browse files
jakubgsjorge-campo
authored andcommitted
ci: add Jenkinsfile, requirements.txt and redirect
This adds CI builds for both main branches: * `develop` built by [CI job](https://ci.status.im/job/website/job/dev-help.status.im/) to publish to https://dev-help.status.im/ * `master` built by [CI job](https://ci.status.im/job/website/job/help.status.im/) to publish to https://help.status.im/ Changes should be made against `develop` and then once ready `master` should be rebased on `develop` to push the changes to the main site. Related: status-im/infra-misc@305f9445 Resolves: #27 Signed-off-by: Jakub Sokołowski <jakub@status.im>
1 parent 4aac283 commit cb52f2c

File tree

11 files changed

+98
-27
lines changed

11 files changed

+98
-27
lines changed

.github/workflows/ghpci.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
2+
.venv
23
generated

Jenkinsfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
pipeline {
2+
agent {
3+
label 'linux'
4+
}
5+
6+
options {
7+
disableConcurrentBuilds()
8+
/* manage how many builds we keep */
9+
buildDiscarder(logRotator(
10+
numToKeepStr: '20',
11+
daysToKeepStr: '30',
12+
))
13+
}
14+
15+
environment {
16+
GIT_COMMITTER_NAME = 'status-im-auto'
17+
GIT_COMMITTER_EMAIL = 'auto@status.im'
18+
/* dev page settings */
19+
DEV_SITE = 'dev-help.status.im'
20+
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
21+
SCP_OPTS = 'StrictHostKeyChecking=no'
22+
}
23+
24+
stages {
25+
stage('Deps') {
26+
steps {
27+
sh "pip install --user -r requirements.txt"
28+
}
29+
}
30+
31+
stage('Build') {
32+
steps {
33+
sh "python -m mkdocs build -f config/en/mkdocs.yml"
34+
sh "python -m mkdocs build -f config/style-guide/mkdocs.yml"
35+
/* Temporary solution for lack of start page. */
36+
sh "cp overrides/static/* generated/"
37+
echo "${GIT_BRANCH}"
38+
}
39+
}
40+
41+
stage('Publish Prod') {
42+
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
43+
steps {
44+
sshagent(credentials: ['status-im-auto-ssh']) {
45+
sh "ghp-import -p generated"
46+
}
47+
}
48+
}
49+
50+
stage('Publish Devel') {
51+
when { expression { !(env.GIT_BRANCH ==~ /.*master/) } }
52+
steps {
53+
sshagent(credentials: ['jenkins-ssh']) {
54+
sh """
55+
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete generated/. \
56+
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
57+
"""
58+
}
59+
}
60+
}
61+
}
62+
}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ For more complex contributions, you can [open an issue](https://github.com/statu
3030

3131
If you're looking for a way to contribute, you can scan through [our existing issues](https://github.com/status-im/help.status.im/issues) for something to work on. When ready, check our [contributing guide](https://github.com/status-im/help.status.im/blob/master/CONTRIBUTING.md) for detailed instructions.
3232

33+
## Continuous Integration
34+
35+
Two branches are built by [our Jenkins instance](https://ci.status.im/):
36+
37+
* `master` is deployed to https://help.status.im/ by [CI](https://ci.status.im/job/website/job/help.status.im/)
38+
* `develop` is deployed to https://dev-help.status.im/ by [CI](https://ci.status.im/job/website/job/dev-help.status.im/)
39+
40+
PRs should be made for `develop` branch and `master` should be [rebased](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) on `develop` once changes are verified.
41+
3342
## License
3443

3544
The Status user documentation is licensed under the MIT license. The Material for MkDocs components of our documentation are licensed under the [Material for MkDocs license](https://github.com/squidfunk/mkdocs-material/blob/master/LICENSE).

config/en/mkdocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ site_dir: '../../generated/en/'
1313
# Repository
1414
repo_name: 'Status Help'
1515
repo_url: https://github.com/status-im/help.status.im
16-
edit_uri: edit/master/docs/en
16+
edit_uri: edit/develop/docs/en
1717

1818
# Copyright
1919
copyright: 'Status Research & Development GmbH'
@@ -83,7 +83,6 @@ markdown_extensions:
8383
- pymdownx.tabbed:
8484
alternate_style: true
8585
- abbr
86-
- pymdownx.snippets
8786
- pymdownx.emoji:
8887
emoji_index: !!python/name:materialx.emoji.twemoji
8988
emoji_generator: !!python/name:materialx.emoji.to_svg

config/style-guide/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ site_dir: '../../generated/style-guide/'
1313
# Repository
1414
repo_name: 'Status Help'
1515
repo_url: https://github.com/status-im/help.status.im
16-
edit_uri: edit/master/docs/style-guide
16+
edit_uri: edit/develop/docs/style-guide
1717

1818
# Copyright
1919
copyright: 'Status Research & Development GmbH'
@@ -140,4 +140,4 @@ nav:
140140
- Welcome: index.md
141141
- Style guidelines: style-guidelines.md
142142
- Structuring the content: structuring-the-content.md
143-
- Style conventions: style-conventions.md
143+
- Style conventions: style-conventions.md

includes/urls-en.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[download-status-for-linux]: /help.status.im/getting-started/download-status-for-linux
2-
[download-status-for-mac]: /help.status.im/getting-started/download-status-for-mac
3-
[run-status-app-first-time]: /help.status.im/getting-started/run-status-app-first-time
1+
[download-status-for-linux]: /en/getting-started/download-status-for-linux
2+
[download-status-for-mac]: /en/getting-started/download-status-for-mac
3+
[run-status-app-first-time]: /en/getting-started/run-status-app-first-time
44

55
[gnu-privacy-guard]: https://gnupg.org/
6-
[status-web-download]: https://status.im/get
6+
[status-web-download]: https://status.im/get

overrides/static/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
help.status.im

overrides/static/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5+
<meta http-equiv="refresh" content="0; url=/en/" />
6+
<title>Status Help Redirect</title>
7+
</head>
8+
<body>
9+
If you are not redirected automatically, follow <a href="/en/">this link</a>.
10+
</body>
11+
</html>

overrides/static/robots.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
User-agent: *

0 commit comments

Comments
 (0)