# HG changeset patch # User DJ Mountney <dj@gitlab.com> # Date 1502210427 25200 # Tue Aug 08 09:40:27 2017 -0700 # Node ID 78252781d6d2791efbafd8248c2bd45229a0301d # Parent 9cf9d132ba3119a07210a8f07d35593af4433747 Move the package attributes from being dynamically created to being declared. This causes some duplication for changing the install-dir, you need to change it in the attributes and in the gitlab project file if you want to change it. But we do not intent to change it ourselves, and may just drop the variable entirely in the future. diff --git a/config/software/gitlab-cookbooks.rb b/config/software/gitlab-cookbooks.rb --- a/config/software/gitlab-cookbooks.rb +++ b/config/software/gitlab-cookbooks.rb @@ -38,13 +38,6 @@ delete "#{install_dir}/embedded/cookbooks/gitlab-ee" end - # Create a package cookbook. - command "mkdir -p #{install_dir}/embedded/cookbooks/package/attributes" - erb dest: "#{install_dir}/embedded/cookbooks/package/attributes/default.rb", - source: 'cookbook_packages_default.erb', - mode: 0755, - vars: { install_dir: project.install_dir } - erb dest: "#{install_dir}/embedded/cookbooks/dna.json", source: 'dna.json.erb', mode: 0644, diff --git a/files/gitlab-cookbooks/package/attributes/default.rb b/files/gitlab-cookbooks/package/attributes/default.rb new file mode 100644 --- /dev/null +++ b/files/gitlab-cookbooks/package/attributes/default.rb @@ -0,0 +1,21 @@ +# Copyright:: Copyright (c) 2017 GitLab Inc +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Package attributes + +# Default location of install-dir is /opt/gitlab. +# DO NOT change this value unless you are building your own GitLab packages +default['package']['install-dir'] = '/opt/gitlab' diff --git a/spec/chef/fixture/package/attributes/default.rb b/spec/chef/fixture/package/attributes/default.rb deleted file mode 100644 --- a/spec/chef/fixture/package/attributes/default.rb +++ /dev/null @@ -1,1 +0,0 @@ -default['package']['install-dir'] = '/opt/gitlab' diff --git a/spec/chef_helper.rb b/spec/chef_helper.rb --- a/spec/chef_helper.rb +++ b/spec/chef_helper.rb @@ -33,7 +33,7 @@ config.platform = platform config.version = version - config.cookbook_path = ['spec/chef/fixture/', 'files/gitlab-cookbooks/'] + config.cookbook_path = ['files/gitlab-cookbooks/'] config.log_level = :error config.filter_run focus: true