Commit 355310ba authored by Jacob Schatz's avatar Jacob Schatz Committed by Robert Speicher

Merge branch '17521-gitlab-ci-yml-templates' into 'master'

GitLab CI Yaml template dropdown

## What does this MR do?
Make it possible to select a dropdown for an easy start with GitLab CI.

## What are the relevant issue numbers?
Closes #17521

## TODO
- [ ] Backend
  - [x] CHANGELOG item
  - [x] Fix rubocop failure
  - [x] API Support
  - [x] New tests
  - [x] Add disclaimer to the top of the gitlab-ci.yml
- [ ] Frontend
  - [x] New tests

See merge request !4411
parent e4938c6e
...@@ -108,6 +108,7 @@ v 8.9.0 (unreleased) ...@@ -108,6 +108,7 @@ v 8.9.0 (unreleased)
- An indicator is now displayed at the top of the comment field for confidential issues. - An indicator is now displayed at the top of the comment field for confidential issues.
- Show categorised search queries in the search autocomplete - Show categorised search queries in the search autocomplete
- RepositoryCheck::SingleRepositoryWorker public and private methods are now instrumented - RepositoryCheck::SingleRepositoryWorker public and private methods are now instrumented
- Dropdown for `.gitlab-ci.yml` templates
- Improve issuables APIs performance when accessing notes !4471 - Improve issuables APIs performance when accessing notes !4471
- Add sorting dropdown to tags page !4423 - Add sorting dropdown to tags page !4423
- External links now open in a new tab - External links now open in a new tab
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
labelsPath: "/api/:version/projects/:id/labels" labelsPath: "/api/:version/projects/:id/labels"
licensePath: "/api/:version/licenses/:key" licensePath: "/api/:version/licenses/:key"
gitignorePath: "/api/:version/gitignores/:key" gitignorePath: "/api/:version/gitignores/:key"
gitlabCiYmlPath: "/api/:version/gitlab_ci_ymls/:key"
group: (group_id, callback) -> group: (group_id, callback) ->
url = Api.buildUrl(Api.groupPath) url = Api.buildUrl(Api.groupPath)
...@@ -110,6 +111,12 @@ ...@@ -110,6 +111,12 @@
$.get url, (gitignore) -> $.get url, (gitignore) ->
callback(gitignore) callback(gitignore)
gitlabCiYml: (key, callback) ->
url = Api.buildUrl(Api.gitlabCiYmlPath).replace(':key', key)
$.get url, (file) ->
callback(file)
buildUrl: (url) -> buildUrl: (url) ->
url = gon.relative_url_root + url if gon.relative_url_root? url = gon.relative_url_root + url if gon.relative_url_root?
return url.replace(':version', gon.api_version) return url.replace(':version', gon.api_version)
#= require blob/template_selector
class @BlobCiYamlSelector extends TemplateSelector
requestFile: (query) ->
Api.gitlabCiYml query.name, @requestFileSuccess.bind(@)
class @BlobCiYamlSelectors
constructor: (opts) ->
{
@$dropdowns = $('.js-gitlab-ci-yml-selector')
@editor
} = opts
@$dropdowns.each (i, dropdown) =>
$dropdown = $(dropdown)
new BlobCiYamlSelector(
pattern: /(.gitlab-ci.yml)/,
data: $dropdown.data('data'),
wrapper: $dropdown.closest('.js-gitlab-ci-yml-selector-wrap'),
dropdown: $dropdown,
editor: @editor
)
...@@ -15,6 +15,7 @@ class @EditBlob ...@@ -15,6 +15,7 @@ class @EditBlob
new BlobLicenseSelectors { @editor } new BlobLicenseSelectors { @editor }
new BlobGitignoreSelectors { @editor } new BlobGitignoreSelectors { @editor }
new BlobCiYamlSelectors { @editor }
initModePanesAndLinks: -> initModePanesAndLinks: ->
@$editModePanes = $(".js-edit-mode-pane") @$editModePanes = $(".js-edit-mode-pane")
......
...@@ -60,13 +60,14 @@ ...@@ -60,13 +60,14 @@
.encoding-selector, .encoding-selector,
.license-selector, .license-selector,
.gitignore-selector { .gitignore-selector,
.gitlab-ci-yml-selector {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
font-family: $regular_font; font-family: $regular_font;
} }
.gitignore-selector, .license-selector { .gitignore-selector, .license-selector, .gitlab-ci-yml-selector {
.dropdown { .dropdown {
line-height: 21px; line-height: 21px;
} }
...@@ -76,4 +77,10 @@ ...@@ -76,4 +77,10 @@
width: 220px; width: 220px;
} }
} }
.gitlab-ci-yml-selector {
.dropdown-menu-toggle {
width: 250px;
}
}
} }
...@@ -186,12 +186,16 @@ module BlobHelper ...@@ -186,12 +186,16 @@ module BlobHelper
end end
def gitignore_names def gitignore_names
return @gitignore_names if defined?(@gitignore_names) @gitignore_names ||=
Gitlab::Template::Gitignore.categories.keys.map do |k|
[k, Gitlab::Template::Gitignore.by_category(k).map { |t| { name: t.name } }]
end.to_h
end
@gitignore_names = { def gitlab_ci_ymls
Global: Gitlab::Gitignore.global.map { |gitignore| { name: gitignore.name } }, @gitlab_ci_ymls ||=
# Note that the key here doesn't cover it really Gitlab::Template::GitlabCiYml.categories.keys.map do |k|
Languages: Gitlab::Gitignore.languages_frameworks.map{ |gitignore| { name: gitignore.name } } [k, Gitlab::Template::GitlabCiYml.by_category(k).map { |t| { name: t.name } }]
} end.to_h
end end
end end
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
= dropdown_tag("Choose a License template", options: { toggle_class: 'js-license-selector', title: "Choose a license", filter: true, placeholder: "Filter", data: { data: licenses_for_select, project: @project.name, fullname: @project.namespace.human_name } } ) = dropdown_tag("Choose a License template", options: { toggle_class: 'js-license-selector', title: "Choose a license", filter: true, placeholder: "Filter", data: { data: licenses_for_select, project: @project.name, fullname: @project.namespace.human_name } } )
.gitignore-selector.js-gitignore-selector-wrap.hidden .gitignore-selector.js-gitignore-selector-wrap.hidden
= dropdown_tag("Choose a .gitignore template", options: { toggle_class: 'js-gitignore-selector', title: "Choose a template", filter: true, placeholder: "Filter", data: { data: gitignore_names } } ) = dropdown_tag("Choose a .gitignore template", options: { toggle_class: 'js-gitignore-selector', title: "Choose a template", filter: true, placeholder: "Filter", data: { data: gitignore_names } } )
.gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.hidden
= dropdown_tag("Choose a GitLab CI Yaml template", options: { toggle_class: 'js-gitlab-ci-yml-selector', title: "Choose a template", filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls } } )
.encoding-selector .encoding-selector
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2' = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2'
......
...@@ -57,6 +57,10 @@ ...@@ -57,6 +57,10 @@
%li.missing %li.missing
= link_to add_special_file_path(@project, file_name: 'CONTRIBUTING.md', commit_message: 'Add contribution guide') do = link_to add_special_file_path(@project, file_name: 'CONTRIBUTING.md', commit_message: 'Add contribution guide') do
Add Contribution guide Add Contribution guide
- unless @repository.gitlab_ci_yml
%li.missing
= link_to add_special_file_path(@project, file_name: '.gitlab-ci.yml') do
Set up CI
- if @repository.commit - if @repository.commit
.content-block.second-block.white .content-block.second-block.white
......
...@@ -33,7 +33,6 @@ module API ...@@ -33,7 +33,6 @@ module API
mount ::API::Commits mount ::API::Commits
mount ::API::DeployKeys mount ::API::DeployKeys
mount ::API::Files mount ::API::Files
mount ::API::Gitignores
mount ::API::GroupMembers mount ::API::GroupMembers
mount ::API::Groups mount ::API::Groups
mount ::API::Internal mount ::API::Internal
...@@ -58,6 +57,7 @@ module API ...@@ -58,6 +57,7 @@ module API
mount ::API::Subscriptions mount ::API::Subscriptions
mount ::API::SystemHooks mount ::API::SystemHooks
mount ::API::Tags mount ::API::Tags
mount ::API::Templates
mount ::API::Triggers mount ::API::Triggers
mount ::API::Users mount ::API::Users
mount ::API::Variables mount ::API::Variables
......
...@@ -469,11 +469,11 @@ module API ...@@ -469,11 +469,11 @@ module API
expose :content expose :content
end end
class GitignoresList < Grape::Entity class TemplatesList < Grape::Entity
expose :name expose :name
end end
class Gitignore < Grape::Entity class Template < Grape::Entity
expose :name, :content expose :name, :content
end end
end end
......
module API
class Gitignores < Grape::API
# Get the list of the available gitignore templates
#
# Example Request:
# GET /gitignores
get 'gitignores' do
present Gitlab::Gitignore.all, with: Entities::GitignoresList
end
# Get the text for a specific gitignore
#
# Parameters:
# name (required) - The name of a license
#
# Example Request:
# GET /gitignores/Elixir
#
get 'gitignores/:name' do
required_attributes! [:name]
gitignore = Gitlab::Gitignore.find(params[:name])
not_found!('.gitignore') unless gitignore
present gitignore, with: Entities::Gitignore
end
end
end
module API
class Templates < Grape::API
TEMPLATE_TYPES = {
gitignores: Gitlab::Template::Gitignore,
gitlab_ci_ymls: Gitlab::Template::GitlabCiYml
}.freeze
TEMPLATE_TYPES.each do |template, klass|
# Get the list of the available template
#
# Example Request:
# GET /gitignores
# GET /gitlab_ci_ymls
get template.to_s do
present klass.all, with: Entities::TemplatesList
end
# Get the text for a specific template
#
# Parameters:
# name (required) - The name of a template
#
# Example Request:
# GET /gitignores/Elixir
# GET /gitlab_ci_ymls/Ruby
get "#{template}/:name" do
required_attributes! [:name]
new_template = klass.find(params[:name])
not_found!(template.to_s.singularize) unless new_template
present new_template, with: Entities::Template
end
end
end
end
module Gitlab
class Gitignore
FILTER_REGEX = /\.gitignore\z/.freeze
def initialize(path)
@path = path
end
def name
File.basename(@path, '.gitignore')
end
def content
File.read(@path)
end
class << self
def all
languages_frameworks + global
end
def find(key)
file_name = "#{key}.gitignore"
directory = select_directory(file_name)
directory ? new(File.join(directory, file_name)) : nil
end
def global
files_for_folder(global_dir).map { |file| new(File.join(global_dir, file)) }
end
def languages_frameworks
files_for_folder(gitignore_dir).map { |file| new(File.join(gitignore_dir, file)) }
end
private
def select_directory(file_name)
[gitignore_dir, global_dir].find { |dir| File.exist?(File.join(dir, file_name)) }
end
def global_dir
File.join(gitignore_dir, 'Global')
end
def gitignore_dir
Rails.root.join('vendor/gitignore')
end
def files_for_folder(dir)
Dir.glob("#{dir.to_s}/*.gitignore").map { |file| file.gsub(FILTER_REGEX, '') }
end
end
end
end
module Gitlab
module Template
class BaseTemplate
def initialize(path)
@path = path
end
def name
File.basename(@path, self.class.extension)
end
def content
File.read(@path)
end
class << self
def all
self.categories.keys.flat_map { |cat| by_category(cat) }
end
def find(key)
file_name = "#{key}#{self.extension}"
directory = select_directory(file_name)
directory ? new(File.join(category_directory(directory), file_name)) : nil
end
def categories
raise NotImplementedError
end
def extension
raise NotImplementedError
end
def base_dir
raise NotImplementedError
end
def by_category(category)
templates_for_directory(category_directory(category))
end
def category_directory(category)
File.join(base_dir, categories[category])
end
private
def select_directory(file_name)
categories.keys.find do |category|
File.exist?(File.join(category_directory(category), file_name))
end
end
def templates_for_directory(dir)
dir << '/' unless dir.end_with?('/')
Dir.glob(File.join(dir, "*#{self.extension}")).select { |f| f =~ filter_regex }.map { |f| new(f) }
end
def filter_regex
@filter_reges ||= /#{Regexp.escape(extension)}\z/
end
end
end
end
end
module Gitlab
module Template
class Gitignore < BaseTemplate
class << self
def extension
'.gitignore'
end
def categories
{
"Languages" => '',
"Global" => 'Global'
}
end
def base_dir
Rails.root.join('vendor/gitignore')
end
end
end
end
end
module Gitlab
module Template
class GitlabCiYml < BaseTemplate
def content
explanation = "# This file is a template, and might need editing before it works on your project."
[explanation, super].join("\n")
end
class << self
def extension
'.gitlab-ci.yml'
end
def categories
{
"General" => '',
"Pages" => 'Pages'
}
end
def base_dir
Rails.root.join('vendor/gitlab-ci-yml')
end
end
end
end
end
namespace :gitlab do
desc "GitLab | Update gitignore"
task :update_gitignore do
unless clone_gitignores
puts "Cloning the gitignores failed".color(:red)
return
end
remove_unneeded_files(gitignore_directory)
remove_unneeded_files(global_directory)
puts "Done".color(:green)
end
def clone_gitignores
FileUtils.rm_rf(gitignore_directory) if Dir.exist?(gitignore_directory)
FileUtils.cd vendor_directory
system('git clone --depth=1 --branch=master https://github.com/github/gitignore.git')
end
# Retain only certain files:
# - The LICENSE, because we have to
# - The sub dir global
# - The gitignores themself
# - Dir.entires returns also the entries '.' and '..'
def remove_unneeded_files(path)
Dir.foreach(path) do |file|
FileUtils.rm_rf(File.join(path, file)) unless file =~ /(\.{1,2}|LICENSE|Global|\.gitignore)\z/
end
end
private
def vendor_directory
Rails.root.join('vendor')
end
def gitignore_directory
File.join(vendor_directory, 'gitignore')
end
def global_directory
File.join(gitignore_directory, 'Global')
end
end
namespace :gitlab do
desc "GitLab | Update templates"
task :update_templates do
TEMPLATE_DATA.each { |template| update(template) }
end
def update(template)
sub_dir = template.repo_url.match(/([a-z-]+)\.git\z/)[1]
dir = File.join(vendor_directory, sub_dir)
unless clone_repository(template.repo_url, dir)
puts "Cloning the #{sub_dir} templates failed".red
return
end
remove_unneeded_files(dir, template.cleanup_regex)
puts "Done".green
end
def clone_repository(url, directory)
FileUtils.rm_rf(directory) if Dir.exist?(directory)
system("git clone #{url} --depth=1 --branch=master #{directory}")
end
# Retain only certain files:
# - The LICENSE, because we have to
# - The sub dirs so we can organise the file by category
# - The templates themself
# - Dir.entries returns also the entries '.' and '..'
def remove_unneeded_files(directory, regex)
Dir.foreach(directory) do |file|
FileUtils.rm_rf(File.join(directory, file)) unless file =~ regex
end
end
private
Template = Struct.new(:repo_url, :cleanup_regex)
TEMPLATE_DATA = [
Template.new(
"https://github.com/github/gitignore.git",
/(\.{1,2}|LICENSE|Global|\.gitignore)\z/
),
Template.new(
"https://gitlab.com/gitlab-org/gitlab-ci-yml.git",
/(\.{1,2}|LICENSE|Pages|\.gitlab-ci.yml)\z/
)
]
def vendor_directory
Rails.root.join('vendor')
end
end
require 'spec_helper'
feature 'User wants to add a .gitlab-ci.yml file', feature: true do
include WaitForAjax
before do
user = create(:user)
project = create(:project)
project.team << [user, :master]
login_as user
visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: '.gitlab-ci.yml')
end
scenario 'user can see .gitlab-ci.yml dropdown' do
expect(page).to have_css('.gitlab-ci-yml-selector')
end
scenario 'user can pick a template from the dropdown', js: true do
find('.js-gitlab-ci-yml-selector').click
wait_for_ajax
within '.gitlab-ci-yml-selector' do
find('.dropdown-input-field').set('jekyll')
find('.dropdown-content li', text: 'jekyll').click
end
wait_for_ajax
expect(page).to have_content('This file is a template, and might need editing before it works on your project')
expect(page).to have_content('jekyll build -d test')
end
end
require 'spec_helper' require 'spec_helper'
describe Gitlab::Gitignore do describe Gitlab::Template::Gitignore do
subject { Gitlab::Gitignore } subject { described_class }
describe '.all' do describe '.all' do
it 'strips the gitignore suffix' do it 'strips the gitignore suffix' do
...@@ -24,7 +24,7 @@ describe Gitlab::Gitignore do ...@@ -24,7 +24,7 @@ describe Gitlab::Gitignore do
it 'returns the Gitignore object of a valid file' do it 'returns the Gitignore object of a valid file' do
ruby = subject.find('Ruby') ruby = subject.find('Ruby')
expect(ruby).to be_a Gitlab::Gitignore expect(ruby).to be_a Gitlab::Template::Gitignore
expect(ruby.name).to eq('Ruby') expect(ruby.name).to eq('Ruby')
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe API::Gitignores, api: true do describe API::Templates, api: true do
include ApiHelpers include ApiHelpers
describe 'Entity Gitignore' do describe 'the Template Entity' do
before { get api('/gitignores/Ruby') } before { get api('/gitignores/Ruby') }
it { expect(json_response['name']).to eq('Ruby') } it { expect(json_response['name']).to eq('Ruby') }
it { expect(json_response['content']).to include('*.gem') } it { expect(json_response['content']).to include('*.gem') }
end end
describe 'Entity GitignoresList' do describe 'the TemplateList Entity' do
before { get api('/gitignores') } before { get api('/gitignores') }
it { expect(json_response.first['name']).not_to be_nil } it { expect(json_response.first['name']).not_to be_nil }
it { expect(json_response.first['content']).to be_nil } it { expect(json_response.first['content']).to be_nil }
end end
describe 'GET /gitignores' do context 'requesting gitignores' do
it 'returns a list of available license templates' do describe 'GET /gitignores' do
get api('/gitignores') it 'returns a list of available gitignore templates' do
get api('/gitignores')
expect(response.status).to eq(200)
expect(json_response).to be_an Array
expect(json_response.size).to be > 15
end
end
end
context 'requesting gitlab-ci-ymls' do
describe 'GET /gitlab_ci_ymls' do
it 'returns a list of available gitlab_ci_ymls' do
get api('/gitlab_ci_ymls')
expect(response.status).to eq(200)
expect(json_response).to be_an Array
expect(json_response.first['name']).not_to be_nil
end
end
end
describe 'GET /gitlab_ci_ymls/Ruby' do
it 'adds a disclaimer on the top' do
get api('/gitlab_ci_ymls/Ruby')
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(json_response).to be_an Array expect(json_response['content']).to start_with("# This file is a template,")
expect(json_response.size).to be > 15
end end
end end
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
*.apk *.apk
*.ap_ *.ap_
# Files for the Dalvik VM # Files for the ART/Dalvik VM
*.dex *.dex
# Java class files # Java class files
...@@ -34,6 +34,7 @@ captures/ ...@@ -34,6 +34,7 @@ captures/
# Intellij # Intellij
*.iml *.iml
.idea/workspace.xml
# Keystore files # Keystore files
*.jks *.jks
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# Fortran module files # Fortran module files
*.mod *.mod
*.smod
# Compiled Static libraries # Compiled Static libraries
*.lai *.lai
......
...@@ -4,3 +4,4 @@ CMakeScripts ...@@ -4,3 +4,4 @@ CMakeScripts
Makefile Makefile
cmake_install.cmake cmake_install.cmake
install_manifest.txt install_manifest.txt
CTestTestfile.cmake
...@@ -18,3 +18,7 @@ ...@@ -18,3 +18,7 @@
.dub .dub
docs.json docs.json
__dummy.html __dummy.html
docs/
# Code coverage
*.lst
.DS_Store *.DS_Store
.AppleDouble .AppleDouble
.LSOverride .LSOverride
...@@ -15,6 +15,7 @@ Icon ...@@ -15,6 +15,7 @@ Icon
.TemporaryItems .TemporaryItems
.Trashes .Trashes
.VolumeIcon.icns .VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share # Directories potentially created on remote AFP share
.AppleDB .AppleDB
......
## Globally Useful gitignores
This directory contains globally useful gitignores,
e.g. OS-specific and editor specific.
For more on global gitignores:
<https://help.github.com/articles/ignoring-files/#create-a-global-gitignore>
And a good blog post about 'em:
<http://augustl.com/blog/2009/global_gitignores>
...@@ -12,3 +12,16 @@ ...@@ -12,3 +12,16 @@
# sftp configuration file # sftp configuration file
sftp-config.json sftp-config.json
# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
bh_unicode_properties.cache
# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings
...@@ -16,3 +16,4 @@ cabal.sandbox.config ...@@ -16,3 +16,4 @@ cabal.sandbox.config
*.hp *.hp
*.eventlog *.eventlog
.stack-work/ .stack-work/
cabal.project.local
*.jl.cov
*.jl.*.cov
*.jl.mem
deps/deps.jl
Copyright (c) 2016 GitHub, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
...@@ -7,7 +7,6 @@ app/storage/ ...@@ -7,7 +7,6 @@ app/storage/
# Laravel 5 & Lumen specific # Laravel 5 & Lumen specific
bootstrap/cache/ bootstrap/cache/
storage/
.env.*.php .env.*.php
.env.php .env.php
.env .env
......
...@@ -24,6 +24,8 @@ xcuserdata/ ...@@ -24,6 +24,8 @@ xcuserdata/
## Obj-C/Swift specific ## Obj-C/Swift specific
*.hmap *.hmap
*.ipa *.ipa
*.dSYM.zip
*.dSYM
# CocoaPods # CocoaPods
# #
...@@ -49,3 +51,10 @@ Carthage/Build ...@@ -49,3 +51,10 @@ Carthage/Build
fastlane/report.xml fastlane/report.xml
fastlane/screenshots fastlane/screenshots
#Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
...@@ -34,5 +34,5 @@ Makefile* ...@@ -34,5 +34,5 @@ Makefile*
*.qmlproject.user.* *.qmlproject.user.*
# QtCtreator CMake # QtCtreator CMake
CMakeLists.txt.user CMakeLists.txt.user*
# .gitignore templates
This directory contains language-specific .gitignore templates that are used by GitLab.
These files were automatically pulled from [this repository](https://github.com/github/gitignore).
Please submit pull requests to that repository. There is no need to edit the files in this directory.
## Bulk Update
To update this directory with the latest changes in the repository, run:
```sh
bundle exec rake gitlab:update_gitignore
```
...@@ -16,6 +16,10 @@ pickle-email-*.html ...@@ -16,6 +16,10 @@ pickle-email-*.html
config/initializers/secret_token.rb config/initializers/secret_token.rb
config/secrets.yml config/secrets.yml
# dotenv
# TODO Comment out this rule if environment variables can be committed
.env
## Environment normalization: ## Environment normalization:
/.bundle /.bundle
/vendor/bundle /vendor/bundle
......
...@@ -24,6 +24,8 @@ xcuserdata/ ...@@ -24,6 +24,8 @@ xcuserdata/
## Obj-C/Swift specific ## Obj-C/Swift specific
*.hmap *.hmap
*.ipa *.ipa
*.dSYM.zip
*.dSYM
## Playgrounds ## Playgrounds
timeline.xctimeline timeline.xctimeline
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
*.suo *.suo
*.opensdf *.opensdf
*.sdf *.sdf
*.VC.db
*.VC.opendb *.VC.opendb
# Precompiled Assets # Precompiled Assets
......
...@@ -42,6 +42,7 @@ dlldata.c ...@@ -42,6 +42,7 @@ dlldata.c
# DNX # DNX
project.lock.json project.lock.json
project.fragment.lock.json
artifacts/ artifacts/
*_i.c *_i.c
......
# Official docker image.
image: docker:latest
build:
stage: build
script:
- docker build -t test .
# This template uses the non default language docker image
# The image already has Hex installed. You might want to consider to use `elixir:latest`
image: trenpixster/elixir:latest
# Pic zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
services:
- mysql:latest
- redis:latest
- postgres:latest
before_script:
- mix deps.get
mix:
script:
- mix test
The MIT License (MIT)
Copyright (c) 2016 GitLab.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:latest
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
services:
- mysql:latest
- redis:latest
- postgres:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
test_async:
script:
- npm install
- node ./specs/start.js ./specs/async.spec.js
test_db:
script:
- npm install
- node ./specs/start.js ./specs/db-postgres.spec.js
# Full project: https://gitlab.com/pages/brunch
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install -g brunch
- brunch build --production
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/doxygen
image: alpine
pages:
script:
- apk update && apk add doxygen
- doxygen doxygen/Doxyfile
- mv doxygen/documentation/html/ public/
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/harp
image: node:4.2.2
pages:
cache:
paths:
- node_modules
script:
- npm install -g harp
- harp compile ./ public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/hexo
image: python:2.7
cache:
paths:
- vendor/
test:
stage: test
script:
- pip install hyde
- hyde gen
except:
- master
pages:
stage: deploy
script:
- pip install hyde
- hyde gen -d public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/plain-html
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/hugo
image: publysher/hugo
pages:
script:
- hugo
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
cache:
paths:
- vendor/
test:
stage: test
script:
- pip install hyde
- hyde gen
except:
- master
pages:
stage: deploy
script:
- pip install hyde
- hyde gen -d public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/jekyll
image: ruby:2.3
test:
stage: test
script:
- gem install jekyll
- jekyll build -d test
artifacts:
paths:
- test
except:
- master
pages:
stage: deploy
script:
- gem install jekyll
- jekyll build -d public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
pages:
script:
- pip install lektor
- lektor build --output-path public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/metalsmith
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install -g metalsmith
- npm install
- make build
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/middleman
image: ruby:2.3
cache:
paths:
- vendor
test:
script:
- apt-get update -yqqq
- apt-get install -y nodejs
- bundle install --path vendor
- bundle exec middleman build
except:
- master
pages:
script:
- apt-get update -yqqq
- apt-get install -y nodejs
- bundle install --path vendor
- bundle exec middleman build
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/nanoc
image: ruby:2.3
pages:
script:
- bundle install -j4
- nanoc
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/octopress
image: ruby:2.3
pages:
script:
- apt-get update -qq && apt-get install -qq nodejs
- bundle install -j4
- bundle exec rake generate
- mv public .public
- mv .public/octopress public
artifacts:
paths:
- public
only:
- master
# Full project: https://gitlab.com/pages/pelican
image: python:2.7-alpine
pages:
script:
- pip install -r requirements.txt
- pelican -s publishconf.py
artifacts:
paths:
- public/
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/ruby/tags/
image: "ruby:2.3"
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service
services:
- mysql:latest
- redis:latest
- postgres:latest
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres
before_script:
- gem install bundler # Bundler is not installed with the image
- bundle install -j $(nproc) # Install dependencies
rubocop:
script:
- rubocop
rspec:
script:
- rspec spec
rails:
script:
- rake db:migrate
- rspec spec
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment