Skip to content
Snippets Groups Projects
Commit 2e851965 authored by Ian Baum's avatar Ian Baum Committed by DJ Mountney
Browse files

Improve handling of postgresql['version'] in pg-upgrade

* Don't exit 1 if it is set
* Clarify the language when it is found
parent 79dcb605
No related branches found
No related tags found
No related merge requests found
---
title: Add PostgreSQL 11 as an alpha database version
merge_request: 3858
author:
type: other
--- GNUmakefile.in.original 2016-12-19 06:01:36.664961781 -0500
+++ GNUmakefile.in 2016-12-19 06:02:15.872961781 -0500
@@ -16,7 +16,7 @@
docs:
$(MAKE) -C doc all
-$(call recurse,world,doc src config contrib,all)
+$(call recurse,world,src config contrib,all)
world:
+@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install."
@@ -32,7 +32,7 @@
install-docs:
$(MAKE) -C doc install
-$(call recurse,install-world,doc src config contrib,install)
+$(call recurse,install-world,src config contrib,install)
install-world:
+@echo "PostgreSQL, contrib, and documentation installation complete."
Loading
Loading
@@ -43,6 +43,7 @@ dependency 'rsync'
dependency 'libicu'
dependency 'postgresql'
dependency 'postgresql_new'
dependency 'postgresql_alpha'
dependency 'python-docutils'
dependency 'krb5'
dependency 'registry'
Loading
Loading
#
# Copyright 2012-2014 Chef Software, Inc.
# Copyright:: Copyright (c) 2016 GitLab Inc.
#
# 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.
#
name 'postgresql_alpha'
default_version '11.6'
license 'PostgreSQL'
license_file 'COPYRIGHT'
skip_transitive_dependency_licensing true
dependency 'zlib'
dependency 'openssl'
dependency 'libedit'
dependency 'ncurses'
dependency 'libossp-uuid'
dependency 'config_guess'
version '11.6' do
source sha256: '49924f7ff92965fdb20c86e0696f2dc9f8553e1563124ead7beedf8910c13170'
end
# PostgreSQL 10 and up should have a major version of 10, not 10.0.
# See: https://www.postgresql.org/support/versioning
#
# Be sure to update files/gitlab-cookbooks/postgresql/recipes/enable.rb when
# upgrading.
major_version = '11'
source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"
relative_path "postgresql-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
prefix = "#{install_dir}/embedded/postgresql/#{major_version}"
update_config_guess(target: 'config')
patch source: 'no_docs.patch', target: 'GNUmakefile.in'
command './configure' \
" --prefix=#{prefix}" \
' --with-libedit-preferred' \
' --with-openssl' \
' --with-ossp-uuid', env: env
make "world -j #{workers}", env: env
make 'install-world', env: env
end
# exclude headers and static libraries from package
project.exclude "embedded/bin/pg_config"
project.exclude "embedded/postgresql/#{major_version}/include"
project.exclude "embedded/postgresql/#{major_version}/lib/*.a"
project.exclude "embedded/postgresql/#{major_version}/lib/pgxs"
project.exclude "embedded/postgresql/#{major_version}/lib/pkgconfig"
Loading
Loading
@@ -89,6 +89,15 @@ add_command_under_category 'pg-upgrade', 'database',
Kernel.exit 0
end
 
unless GitlabCtl::Util.progress_message(
"Checking if postgresql['version'] is set"
) do
@attributes['postgresql']['version'].nil?
end
log "postgresql['version'] is set in /etc/gitlab/gitlab.rb. Not checking for a PostgreSQL upgrade"
Kernel.exit 0
end
log 'Checking for a newer version of PostgreSQL to install'
if upgrade_version && Dir.exist?("#{INST_DIR}/#{upgrade_version.major}")
log "Upgrading PostgreSQL to #{upgrade_version}"
Loading
Loading
@@ -116,15 +125,6 @@ add_command_under_category 'pg-upgrade', 'database',
Kernel.exit 1
end
 
unless GitlabCtl::Util.progress_message(
"Checking if postgresql['version'] is set"
) do
@attributes['postgresql']['version'].nil?
end
log "postgresql['version'] is set in /etc/gitlab/gitlab.rb. Please remove this and run gitlab-ctl reconfigure before proceeding "
Kernel.exit 1
end
# The current instance needs to be running, start it if it isn't
unless @db_worker.running?
log 'Starting the database'
Loading
Loading
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