Skip to content
Snippets Groups Projects
Commit 1b48b664 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Merge branch 'master' into 'add-runner'

# Conflicts:
#   .gitlab-ci.yml
parents 3270b426 169254f7
No related branches found
No related tags found
1 merge request!45WIP: Add Runner in the website
pages/*
public/
image: registry.gitlab.com/gitlab-org/gitlab-build-images:doc-gitlab-com
 
variables:
SITE_PATH: "public/"
PROGRESS: "1"
 
pages:
stage: deploy
environment:
name: production
script:
- ruby -v
- ruby generate.rb
# Symlink all README.html to index.html for backwards compatibility. The site
# was deployed in a VPS and served by NGINX.
- find public -type d -name 'README.html' -not -path public | xargs -I{} ln -s README.html "{}/index.html"
- for i in `find public -name README.html`; do ln -sf README.html $(dirname $i)/index.html; done
artifacts:
paths:
- public/
only:
- master
- master
\ No newline at end of file
# Introduction
## Introduction
 
[Doc-gitlab-com](https://gitlab.com/gitlab-com/doc-gitlab-com/) generates html pages for the [GitLab documentation website](https://docs.gitlab.com/). The documentation is generated from the markdown files in /doc directory of the GitLab repo's. The conversion from markdown into html is done with [Pandoc](http://johnmacfarlane.net/pandoc/).
[Doc-gitlab-com](https://gitlab.com/gitlab-com/doc-gitlab-com/) generates HTML
pages for the [GitLab documentation website](https://docs.gitlab.com/). The
documentation is generated from the Markdown files in the `/doc` directory of
the GitLab repos. The conversion from Markdown into HTML is done with
[Pandoc](http://johnmacfarlane.net/pandoc/).
 
If you want to contribute with documentation, please add them to the corresponding project:
If you want to contribute with documentation, please add them to the
corresponding project:
 
+ [GitLab CE](https://gitlab.com/gitlab-org/gitlab-ce/)
+ [GitLab EE](https://gitlab.com/gitlab-org/gitlab-ee/)
 
And follow the [contributing guidelines](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#merge-request-guidelines) and [documentation styleguides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) of each project.
And follow the [contributing guidelines][contributing] and
[documentation styleguide][doc-styleguide] of each project.
 
# Testing
## Requirements
 
Please replace sytse with your username.
Only 2 requirements:
 
```bash
ssh sytse@doc.gitlab.com
sudo su
cd /root/doc-gitlab-com && git pull && ./generate.rb no-clone && service nginx restart
```
- Ruby
- Pandoc
 
or to also update the repo's
No version restrictions, although you'd probably be better off using the
latest of both.
 
```bash
cd /root/doc-gitlab-com && git pull && ./generate.rb && service nginx restart
```
## Generation
To build the documentation website we use the `generate.rb` script which:
1. Clones the respective repositories in `/tmp/gitlab/`.
1. Uses pandoc to create HTML documents from Markdown using `template.html` as
a template.
1. Copies the stylesheets and the index page.
By default, the site is built in the `public/` directory inside the root
directory of this project. You can override this using the `SITE_PATH`
environment variable.
No console output will be created by default during the build process. If you
want to see progress indicators, set the `PROGRESS` environment variable:
 
# Restrictions
+ All files should be in a doc/something directory, not any deeper.
+ Only png image files are supported.
# Installation
Login as **root** and execute the following commands:
```bash
apt-get update
apt-get upgrade
apt-get remove pandoc # Pandoc 1.9.1 doesn't support pipe tables.
apt-get install haskell-platform
cabal update
cabal install pandoc --ghc-options="-O0"
ln -s /root/.cabal/bin/pandoc /usr/bin/pandoc
cd /root
git clone https://gitlab.com/gitlab-com/doc-gitlab-com.git
ln -s /root/doc-gitlab-com/nginx /etc/nginx/sites-available/doc-gitlab-com
ln -s /etc/nginx/sites-available/doc-gitlab-com /etc/nginx/sites-enabled/doc-gitlab-com
rm /etc/nginx/sites-enabled/default
service nginx start
crontab -e
20 */2 * * * /root/doc-gitlab-com/generate.rb
```
PROGRESS=1 ./generate.rb
```
## Restrictions
- Only png image files are supported.
## Deployment process
We use [GitLab Pages][pages] to build and host this website. You can see
`.gitlab-ci.yml` for more information.
A [job] is used to trigger a new build whenever tests run and pass on master
branch of CE.
 
Do not forget to add the public ssh key of the server `ssh-keygen` as a deploy key to any non-public repositories in generate.rb.
[contributing]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#merge-request-guidelines
[doc-styleguide]: https://docs.gitlab.com/ce/development/doc_styleguide.html
[job]: https://gitlab.com/gitlab-org/gitlab-ce/blob/2c00d00ec1c39dbea0e0e54265027b5476b78e3c/.gitlab-ci.yml#L308-318
[pages]: https://pages.gitlab.io
#!/usr/bin/ruby
# Generates the html documentation from the markdown files in the GitLab repo.
# Call with no-clone to skip the timeconsuming closing process.
# By default, the site is built in /srv/doc-gitlab-com. This location can be
# Call with no-clone to skip the time consuming cloning process.
# By default, the site is built in ./public. This location can be
# overridden with the SITE_PATH environment variable.
#
# By default, this script will not create console output. If you want to see
Loading
Loading
@@ -26,7 +26,7 @@ def main
}
 
repo_path = File.expand_path('..', __FILE__)
site_path = ENV['SITE_PATH'] || '/srv/doc-gitlab-com'
site_path = ENV['SITE_PATH'] || './public'
 
repos.each do |relative_path, clone_url|
 
Loading
Loading
@@ -122,6 +122,12 @@ def main
FileUtils.rm_rf(site_stylesheets_path) if File.exist?(site_stylesheets_path)
FileUtils.cp_r(repo_stylesheets_path, site_stylesheets_path)
 
$progress.puts 'Generating javascripts'
repo_javascripts_path = File.join(repo_path, 'javascripts')
site_javascripts_path = File.join(site_path, 'javascripts')
FileUtils.rm_rf(site_javascripts_path) if File.exist?(site_javascripts_path)
FileUtils.cp_r(repo_javascripts_path, site_javascripts_path)
$progress.puts 'Generating favicon'
repo_favicon_path = File.join(repo_path, 'favicon.ico')
site_favicon_path = File.join(site_path, 'favicon.ico')
Loading
Loading
Loading
Loading
@@ -79,7 +79,7 @@
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
})(window,document,'script','/javascripts/swiftype/st.js','_st');
 
_st('install','sSywtTjozQxL11PWiwA7','2.0.0');
</script>
Loading
Loading
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment