Skip to content
Snippets Groups Projects
Commit 4b6d05ea authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Opsworks friendly.

parent d7763a85
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -93,8 +93,10 @@ ruby_block "Copy from example rack attack config" do
resource.group gitlab['group']
resource.mode 0644
resource.run_action :create
if resource.updated?
self.notifies :run, resources(bash: "Enable rack attack in application.rb"), :immediately
end
end
notifies :run, "bash[Enable rack attack in application.rb]", :immediately
end
 
bash "Enable rack attack in application.rb" do
Loading
Loading
@@ -218,8 +220,10 @@ when 'production'
resource.content IO.read("#{File.join(gitlab['path'], "lib", "support", "init.d", "gitlab")}")
resource.mode 0755
resource.run_action :create
if resource.updated?
self.notifies :run, resources(execute: "set gitlab to start on boot"), :immediately
end
end
notifies :run, "execute[set gitlab to start on boot]", :immediately
end
 
# Updates defaults so gitlab can boot on start. As per man pages of update-rc.d runs only if links do not exist
Loading
Loading
#
# Cookbook Name:: gitlab
# Recipe:: gitlab_shell_source
#
gitlab = node['gitlab']
# Merge environmental variables
gitlab = Chef::Mixin::DeepMerge.merge(gitlab,gitlab[gitlab['env']])
# 4. GitLab shell
## Clone gitlab shell
git gitlab['shell_path'] do
repository gitlab['shell_repository']
revision gitlab['shell_revision']
user gitlab['user']
group gitlab['group']
action :sync
end
#
# Cookbook Name:: gitlab
# Recipe:: gitlab_source
#
gitlab = node['gitlab']
# Merge environmental variables
gitlab = Chef::Mixin::DeepMerge.merge(gitlab,gitlab[gitlab['env']])
# 6. GitLab
## Clone the Source
git gitlab['path'] do
repository gitlab['repository']
revision gitlab['revision']
user gitlab['user']
group gitlab['group']
action :sync
end
Loading
Loading
@@ -11,15 +11,8 @@ gitlab = Chef::Mixin::DeepMerge.merge(gitlab,gitlab[gitlab['env']])
# Setup all package, user, etc. requirements of GitLab
include_recipe "gitlab::initial"
 
# 4. GitLab shell
## Clone gitlab shell
git gitlab['shell_path'] do
repository gitlab['shell_repository']
revision gitlab['shell_revision']
user gitlab['user']
group gitlab['group']
action :sync
end
# Fetch GitLab shell source code
include_recipe "gitlab::gitlab_shell_source"
 
# Configure GitLab shell
include_recipe "gitlab::gitlab_shell"
Loading
Loading
@@ -27,15 +20,8 @@ include_recipe "gitlab::gitlab_shell"
# Setup chosen database
include_recipe "gitlab::database_#{gitlab['database_adapter']}"
 
# 6. GitLab
## Clone the Source
git gitlab['path'] do
repository gitlab['repository']
revision gitlab['revision']
user gitlab['user']
group gitlab['group']
action :sync
end
# Fetch GitLab source code
include_recipe "gitlab::gitlab_source"
 
# Install required gems
include_recipe "gitlab::gems"
Loading
Loading
@@ -44,20 +30,7 @@ include_recipe "gitlab::gems"
include_recipe "gitlab::gitlab"
 
# Start GitLab if in production
if gitlab['env'] == 'production'
## Start Your GitLab Instance
service "gitlab" do
supports :start => true, :stop => true, :restart => true, :status => true
action :enable
end
file File.join(gitlab['home'], ".gitlab_start") do
owner gitlab['user']
group gitlab['group']
action :create_if_missing
notifies :start, "service[gitlab]"
end
end
include_recipe "gitlab::start"
 
# Setup and configure nginx
include_recipe "gitlab::nginx" if gitlab['env'] == 'production'
#
# Cookbook Name:: gitlab
# Recipe:: opsworks_setup
#
# Used for AWS OpsWorks configure section
# Fetch GitLab shell source code
include_recipe "gitlab::gitlab_shell_source"
# Configure GitLab shell
include_recipe "gitlab::gitlab_shell"
# Fetch GitLab source code
include_recipe "gitlab::gitlab_source"
# Install required gems
include_recipe "gitlab::gems"
# Configure GitLab
include_recipe "gitlab::gitlab"
# Start GitLab if in production
include_recipe "gitlab::start"
# Setup and configure nginx
include_recipe "gitlab::nginx" if gitlab['env'] == 'production'
\ No newline at end of file
#
# Cookbook Name:: gitlab
# Recipe:: opsworks_setup
#
# Used for AWS OpsWorks setup section
gitlab = node['gitlab']
# Merge environmental variables
gitlab = Chef::Mixin::DeepMerge.merge(gitlab,gitlab[gitlab['env']])
# Setup all package, user, etc. requirements of GitLab
include_recipe "gitlab::initial"
# Setup chosen database
include_recipe "gitlab::database_#{gitlab['database_adapter']}"
\ No newline at end of file
#
# Cookbook Name:: gitlab
# Recipe:: start
#
gitlab = node['gitlab']
# Merge environmental variables
gitlab = Chef::Mixin::DeepMerge.merge(gitlab,gitlab[gitlab['env']])
if gitlab['env'] == 'production'
## Start Your GitLab Instance
service "gitlab" do
supports :start => true, :stop => true, :restart => true, :status => true
action :enable
end
file File.join(gitlab['home'], ".gitlab_start") do
owner gitlab['user']
group gitlab['group']
action :create_if_missing
notifies :start, "service[gitlab]"
end
end
\ No newline at end of file
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