Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tmp
.vagrant
.env
3 changes: 3 additions & 0 deletions builders/flight-action-api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ files/**/cache/
vendor
vendor
local
package-scripts/flight-action-api/*
opt/flight/etc/service/types/action-api/*.sh
opt/flight/opt/action-api/bin/start
25 changes: 18 additions & 7 deletions builders/flight-action-api/config/projects/flight-action-api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@

install_dir '/opt/flight/opt/action-api'

VERSION = '1.4.0'
override 'flight-action-api', version: VERSION
VERSION = '1.5.0'
override 'flight-action-api', version: ENV.fetch('ALPHA', VERSION)

build_version VERSION
build_iteration 4
build_version(ENV.key?('ALPHA') ? VERSION.sub(/(-\w+)?\Z/, '-alpha') : VERSION)
build_iteration 1

dependency 'preparation'
dependency 'update_puma_scripts'
dependency 'update_web_suite_package_scripts'
dependency 'flight-action-api'
dependency 'update_puma_scripts'
dependency 'update_web_suite_package_scripts'
dependency 'version-manifest'

license 'EPL-2.0'
Expand All @@ -60,6 +62,14 @@
runtime_dependency 'flight-service'
runtime_dependency 'flight-service-system-1.0'

if ohai['platform_family'] == 'rhel'
runtime_dependency 'flight-service >= 1.3.0'
elsif ohai['platform_family'] == 'debian'
runtime_dependency 'flight-service (>= 1.3.0)'
else
raise "Unrecognised platform: #{ohai['platform_family']}"
end

require 'find'
Find.find('opt') do |o|
extra_package_file(o) if File.file?(o)
Expand All @@ -71,9 +81,10 @@
File.write path, content
end

%w(nodes.yaml application.yaml).each do |cf|
config_file "/opt/flight/opt/action-api/config/#{cf}"
end
config_file "/opt/flight/opt/action-api/etc/action-api.yaml"
# Deprecated paths
config_file "/opt/flight/opt/action-api/config/application.yaml"
config_file "/opt/flight/opt/action-api/config/nodes.yaml"

package :rpm do
vendor 'Alces Flight Ltd'
Expand Down
26 changes: 16 additions & 10 deletions builders/flight-action-api/config/software/flight-action-api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,33 @@
build do
env = with_standard_compiler_flags(with_embedded_path)

# Create the etc/libexec directory
mkdir File.join(install_dir, 'etc')
mkdir File.join(install_dir, 'libexec')

# Moves the project into place
[
'Gemfile', 'Gemfile.lock', 'bin', 'config', 'app',
'LICENSE.txt', 'README.md', 'app.rb', 'config.ru', 'Rakefile',
'.cli-version'
'.cli-version', 'etc/action-api.yaml'
].each do |file|
copy file, File.expand_path("#{install_dir}/#{file}/..")
end

# Patch the development port to the production address
# Define the legacy config paths
# NOTE: This prevents rpm from creating an rpmsave file on upgrade
# Instead the deprecation notice becomes an rpmnew
block do
path = File.join(install_dir, 'config/puma.rb')
File.write(path, File.read(path).sub(/^port.*$/, 'bind "tcp://127.0.0.1:917"'))
{ 'application.yaml' => "action-api.yaml", 'nodes.yaml' => "nodes.yaml" }.each do |file, new_file|
File.write File.join(install_dir, 'config', file), <<~WARN
__meta__: >
The use of this file has been deprecated!
Please refer to the new file:
#{File.join install_dir, 'etc', new_file}
WARN
end
end

# Create the blank nodes file
touch File.join(install_dir, 'config/nodes.yaml')

# Create the libexec directory where other packages will install scripts.
mkdir File.expand_path("#{install_dir}/libexec/")

# Installs the gems to the shared `vendor/share`
flags = [
"--without development test",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
: '
: NAME: action-api
: SYNOPSIS: Flight Action API server
: VERSION: 1.4.0
: VERSION: 1.5.0
: ROOT: true
: '
#==============================================================================
Expand Down
Loading