Skip to content
Snippets Groups Projects
Commit 1dd646f1 authored by Robert Speicher's avatar Robert Speicher
Browse files

Blow up the old site :boom:

parent 0f1b0f4a
No related branches found
No related tags found
No related merge requests found
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org
root = true
; Use 2 spaces for indentation in all Ruby files
[*.rb]
indent_style = space
indent_size = 2
[Rakefile]
indent_style = space
indent_size = 2
[Gemfile*]
indent_style = space
indent_size = 2
[config.ru]
indent_style = space
indent_size = 2
* text=auto
*.md text eol=lf
.bundle
.DS_Store
.sass-cache
.gist-cache
.pygments-cache
.preview-mode
recurly/config.yml
_deploy
public
sass.old
source.old
source/_stash
source/stylesheets/screen.css
vendor
node_modules
.idea
*~
test:
script:
- pwd
- git rev-parse HEAD
- export LC_ALL=en_US.UTF-8
- ''
- bundle install --path ~/bundle
- ''
- bundle exec yaml-lint source/_data/*.yml
- ''
- "# build without deploying, so that we know if a MR is horribly broken"
- bundle exec rake build
tags:
except:
- tags
deploy:
script:
- pwd
- export LC_ALL=en_US.UTF-8
- ''
- bundle install --path ~/bundle
- bundle exec rake build
- rsync -r --delete-after public/ ~/public/
type: deploy
tags:
only:
- master
except:
- tags
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ] ; then
source "$rvm_path/scripts/rvm"
source ".rvmrc"
fi
\ No newline at end of file
plugins
sass
source
language: ruby
rvm:
- 2.0.0
- 1.9.3
script: bundle exec rake install; bundle exec rake generate
# Octopress Changelog
## 2.0
- Now based on [mojombo/jekyll](http://github.com/mojombo/jekyll)
- Sports a semantic HTML5 template
- Easy theming with Compass and Sass
- A Mobile friendly responsive (320 and up) layout
- Built in 3rd party support for Twitter, Google Plus One, Disqus Comments, Pinboard, Delicious, and Google Analytics
- Deploy to Github pages or use Rsync
- Built in support for POW and Rack servers
- Beautiful [Solarized](http://ethanschoonover.com/solarized) syntax highlighting
- Super easy setup and configuration
**New Plugins, Filters, & Generators**
- **Gist Tag** for easily embedding gists in your posts
- **Pygments Cache** makes subsequent compiling much faster
- **Include Code Tag** lets you embed external code snippets from your file system and adds a download link
- **Pullquote Tag** Generate beautiful semantic pullquotes (no double data) based on Maykel Loomans's [technique](http://miekd.com/articles/pull-quotes-with-html5-and-css/)
- **Blockquote Tag** makes it easy to semantically format blockquotes
- **Category Generator** gives you archive pages for each category
- **Sitemap.xml Generator** for search engines
## 1.0
- **No longer supported.**
- Jekyll Matured, but Henrik's Jekyll fork did not.
- Thanks for all your pull requests, I learned a lot.
You can help to improve the [about.gitlab.com](https://about.gitlab.com/) website by sending merge requests to this repository.
Thank you for your interest and help!
We don't mind people inside and outside the company making suggestions to change significant things.
Feel free to make a proposal, we can discuss anything and if we don't agree we'll feel free not to merge it and thank you for caring about it.
By submitting code as an individual you agree to the [individual contributor license agreement](doc/legal/individual_contributor_license_agreement.md).
By submitting code as an entity you agree to the [corporate contributor license agreement](doc/legal/corporate_contributor_license_agreement.md).
source "https://rubygems.org"
group :development do
gem 'rake', '~> 10.0'
gem 'jekyll', '2.4'
gem 'octopress-hooks', '~> 2.2'
gem 'octopress-date-format', '~> 2.0'
gem 'jekyll-sitemap'
gem 'rdiscount', '~> 2.0'
gem 'RedCloth', '~> 4.2.9'
gem 'haml', '~> 4.0'
gem 'compass', '~> 1.0.1'
gem 'sass-globbing', '~> 1.0.0'
gem 'rb-fsevent', '~> 0.9'
gem 'stringex', '~> 1.4.0'
end
group :test do
gem 'html-proofer'
gem 'yaml-lint'
end
gem 'sinatra', '~> 1.4.2'
gem 'yui-compressor', '~> 0.12.0'
gem 'html_compressor', '~> 0.0.3'
gem "sinatra-contrib", "~> 1.4.2"
gem 'redcarpet'
gem 'recurly', '~> 2.2.1'
gem "daemons", "~> 1.1.9"
gem 'therubyracer'
gem 'oga'
gem 'httparty'
GEM
remote: https://rubygems.org/
specs:
POpen4 (0.1.4)
Platform (>= 0.4.0)
open4
Platform (0.4.0)
RedCloth (4.2.9)
addressable (2.3.8)
ansi (1.5.0)
ast (2.2.0)
backports (3.6.4)
blankslate (2.1.2.4)
celluloid (0.16.0)
timers (~> 4.0.0)
chunky_png (1.3.4)
classifier-reborn (2.0.3)
fast-stemmer (~> 1.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
colorator (0.1)
colored (1.2)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
daemons (1.1.9)
ethon (0.7.3)
ffi (>= 1.3.0)
execjs (2.5.2)
fast-stemmer (1.0.2)
ffi (1.9.8)
haml (4.0.6)
tilt
hitimes (1.2.2)
html-proofer (2.2.0)
addressable (~> 2.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
nokogiri (~> 1.5)
parallel (~> 1.3)
typhoeus (~> 0.7)
yell (~> 2.0)
html_compressor (0.0.3)
POpen4 (>= 0.1.4)
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
jekyll (2.4.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-gist (1.2.1)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-sitemap (0.8.1)
jekyll-watch (1.2.1)
listen (~> 2.7)
json (1.8.3)
kramdown (1.7.0)
libv8 (3.16.14.11)
liquid (2.6.2)
listen (2.10.0)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
mini_portile (0.6.2)
multi_json (1.11.0)
multi_xml (0.5.5)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
octopress-date-format (2.0.2)
jekyll (~> 2.0)
octopress-hooks (~> 2.0)
octopress-hooks (2.6.1)
jekyll (>= 2.0)
oga (2.0.0)
ast
ruby-ll (~> 2.1)
open4 (1.3.4)
parallel (1.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
pygments.rb (0.6.3)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rack (1.6.1)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.8)
recurly (2.2.3)
redcarpet (3.2.3)
ref (1.0.5)
ruby-ll (2.1.2)
ansi
ast
safe_yaml (1.0.4)
sass (3.4.14)
sass-globbing (1.0.0)
sass (>= 3.1)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sinatra-contrib (1.4.2)
backports (>= 2.0)
multi_json
rack-protection
rack-test
sinatra (~> 1.4.0)
tilt (~> 1.3)
stringex (1.4.0)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
tilt (1.4.1)
timers (4.0.1)
hitimes
toml (0.1.2)
parslet (~> 1.5.0)
typhoeus (0.7.1)
ethon (>= 0.7.1)
yajl-ruby (1.2.1)
yaml-lint (0.0.7)
yell (2.0.5)
yui-compressor (0.12.0)
PLATFORMS
ruby
DEPENDENCIES
RedCloth (~> 4.2.9)
compass (~> 1.0.1)
daemons (~> 1.1.9)
haml (~> 4.0)
html-proofer
html_compressor (~> 0.0.3)
httparty
jekyll (= 2.4)
jekyll-sitemap
octopress-date-format (~> 2.0)
octopress-hooks (~> 2.2)
oga
rake (~> 10.0)
rb-fsevent (~> 0.9)
rdiscount (~> 2.0)
recurly (~> 2.2.1)
redcarpet
sass-globbing (~> 1.0.0)
sinatra (~> 1.4.2)
sinatra-contrib (~> 1.4.2)
stringex (~> 1.4.0)
therubyracer
yaml-lint
yui-compressor (~> 0.12.0)
BUNDLED WITH
1.11.2
Copyright (c) GitLab B.V.
[![build status](https://ci.gitlab.com/projects/1873/status.png?ref=master)](https://ci.gitlab.com/projects/1873?ref=master)
# Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
# Deploying
It is sufficient to merge or push to master and site will be automatically deployed.
Manual:
```
git remote add deploy deploy@blue-moon.gitlap.com:~/www-gitlab-com.git
git push deploy master
```
Make sure you have a right system locale otherwise you can get [error](https://gitlab.com/snippets/2327). Output of `locale` should be like:
```
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
```
# Development
Serve a local build on http://localhost:4000 using:
```
bundle exec rake preview
```
or use the following to also launch Google Chrome
```
bin/view
```
# Deployment setup
Set up a build server with a bare repository and the hook in `_support/hooks`.
Install site and PDF build dependencies `sudo apt-get install texlive-latex-recommended ruby1.9.1-dev ruby1.9.1`
Unfortunately, the pandoc version that ships with Ubuntu 12.04 is too old, so we have to build from source.
```
sudo apt-get install haskell-platform
sudo su - deploy # become the user who performs the build
cabal update
cabal install pandoc # takes a while
```
Copy `_support/user/bash_profile` to `~deploy/.bash_profile` to make sure the build script picks up the pandoc executable.
# In blog posts
Use the following tag after the opening paragraph to make it an acceptable size for the index listing of all articles:
<!-- more -->
Add your post's image to the 'images' file in this project. You'll need to do it through your local repository.
Add the following to the top of a blog post (between the --- markers) and it will format it as a full bleed image.
image_title: '/images/unspash/hardware.jpg'
When you add information about features or changes in GitLab CE, EE or CI, make it clear on which one users will be able to find these features or changes.
# Image Guidelines
When adding images to the site, please avoid using largely sized images, as they drastically increase load on the server and make the experience poor for the user.
Also make sure to compress the images as much as possible (use online resource, Photoshop, however you'd like)
You can find images at unsplash.com and then compress them at tinypng.com.
You can link to the authors twitter account with:
author_twitter: sytses
# Other documentation
* [Autodeploy](doc/autodeploy.md)
* [Recurly](doc/recurly.md)
* [Redirects](doc/redirect_blogposts_org_to_com.md)
* [Add a team member to GitLab's website's step by step](add_member_to_team_page.md)
* [Create a new markdown page](md_page.md)
## Create release blog post
Begin a new release blog post using template from docs.
```
bundle exec rake new_release_post["7.3"]
```
## Create blog post
Create blank blog post based on title
```
bundle exec rake new_post["Feature highlight: Groups"]
```
require "yui/compressor"
require "html_compressor"
require "rubygems"
require "bundler/setup"
require "stringex"
import 'generate_release_list.rb'
import 'generate_direction_issues.rb'
## -- Rsync Deploy config -- ##
# Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
ssh_user = "user@domain.com"
ssh_port = "22"
document_root = "~/website.com/"
rsync_delete = false
rsync_args = "" # Any extra arguments to pass to rsync
deploy_default = "rsync"
# This will be configured for you when you run config_deploy
deploy_branch = "gh-pages"
## -- Misc Configs -- ##
public_dir = "public" # compiled site directory
source_dir = "source" # source file directory
blog_index_dir = 'source' # directory for your blog's index page (if you put your index in source/blog/index.html, set this to 'source/blog')
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
stash_dir = "_stash" # directory to stash posts for speedy generation
posts_dir = "_posts" # directory for blog files
themes_dir = ".themes" # directory for blog files
new_post_ext = "markdown" # default new post file extension when using the new_post task
new_page_ext = "markdown" # default new page file extension when using the new_page task
server_port = "4000" # port for preview server eg. localhost:4000
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
puts '## Set the codepage to 65001 for Windows machines'
`chcp 65001`
end
desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]"
task :install, :theme do |t, args|
if File.directory?(source_dir) || File.directory?("sass")
abort("rake aborted!") if ask("A theme is already installed, proceeding will overwrite existing files. Are you sure?", ['y', 'n']) == 'n'
end
# copy theme into working Jekyll directories
theme = args.theme || 'classic'
puts "## Copying "+theme+" theme into ./#{source_dir} and ./sass"
mkdir_p source_dir
cp_r "#{themes_dir}/#{theme}/source/.", source_dir
mkdir_p "sass"
cp_r "#{themes_dir}/#{theme}/sass/.", "sass"
mkdir_p "#{source_dir}/#{posts_dir}"
mkdir_p public_dir
end
#######################
# Working with Jekyll #
#######################
desc "Generate jekyll site"
task :generate do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "## Generating Site with Jekyll"
system "compass compile --css-dir #{source_dir}/stylesheets"
system "jekyll build"
end
desc "Watch the site and regenerate when it changes"
task :watch do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass."
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch")
compassPid = Process.spawn("compass watch")
trap("INT") {
[jekyllPid, compassPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
exit 0
}
[jekyllPid, compassPid].each { |pid| Process.wait(pid) }
end
desc "preview the site in a web browser"
task :preview do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch")
compassPid = Process.spawn("compass watch")
rackupPid = Process.spawn("rackup --port #{server_port}")
trap("INT") {
[jekyllPid, compassPid, rackupPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
exit 0
}
[jekyllPid, compassPid, rackupPid].each { |pid| Process.wait(pid) }
end
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
desc "Begin a new post in #{source_dir}/#{posts_dir}"
task :new_post, :title do |t, args|
if args.title
title = args.title
else
title = get_stdin("Enter a title for your post: ")
end
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
mkdir_p "#{source_dir}/#{posts_dir}"
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end
puts "Creating new post: #{filename}"
open(filename, 'w') do |post|
post.puts "---"
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/&/,'&amp;')}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d')}"
post.puts "comments: true"
post.puts "author: Sytse Sijbrandij"
post.puts "author_twitter: sytses"
post.puts "image_title: '/images/unsplash/FILENAME.jpg'"
post.puts "---"
post.puts "<!-- more -->"
end
end
# usage rake new_page[my-new-page] or rake new_page[my-new-page.html] or rake new_page (defaults to "new-page.markdown")
desc "Create a new page in #{source_dir}/(filename)/index.#{new_page_ext}"
task :new_page, :filename do |t, args|
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
args.with_defaults(:filename => 'new-page')
page_dir = [source_dir]
if args.filename.downcase =~ /(^.+\/)?(.+)/
filename, dot, extension = $2.rpartition('.').reject(&:empty?) # Get filename and extension
title = filename
page_dir.concat($1.downcase.sub(/^\//, '').split('/')) unless $1.nil? # Add path to page_dir Array
if extension.nil?
page_dir << filename
filename = "index"
end
extension ||= new_page_ext
page_dir = page_dir.map! { |d| d = d.to_url }.join('/') # Sanitize path
filename = filename.downcase.to_url
mkdir_p page_dir
file = "#{page_dir}/#{filename}.#{extension}"
if File.exist?(file)
abort("rake aborted!") if ask("#{file} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end
puts "Creating new page: #{file}"
open(file, 'w') do |page|
page.puts "---"
page.puts "layout: page"
page.puts "title: \"#{title}\""
page.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
page.puts "comments: true"
page.puts "sharing: true"
page.puts "footer: true"
page.puts "---"
end
else
puts "Syntax error: #{args.filename} contains unsupported characters"
end
end
# usage rake isolate[my-post]
desc "Move all other posts than the one currently being worked on to a temporary stash location (stash) so regenerating the site happens much more quickly."
task :isolate, :filename do |t, args|
stash_dir = "#{source_dir}/#{stash_dir}"
FileUtils.mkdir(stash_dir) unless File.exist?(stash_dir)
Dir.glob("#{source_dir}/#{posts_dir}/*.*") do |post|
FileUtils.mv post, stash_dir unless post.include?(args.filename)
end
end
desc "Move all stashed posts back into the posts directory, ready for site generation."
task :integrate do
FileUtils.mv Dir.glob("#{source_dir}/#{stash_dir}/*.*"), "#{source_dir}/#{posts_dir}/"
end
desc "Clean out caches: .pygments-cache, .gist-cache, .sass-cache"
task :clean do
rm_rf [Dir.glob(".pygments-cache/**"), Dir.glob(".gist-cache/**"), Dir.glob(".sass-cache/**"), "source/stylesheets/screen.css"]
end
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
task :update_style, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("sass.old")
puts "removed existing sass.old directory"
rm_r "sass.old", :secure=>true
end
mv "sass", "sass.old"
puts "## Moved styles into sass.old/"
cp_r "#{themes_dir}/"+theme+"/sass/", "sass", :remove_destination=>true
cp_r "sass.old/custom/.", "sass/custom/", :remove_destination=>true
puts "## Updated Sass ##"
end
desc "Move source to source.old, install source theme updates, replace source/_includes/navigation.html with source.old's navigation"
task :update_source, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("#{source_dir}.old")
puts "## Removed existing #{source_dir}.old directory"
rm_r "#{source_dir}.old", :secure=>true
end
mkdir "#{source_dir}.old"
cp_r "#{source_dir}/.", "#{source_dir}.old"
puts "## Copied #{source_dir} into #{source_dir}.old/"
cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true
cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true
cp "#{source_dir}.old/favicon.png", source_dir
mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
puts "## Updated #{source_dir} ##"
end
##############
# Deploying #
##############
desc "Default deploy task"
task :deploy do
# Check if preview posts exist, which should not be published
if File.exists?(".preview-mode")
puts "## Found posts in preview mode, regenerating files ..."
File.delete(".preview-mode")
Rake::Task[:generate].execute
end
Rake::Task[:minify_css].execute
Rake::Task[:minify_js].execute
Rake::Task[:copydot].invoke(source_dir, public_dir)
Rake::Task["#{deploy_default}"].execute
end
desc "Generate website and deploy"
task :gen_deploy => [:integrate, :generate, :deploy] do
end
desc "copy dot files for deployment"
task :copydot, :source, :dest do |t, args|
FileList["#{args.source}/**/.*"].exclude("**/.", "**/..", "**/.DS_Store", "**/._*").each do |file|
cp_r file, file.gsub(/#{args.source}/, "#{args.dest}") unless File.directory?(file)
end
end
desc "Deploy website via rsync"
task :rsync do
exclude = ""
if File.exists?('./rsync-exclude')
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
end
puts "## Deploying website via Rsync"
ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{rsync_args} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}")
end
desc "deploy public directory to github pages"
multitask :push do
puts "## Deploying branch to Github Pages "
puts "## Pulling any updates from Github Pages "
cd "#{deploy_dir}" do
Bundler.with_clean_env { system "git pull" }
end
(Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) }
Rake::Task[:copydot].invoke(public_dir, deploy_dir)
puts "\n## Copying #{public_dir} to #{deploy_dir}"
cp_r "#{public_dir}/.", deploy_dir
cd "#{deploy_dir}" do
system "git add -A"
message = "Site updated at #{Time.now.utc}"
puts "\n## Committing: #{message}"
system "git commit -m \"#{message}\""
puts "\n## Pushing generated #{deploy_dir} website"
Bundler.with_clean_env { system "git push origin #{deploy_branch}" }
puts "\n## Github Pages deploy complete"
end
end
desc "Update configurations to support publishing to root or sub directory"
task :set_root_dir, :dir do |t, args|
puts ">>> !! Please provide a directory, eg. rake config_dir[publishing/subdirectory]" unless args.dir
if args.dir
if args.dir == "/"
dir = ""
else
dir = "/" + args.dir.sub(/(\/*)(.+)/, "\\2").sub(/\/$/, '');
end
rakefile = IO.read(__FILE__)
rakefile.sub!(/public_dir(\s*)=(\s*)(["'])[\w\-\/]*["']/, "public_dir\\1=\\2\\3public#{dir}\\3")
File.open(__FILE__, 'w') do |f|
f.write rakefile
end
compass_config = IO.read('config.rb')
compass_config.sub!(/http_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_path\\1=\\2\\3#{dir}/\\3")
compass_config.sub!(/http_images_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_images_path\\1=\\2\\3#{dir}/images\\3")
compass_config.sub!(/http_fonts_path(\s*)=(\s*)(["'])[\w\-\/]*["']/, "http_fonts_path\\1=\\2\\3#{dir}/fonts\\3")
compass_config.sub!(/css_dir(\s*)=(\s*)(["'])[\w\-\/]*["']/, "css_dir\\1=\\2\\3public#{dir}/stylesheets\\3")
File.open('config.rb', 'w') do |f|
f.write compass_config
end
jekyll_config = IO.read('_config.yml')
jekyll_config.sub!(/^destination:.+$/, "destination: public#{dir}")
jekyll_config.sub!(/^subscribe_rss:\s*\/.+$/, "subscribe_rss: #{dir}/atom.xml")
jekyll_config.sub!(/^root:.*$/, "root: /#{dir.sub(/^\//, '')}")
File.open('_config.yml', 'w') do |f|
f.write jekyll_config
end
rm_rf public_dir
mkdir_p "#{public_dir}#{dir}"
puts "## Site's root directory is now '/#{dir.sub(/^\//, '')}' ##"
end
end
desc "Set up _deploy folder and deploy branch for Github Pages deployment"
task :setup_github_pages, :repo do |t, args|
if args.repo
repo_url = args.repo
else
puts "Enter the read/write url for your repository"
puts "(For example, 'git@github.com:your_username/your_username.github.io.git)"
puts " or 'https://github.com/your_username/your_username.github.io')"
repo_url = get_stdin("Repository url: ")
end
protocol = (repo_url.match(/(^git)@/).nil?) ? 'https' : 'git'
if protocol == 'git'
user = repo_url.match(/:([^\/]+)/)[1]
else
user = repo_url.match(/github\.com\/([^\/]+)/)[1]
end
branch = (repo_url.match(/\/[\w-]+\.github\.(?:io|com)/).nil?) ? 'gh-pages' : 'master'
project = (branch == 'gh-pages') ? repo_url.match(/([^\/]+?)(\.git|$)/i)[1] : ''
unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil?
# If octopress is still the origin remote (from cloning) rename it to octopress
system "git remote rename origin octopress"
if branch == 'master'
# If this is a user/organization pages repository, add the correct origin remote
# and checkout the source branch for committing changes to the blog source.
system "git remote add origin #{repo_url}"
puts "Added remote #{repo_url} as origin"
system "git config branch.master.remote origin"
puts "Set origin as default remote"
system "git branch -m master source"
puts "Master branch renamed to 'source' for committing your blog source files"
else
unless !public_dir.match("#{project}").nil?
system "rake set_root_dir[#{project}]"
end
end
end
url = blog_url(user, project, source_dir)
jekyll_config = IO.read('_config.yml')
jekyll_config.sub!(/^url:.*$/, "url: #{url}")
File.open('_config.yml', 'w') do |f|
f.write jekyll_config
end
rm_rf deploy_dir
mkdir deploy_dir
cd "#{deploy_dir}" do
system "git init"
system 'echo "My Octopress Page is coming soon &hellip;" > index.html'
system "git add ."
system "git commit -m \"Octopress init\""
system "git branch -m gh-pages" unless branch == 'master'
system "git remote add origin #{repo_url}"
rakefile = IO.read(__FILE__)
rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{branch}\\3")
rakefile.sub!(/deploy_default(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_default\\1=\\2\\3push\\3")
File.open(__FILE__, 'w') do |f|
f.write rakefile
end
end
puts "\n---\n## Now you can deploy to #{repo_url} with `rake deploy` ##"
end
def ok_failed(condition)
if (condition)
puts "OK"
else
puts "FAILED"
end
end
def get_stdin(message)
print message
STDIN.gets.chomp
end
def ask(message, valid_options)
if valid_options
answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
else
answer = get_stdin(message)
end
answer
end
def blog_url(user, project, source_dir)
cname = "#{source_dir}/CNAME"
url = if File.exists?(cname)
"http://#{IO.read(cname).strip}"
else
"http://#{user.downcase}.github.io"
end
url += "/#{project}" unless project == ''
url
end
desc "list tasks"
task :list do
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"
puts "(type rake -T for more detail)\n\n"
end
BUILD_DIR = 'public/'
DEPLOY_LOCATION = 'deploy@blue-moon.gitlap.com:public/'
DEPLOY_BRANCH = 'master'
PDFS = FileList['source/terms/print/*.html'].pathmap('%{^source,public}X.pdf') +
%w{public/high-availability/gitlab-ha.pdf public/features/gitlab-features.pdf}
task :clean do
rm_rf BUILD_DIR
end
desc "Build website in #{BUILD_DIR}"
task :build => [:clean, :release_list, :direction_issues, :generate, :pdfs]
rule %r{^public/.*\.pdf} => [->(f) { f.pathmap('%X.html') }] do |pdf|
# Rewrite the generated HTML a bit, fix relative image links for pandoc
IO.popen(%W(ed -s #{pdf.source}), 'w') do |ed|
ed.puts <<-'EOS'
H
g/\.\.\/images\//\
s/\.\.\/images/public\/images/
wq
EOS
end
options = %W(--template=_terms_template.tex --latex-engine=xelatex -V date=#{Time.now.to_s})
warn "Generating #{pdf.name}"
abort("Pandoc failed") unless system('pandoc', *options, '-o', pdf.name, pdf.source)
end
desc 'Generate PDFs'
task :pdfs => PDFS
desc "Deploy master to #{DEPLOY_LOCATION}"
task :sync => [:no_changes, :check_branch, :build] do
warn "Deploying to #{DEPLOY_LOCATION}"
system *%W(rsync --delete-after -r #{BUILD_DIR} #{DEPLOY_LOCATION})
end
task :check_branch do
unless `git rev-parse --abbrev-ref HEAD`.chomp == DEPLOY_BRANCH
abort("Can only deploy from #{DEPLOY_BRANCH}")
end
end
task :no_changes do
unless system(*%w{git diff --quiet HEAD})
abort("Cannot deploy when there are uncomitted changes")
end
end
task :configure_nginx do
warn('Installing nginx config to /etc/nginx/sites-available')
system('sudo', 'cp', '_support/nginx/www.gitlab.com', '/etc/nginx/sites-available/')
end
# usage rake new_release_post["7.3"]
desc "Begin a new release post in #{source_dir}/#{posts_dir} using template from docs"
task :new_release_post, :version do |t, args|
version = args.version
unless version =~ /\A\d+\.\d+\z/
raise 'You need to specify version like 8.3'
end
mkdir_p "#{source_dir}/#{posts_dir}"
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-22')}-gitlab-#{version.gsub('.', '-')}-released.#{new_post_ext}"
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end
puts "Creating new release post: #{filename}"
template_text = File.read('doc/release_blog_template.md')
template_text.gsub!('date: YYYY-MM-22', "date: #{Time.now.year}-#{Time.now.strftime("%m")}-22")
template_text.gsub!('X_X', version.gsub('.', '_'))
template_text.gsub!('X.X', version)
template_text.gsub!('X-X', version.gsub('.', '-'))
open(filename, 'w') do |post|
post.puts template_text
end
end
###########
# Testing #
###########
require 'html/proofer'
htmlproof_options = {
checks_to_ignore: ['ImageCheck'],
href_ignore: ['http://localhost:4000'],
verbose: true
}
desc "Build and test website"
task :test => [:clean, :generate] do
HTML::Proofer.new("./public", htmlproof_options ).run
end
##########
# Minify #
##########
desc "Minify CSS"
task :minify_css do
puts "## Minifying CSS"
compressor = YUI::CssCompressor.new
Dir.glob("#{public_dir}/**/*.css").each do |name|
puts "Minifying #{name}"
input = File.read(name)
output = File.open("#{name}", "w")
output << compressor.compress(input)
output.close
end
end
desc "Minify JS"
task :minify_js do
puts "## Minifying JS"
compressor = YUI::JavaScriptCompressor.new
Dir.glob("#{public_dir}/**/*.js").each do |name|
puts "Minifying #{name}"
input = File.read(name)
output = File.open("#{name}", "w")
output << compressor.compress(input)
output.close
end
end
# ----------------------- #
# Main Configs #
# ----------------------- #
url: https://about.gitlab.com
title: GitLab
subtitle: Open source software to collaborate on code
author: Marin Jankovski
simple_search: http://google.com/search
description:
# Default date format is "ordinal" (resulting in "July 22nd 2007")
# You can customize the format as defined in
# http://www.ruby-doc.org/core-1.9.2/Time.html#method-i-strftime
# Additionally, %o will give you the ordinal representation of the day
date_format: "ordinal"
# RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml
subscribe_email:
# RSS feeds can list your email address if you like
email:
# ----------------------- #
# Jekyll & Plugins #
# ----------------------- #
# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
root: /
permalink: /:year/:month/:day/:title/
source: source
destination: public
plugins: plugins
code_dir: downloads/code
category_dir: blog/categories
markdown: rdiscount
rdiscount:
extensions:
- autolink
- footnotes
- smart
highlighter: pygments # default python pygments have been replaced by pygments.rb
paginate: 3 # Posts per page on the blog index
paginate_path: "blog/:num" # Directory base for pagination URLs eg. /posts/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section
excerpt_link: "Read on &rarr;" # "Continue reading" link text at the bottom of excerpted articles
excerpt_separator: "<!--more-->"
titlecase: true # Converts page and post titles to titlecase
# list each of the sidebar modules you want to include, in the order you want them to appear.
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
default_asides: [asides/recent_posts.html, asides/github.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]
# Each layout uses the default asides, but they can have their own asides instead. Simply uncomment the lines below
# and add an array with the asides you want to use.
# blog_index_asides:
# post_asides:
# page_asides:
# ----------------------- #
# 3rd Party Settings #
# ----------------------- #
# Github repositories
github_user:
github_repo_count: 0
github_show_profile_link: true
github_skip_forks: true
# Twitter
twitter_user:
twitter_tweet_button: true
# Google +1
google_plus_one: false
google_plus_one_size: medium
# Google Plus Profile
# Hidden: No visible button, just add author information to search results
googleplus_user:
googleplus_hidden: false
# Pinboard
pinboard_user:
pinboard_count: 3
# Delicious
delicious_user:
delicious_count: 3
# Disqus Comments
disqus_short_name:
disqus_show_comment_count: false
# Google Analytics
google_analytics_tracking_id:
# Facebook Like
facebook_like: false
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{$documentclass$}
% fix for pandoc 1.14
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[utf8]{inputenc}
$if(euro)$
\usepackage{eurosym}
$endif$
\else % if luatex or xelatex
\usepackage{fontspec}
\ifxetex
\usepackage{xltxtra,xunicode}
\fi
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\euro}{}
$if(mainfont)$
\setmainfont{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont{$sansfont$}
$endif$
$if(monofont)$
\setmonofont{$monofont$}
$endif$
$if(mathfont)$
\setmathfont{$mathfont$}
$endif$
\fi
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{plainnat}
$endif$
$if(biblatex)$
\usepackage{biblatex}
$if(biblio-files)$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(listings)$
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
$if(tables)$
\usepackage{longtable}
$endif$
$if(graphics)$
\usepackage{graphicx}
% We will generate all images so they have a width \maxwidth. This means
% that they will get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
$endif$
\ifxetex
\usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex
xetex]{hyperref}
\else
\usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
bookmarks=true,
pdfauthor={$author-meta$},
pdftitle={$title-meta$},
colorlinks=true,
urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
pdfborder={0 0 0}}
\urlstyle{same} % don't use monospace font for urls
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
$if(strikeout)$
\usepackage[normalem]{ulem}
% avoid problems with \sout in headers with hyperref:
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
$if(numbersections)$
\setcounter{secnumdepth}{5}
$else$
\setcounter{secnumdepth}{0}
$endif$
$if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes
$endif$
$if(lang)$
\ifxetex
\usepackage{polyglossia}
\setmainlanguage{$mainlang$}
\else
\usepackage[$lang$]{babel}
\fi
$endif$
$for(header-includes)$
$header-includes$
$endfor$
$if(title)$
\title{$title$}
$endif$
\author{$for(author)$$author$$sep$ \and $endfor$}
\date{$date$}
\pagestyle{fancy}
\lhead{}
\cfoot{Page \thepage \ of \pageref*{LastPage}; PDF generated on $date$}
\begin{document}
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
{
\hypersetup{linkcolor=black}
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}
$endif$
$body$
$if(natbib)$
$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
\label{LastPage}
\end{document}
# How to add yourself to GitLab’s team page
Welcome to GitLab! We are happy to have you join our company and to include
you in our [team page](https://about.gitlab.com/team/). The following are
the steps to add yourself to the team page. Please follow the links that will guide you to full guides about every step.
1. Create an account in [GitLab.com](https://gitlab.com/) and take notes of
your username and password, because you will need them throughout these steps.
2. Ask your manager to grant you access to the [www-gitlab-com
project](https://gitlab.com/gitlab-com/www-gitlab-com).
3. Download Git, following the [start using git
documentation](http://doc.gitlab.com/ce/gitlab-basics/start-using-git.html)
. Don't forget to add your Git username and to set your email.
4. Follow the steps to create and add your [SSH
keys](http://doc.gitlab.com/ce/gitlab-basics/create-your-ssh-keys.html).
Note: in some of these steps, your
[shell](http://doc.gitlab.com/ce/gitlab-basics/start-using-git.html) will
require you to add your GitLab.com username and password.
4. Clone the www-gitlab-com project through your shell, following the [command
line commands
documentation](http://doc.gitlab.com/ce/gitlab-basics/command-line-commands.html).
5. Find the picture that you’d like to add to
our [team page](https://about.gitlab.com/team/), change the picture's name to
the following format: `yourname.jpg` or `yourname.png` and then follow the
"[how
to add an image](http://doc.gitlab.com/ce/gitlab-basics/add-image.html)"
steps.
Note: Any picture that you provide will be made black-and-white
automatically after you add it, but it must be square. Note that your team
page picture should be added to
www-gitlab-com/source/images/team/NAME-OF-PERSON-IN-LOWERCASE.jpg.
6. [Create a Merge Request](http://doc.gitlab.com/ce/gitlab-basics/add-merge-request.html) in [GitLab.com](https://gitlab.com/) with the branch that you created with your picture.
7. In [GitLab.com](https://gitlab.com/), on the left side of your screen, click on "Files".
8. Find the dropdown menu at the top of your screen and find the branch
that you previously created to add your picture (they are in alphabetical
order). If you don't have a branch yet, follow the steps to [create a new
branch](http://doc.gitlab.com/ce/gitlab-basics/create-branch.html).
![dropdown menu](source/images/dropdown-branch-teampage.jpg)
9. Information displayed on [Team page](https://about.gitlab.com/team/) is
pulled from a data file. You can find it by clicking on each of the following items: `source/` `_data/``
`team.yml`.
10. When you are in “team.yml”, click on “edit” on the top right side of
your screen.
11. Your information should be added after the last person on the team page.
You need to copy and paste the following format and fill in your own
information:
```
- name: Linus Torvalds
role: developer
picture: picture_linus.jpg
twitter: Linus_Torvalds
gitlab: linustorvalds
story: |
Linus was the principal force behind the development of the Linux
kernel that became the most popular kernel for operating systems.
He later became the chief architect of the Linux kernel and now
acts as the project's coordinator. He also created the
distributed revision control system git. He joined when it was
created.
```
Don't forget to use other team members' information as a reference and to
respect the spaces between lines. Please don't use "tab" because it will brake the page format.
12. After you added your information, add a comment to your commit and click
on “Commit Changes”.
13. Go to the Merge
Request that you previously created with the branch that you are using and
assign it to your manager for review.
#!/bin/sh
bundle exec rake preview &
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome http://localhost:4000/
require 'sass-globbing'
# Require any additional compass plugins here.
project_type = :stand_alone
# Publishing paths
http_path = "/"
http_images_path = "/images"
http_generated_images_path = "/images"
http_fonts_path = "/fonts"
css_dir = "public/stylesheets"
# Local development paths
sass_dir = "sass"
images_dir = "source/images"
fonts_dir = "source/fonts"
line_comments = false
output_style = :compressed
require 'bundler/setup'
require 'sinatra/base'
# The project root directory
$root = ::File.dirname(__FILE__)
class SinatraStaticServer < Sinatra::Base
get(/.+/) do
send_sinatra_file(request.path) {404}
end
not_found do
send_file(File.join(File.dirname(__FILE__), 'public', '404.html'), {:status => 404})
end
def send_sinatra_file(path, &missing_file_block)
file_path = File.join(File.dirname(__FILE__), 'public', path)
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
end
end
run SinatraStaticServer
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