Skip to content

Commit 5c5c2f9

Browse files
Updated sqitch version.
Signed-off-by: sreepuramsudheer <[email protected]>
1 parent cf7f6c0 commit 5c5c2f9

File tree

14 files changed

+115
-18
lines changed

14 files changed

+115
-18
lines changed

omnibus/config/software/sqitch.rb

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#
2+
# Copyright 2014 Chef Software, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name "sqitch"
18+
default_version "1.4.1"
19+
20+
skip_transitive_dependency_licensing true
21+
22+
license "MIT"
23+
license_file "https://raw.githubusercontent.com/theory/sqitch/master/README.md"
24+
25+
dependency "perl"
26+
dependency "cpanminus"
27+
28+
# install a LGPL-licensed version of libintl-perl:
29+
dependency "libintl-perl"
30+
31+
# version_list: url=https://github.com/theory/#{name}/releases/download/v#{version}/ filter=app-sqitch-*.tar.gz
32+
version("1.4.1") { source sha256: "caf31cc8f772e3a4c9d4b3ff3a8f684a6eb5b1b3c261f4ddc0f90a88c36007c6" }
33+
version("1.4.0") { source sha256: "b0db387031f77562662e003bc55d7a102a26380b4ad7fdb9a8a3bad5769e501c" }
34+
version("1.3.1") { source sha256: "f5e768d298cd4047ee2ae42319782e8c2cda312737bcbdbfaf580bd47efe8b94" }
35+
version("1.3.0") { source sha256: "7d07635ec77a7faf3c50281c76ec833c68702f14470996cb2203a8bc6abc5bf2" }
36+
version("1.2.1") { source sha256: "020835a13429effd8fda12d5627604ecf99293775918f4f8ba9ccc5ed796e5e7" }
37+
version("1.1.0") { source sha256: "ee146cd75d6300837e6ca559bb0bde247d42123c96b2c5d4b2800f38d3e3d1ab" }
38+
version("0.9999") { source sha256: "f5bfa80206738ab8a70358a3b0557661c7459e11ec07dece23ecafa1f34372b3" }
39+
version("0.973") { source sha256: "95fc7f18fff786c5d2579133e2e3ac56779e54bb3a06a1af1117054e9f49ab32" }
40+
41+
if version >= "1.1.0"
42+
source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-v#{version}.tar.gz"
43+
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
44+
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
45+
relative_path "App-Sqitch-v#{version}"
46+
else
47+
source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-#{version}.tar.gz"
48+
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
49+
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
50+
relative_path "App-Sqitch-#{version}"
51+
end
52+
53+
# See https://github.com/theory/sqitch for more
54+
build do
55+
env = with_standard_compiler_flags(with_embedded_path)
56+
# Lists-MoreUtils-XS does not build on RHEL 5 or SUSE 11 currently.
57+
# This option is used by the Lists-MoreUtils build configuration to
58+
# decide whether to use the -XS package or a pure perl
59+
# implementation.
60+
env["PERL_MM_OPT"] = "PUREPERL_ONLY=1"
61+
command "perl Build.PL", env: env
62+
command "./Build installdeps --cpan_client 'cpanm -v --notest'", env: env
63+
command "./Build", env: env
64+
command "./Build install", env: env
65+
66+
# Here is another licensing fun. Some of the dependencies of sqitch
67+
# unfortunately have GPL3 and LGPL3 licenses which are requiring us to remove
68+
# them from our packages after installing sqitch. Here we are uninstalling
69+
# them without breaking the licensing information collection.
70+
%w{Test-MockModule}.each do |package_name|
71+
module_name = package_name.gsub("-", "::")
72+
73+
# Here we run cpanm --uninstall with a different PERL_CPANM_HOME. The reason
74+
# for this is to keep the licensing information for sqitch intact. The way
75+
# license_scout works is to look into PERL_CPANM_HOME/latest-build (by
76+
# default ~/.cpanm/latest-build) which contains the modules installed during
77+
# the last install. This directory is a symlink that points to the directory
78+
# contains the information about the latest build. Without changing
79+
# PERL_CPANM_HOME we would overwrite the link and will not be able to
80+
# collect the dependencies installed to our package while doing the actual
81+
# sqitch install.
82+
Dir.mktmpdir do |tmpdir|
83+
command "cpanm --force --uninstall #{module_name}", env: env.merge({
84+
"PERL_CPANM_HOME" => tmpdir,
85+
})
86+
end
87+
88+
# Here we are removing the problematic package from the original
89+
# PERL_CPANM_HOME cache directory. This ensures that we do not add
90+
# licensing information about these components to our package.
91+
cpanm_root = File.expand_path("~/.cpanm/latest-build")
92+
delete "#{cpanm_root}/#{package_name}*"
93+
end
94+
95+
end

omnibus/files/server-ctl-cookbooks/infra-server/resources/pg_sqitch.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
converge_by "Deploying schema from #{new_resource.name}" do
3030
execute "sqitch_deploy_#{new_resource.name}" do
3131
command <<-EOM.gsub(/\s+/, ' ').strip!
32-
sqitch --engine pg
33-
--db-name #{new_resource.database}
32+
sqitch --db-name #{new_resource.database}
3433
--db-host #{new_resource.hostname}
3534
--db-port #{new_resource.port}
3635
--db-user #{new_resource.username}
37-
--top-dir #{new_resource.name}
36+
--chdir #{new_resource.name}
3837
deploy #{target} --verify
3938
EOM
4039
environment 'PERL5LIB' => "/opt/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/embedded/lib", # force us to use omnibus perl

omnibus/partybus/lib/partybus/migration_api/v1.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ def run_command(command, options={})
6868
def run_sqitch(target, service, opts = {})
6969
options = default_opts_for_service(service).merge(opts)
7070
command = <<-EOM.gsub(/\s+/," ").strip!
71-
sqitch --engine pg
72-
--db-name #{options[:database]}
71+
sqitch --db-name #{options[:database]}
7372
--db-host #{Partybus.config.postgres['vip']}
7473
--db-port #{Partybus.config.postgres['port']}
7574
--db-user #{options[:username]}
76-
--top-dir /opt/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/embedded/service/#{options[:path]}
75+
--chdir /opt/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/embedded/service/#{options[:path]}
7776
deploy #{target} --verify
7877
EOM
7978
run_command(command, env: {"PGPASSWORD" => options[:password]})

omnibus_overrides.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
override :perl, version: "5.34.0"
1111
override :redis, version: "5.0.14"
1212
override :runit, version: "2.1.1" #standalone upgrade is failing, Needs to be reverted to 2.1.2 after fixing the umbrella
13-
override :sqitch, version: "0.973"
13+
# override :sqitch, version: "1.4.0"
1414

1515
override :logrotate, version: "3.19.0"
1616

src/bookshelf/habitat/config/database-migrations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ createdb $PG_ARGS $DB "bookshelf"
3434
psql $PG_ARGS --command 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"' $DB
3535

3636
cd "{{pkg.path}}/schema" || exit
37-
sqitch --quiet --engine pg deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"
37+
sqitch --quiet deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"

src/bookshelf/habitat/plan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ pkg_deps=(
77
core/cacerts
88
core/coreutils
99
core/gcc-libs
10-
core/sqitch_pg
10+
core/sqitch
11+
core/postgresql-client
1112
)
1213
pkg_build_deps=(core/make core/git core/gcc)
1314
pkg_bin_dirs=(bin)

src/oc-id/habitat/plan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ pkg_origin=chef
33
pkg_maintainer="The Chef Server Maintainers <[email protected]>"
44
pkg_license=('Apache-2.0')
55
pkg_deps=(
6-
core/sqitch_pg
6+
core/sqitch
7+
core/postgresql-client
78
core/curl
89
core/node14
910
core/ruby31/3.1.6/20240912144513

src/oc_bifrost/habitat/config/database-migrations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ createdb $PG_ARGS $DB "oc_bifrost"
3434
psql $PG_ARGS --command 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"' $DB
3535

3636
cd "{{pkg.path}}/schema" || exit
37-
sqitch --quiet --engine pg deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"
37+
sqitch --quiet deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"

src/oc_bifrost/habitat/plan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ pkg_deps=(
88
core/coreutils
99
core/curl
1010
core/gcc-libs
11-
core/sqitch_pg
11+
core/sqitch
12+
core/postgresql-client
1213
)
1314
pkg_build_deps=(core/make core/git core/gcc)
1415
pkg_bin_dirs=(bin)

src/oc_bifrost/schema/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ setup:
1111
@createdb $(TEST_DB)
1212
@psql --dbname $(TEST_DB) --command 'CREATE EXTENSION pgtap;'
1313
@psql --dbname $(TEST_DB) --single-transaction --set ON_ERROR_STOP=1 --file t/custom_test_functions.sql
14-
@sqitch --engine pg --db-name $(TEST_DB) deploy
14+
@sqitch --db-name $(TEST_DB) deploy
1515
@psql --dbname $(TEST_DB) --single-transaction --set ON_ERROR_STOP=1 --file sql/create_roles.sql
1616
@psql --dbname $(TEST_DB) --single-transaction --set ON_ERROR_STOP=1 --set database_name=$(TEST_DB) --file sql/permissions.sql
1717

src/oc_erchef/habitat/config/database-migrations.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ createdb $PG_ARGS $DB "oc_bifrost"
3434
psql $PG_ARGS --command 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"' $DB
3535

3636
cd "{{pkg.path}}/schema/baseline"
37-
sqitch --quiet --engine pg deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"
37+
sqitch --quiet deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"
3838

3939
cd "{{pkg.path}}/schema"
40-
sqitch --quiet --engine pg deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"
40+
sqitch --quiet deploy "db:pg://${USER}:${PASS}@${HOST}/$DB"

src/oc_erchef/habitat/plan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ pkg_deps=(
1010
core/openssl
1111
core/gcc-libs
1212
core/ruby31/3.1.6/20240912144513
13-
core/sqitch_pg
13+
core/sqitch
14+
core/postgresql-client
1415
core/gecode
1516
core/libffi
1617
core/glibc

src/oc_erchef/schema/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ all : setup_schema setup_tests test
1616
setup_schema:
1717
$(MAKE) -C baseline setup_schema
1818
@echo "Deploying Enterprise Chef Server Schema on top..."
19-
@sqitch --engine pg --db-name $(TEST_DB) deploy --verify
19+
@sqitch --db-name $(TEST_DB) deploy --verify
2020

2121
# Load up all testing functions. pgTAP libraries and open source
2222
# schema test functions are loaded by the open source makefile target

src/oc_erchef/schema/baseline/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ setup_schema:
88
@echo "Dropping and recreating database '$(TEST_DB)'"
99
@psql --dbname template1 --command 'DROP DATABASE IF EXISTS $(TEST_DB)'
1010
@createdb $(TEST_DB)
11-
@sqitch --engine pg --db-name $(TEST_DB) deploy
11+
@sqitch --db-name $(TEST_DB) deploy
1212

1313
setup_tests:
1414
@psql --dbname $(TEST_DB) --command 'CREATE EXTENSION pgtap;'

0 commit comments

Comments
 (0)