mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge pull request #3071 from xrousset78800/PHRAS-2565/prompt-for-provisioning
PHRAS-2565 #comment merge Add prompt for selecting prebuilt box from vagrant hub or build a new box and for build local form Xenial and PHP 7
This commit is contained in:
21
README.md
21
README.md
@@ -10,6 +10,10 @@ Phraseanet 4.1 - Digital Asset Management application
|
|||||||
- Elasticsearch search engine
|
- Elasticsearch search engine
|
||||||
- Multiple resolution assets generation
|
- Multiple resolution assets generation
|
||||||
|
|
||||||
|
# License :
|
||||||
|
|
||||||
|
Phraseanet is licensed under GPL-v3 license.
|
||||||
|
|
||||||
# Documentation :
|
# Documentation :
|
||||||
|
|
||||||
https://docs.phraseanet.com/
|
https://docs.phraseanet.com/
|
||||||
@@ -31,17 +35,22 @@ https://www.phraseanet.com/download/
|
|||||||
# Development :
|
# Development :
|
||||||
|
|
||||||
For development purpose Phraseanet is shipped with ready to use development environments using vagrant.
|
For development purpose Phraseanet is shipped with ready to use development environments using vagrant.
|
||||||
|
You can easily choose betweeen a complete build or a prebuild box, with a specific PHP version.
|
||||||
|
|
||||||
- git clone
|
git clone
|
||||||
- vagrant up
|
vagrant up --provision
|
||||||
|
|
||||||
|
then, a prompt allow you to choose PHP version, and another one to choose a complete build or an Alchemy prebuilt boxes.
|
||||||
|
|
||||||
|
Ex:
|
||||||
|
- vagrant up --provision //// 5.6 ///// 1 >> Build an ubuntu/xenial box with php5.6
|
||||||
|
- vagrant up --provision //// 7.0 ///// 1 >> Build an ubuntu/xenial with php7.0
|
||||||
|
- vagrant up --provision //// 7.2 ///// 2 >> Build the alchemy/phraseanet-php-7.2 box
|
||||||
|
- vagrant up --provision //// 5.6 ///// 1 >> Build the alchemy/phraseanet-php-5.6 box
|
||||||
|
|
||||||
|
|
||||||
For development with Phraseanet API see https://docs.phraseanet.com/4.0/en/Devel/index.html
|
For development with Phraseanet API see https://docs.phraseanet.com/4.0/en/Devel/index.html
|
||||||
|
|
||||||
# License :
|
|
||||||
|
|
||||||
Phraseanet is licensed under GPL-v3 license.
|
|
||||||
|
|
||||||
|
|
||||||
# Docker build
|
# Docker build
|
||||||
|
|
||||||
|
56
Vagrantfile
vendored
56
Vagrantfile
vendored
@@ -11,6 +11,7 @@ class MyCustomError < StandardError
|
|||||||
"[#{code} #{super}]"
|
"[#{code} #{super}]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check to determine whether we're on a windows or linux/os-x host,
|
# Check to determine whether we're on a windows or linux/os-x host,
|
||||||
# later on we use this to launch ansible in the supported way
|
# later on we use this to launch ansible in the supported way
|
||||||
# source: https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby
|
# source: https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby
|
||||||
@@ -34,15 +35,52 @@ else if which('ifconfig')
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
$php = [ "5.6", "7.0", "7.1", "7.2" ]
|
|
||||||
$phpVersion = ENV['phpversion'] ? ENV['phpversion'] : "7.0";
|
|
||||||
|
|
||||||
unless Vagrant.has_plugin?('vagrant-hostmanager')
|
unless Vagrant.has_plugin?('vagrant-hostmanager')
|
||||||
raise "vagrant-hostmanager is not installed! Please run\n vagrant plugin install vagrant-hostmanager\n\n"
|
raise "vagrant-hostmanager is not installed! Please run\n vagrant plugin install vagrant-hostmanager\n\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
unless $php.include?($phpVersion)
|
if ARGV[1] == '--provision'
|
||||||
raise "You should specify php version before running vagrant\n\n (Available : 5.6, 7.0, 7.1, 7.2 | default => 5.6)\n\n Exemple: phpversion='7.0' vagrant up \n\n"
|
print "\033[34m \nChoose a Build type :\n\n(1) Use prebuilt Phraseanet Box\n(2) Build Phraseanet from scratch (xenial)\n\033[00m"
|
||||||
|
type = STDIN.gets.chomp
|
||||||
|
print "\n"
|
||||||
|
# Switch between Phraseanet box and native trusty64
|
||||||
|
case (type)
|
||||||
|
when '1'
|
||||||
|
$box = "alchemy/Phraseanet-vagrant-dev_php"
|
||||||
|
when '2'
|
||||||
|
$box = "ubuntu/xenial64"
|
||||||
|
print("\033[91mComplete build selected, don't forget to uncomment all roles on playbook.yml\n\n\033[00m")
|
||||||
|
else
|
||||||
|
raise "\033[31mYou should specify Build type before running vagrant\n\n (Available : 1, 2)\n\n\033[00m"
|
||||||
|
end
|
||||||
|
print "\033[32m-----------------------------------------------\n"
|
||||||
|
print "Build with "+$box+" box\n"
|
||||||
|
print "-----------------------------------------------\n\n\033[00m"
|
||||||
|
|
||||||
|
print "\033[34mChoose a PHP version for your build (Available : 5.6, 7.0, 7.1, 7.2)\n\033[00m"
|
||||||
|
phpversion = STDIN.gets.chomp
|
||||||
|
print "\n"
|
||||||
|
# Php version selection
|
||||||
|
case (phpversion)
|
||||||
|
when "5.6", "7.0", "7.1", "7.2"
|
||||||
|
print "\033[32mSelected PHP version : "+phpversion+"\n\033[00m"
|
||||||
|
print "Continue ? (Y/n) \n"
|
||||||
|
continue = STDIN.gets.chomp
|
||||||
|
case continue
|
||||||
|
when 'n', 'no', 'N', 'NO'
|
||||||
|
raise "\033[31mBuild aborted\033[00m"
|
||||||
|
else
|
||||||
|
if (type == '1')
|
||||||
|
$box.concat(phpversion)
|
||||||
|
end
|
||||||
|
print "\033[32m-----------------------------------------------\n"
|
||||||
|
print "Build with PHP"+phpversion+"\n"
|
||||||
|
print "-----------------------------------------------\n\n\033[00m"
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
raise "\033[31mYou should specify php version before running vagrant\n\n (Available : 5.6, 7.0, 7.1, 7.2)\n\n\033[00m"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
$root = File.dirname(File.expand_path(__FILE__))
|
$root = File.dirname(File.expand_path(__FILE__))
|
||||||
@@ -119,14 +157,12 @@ Vagrant.configure("2") do |config|
|
|||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Switch between Phraseanet box and native trusty64
|
config.vm.box = ($box) ? $box : "ubuntu/xenial64"
|
||||||
config.vm.box = "alchemy/Phraseanet-vagrant-dev"
|
|
||||||
#config.vm.box = "ubuntu/trusty64"
|
|
||||||
|
|
||||||
# In case, Phraseanet box, choose the php version
|
# In case, Phraseanet box, choose the php version
|
||||||
# For php 7.0 use box 0.0.1
|
# For php 7.0 use box 0.0.1
|
||||||
# For php 7.1 use box 0.0.2
|
# For php 7.1 use box 0.0.2
|
||||||
config.vm.box_version = "0.0.1"
|
#config.vm.box_version = "0.0.1"
|
||||||
|
|
||||||
config.ssh.forward_agent = true
|
config.ssh.forward_agent = true
|
||||||
config_net(config)
|
config_net(config)
|
||||||
@@ -141,7 +177,7 @@ Vagrant.configure("2") do |config|
|
|||||||
ansible.extra_vars = {
|
ansible.extra_vars = {
|
||||||
hostname: $hostname,
|
hostname: $hostname,
|
||||||
host_addresses: $hostIps,
|
host_addresses: $hostIps,
|
||||||
phpversion: $phpVersion,
|
phpversion: phpversion,
|
||||||
postfix: {
|
postfix: {
|
||||||
postfix_domain: $hostname + ".vb"
|
postfix_domain: $hostname + ".vb"
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
apt: pkg=openjdk-7-jre state=latest
|
apt: pkg=openjdk-8-jre state=latest
|
||||||
|
|
||||||
- name: Remove temporary debian package
|
- name: Remove temporary debian package
|
||||||
shell: rm -f /tmp/elasticsearch-{{ elasticsearch.version }}.deb
|
shell: rm -f /tmp/elasticsearch-{{ elasticsearch.version }}.deb
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
- name: Add Key for MariaDB Repository
|
- name: Add Key for MariaDB Repository
|
||||||
sudo: yes
|
sudo: yes
|
||||||
apt_key: url=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xcbcb082a1bb943db
|
apt_key: url=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF1656F24C74CD1D8
|
||||||
|
|
||||||
# RabbitMQ
|
# RabbitMQ
|
||||||
- name: Add rabbitmq package repository
|
- name: Add rabbitmq package repository
|
||||||
|
@@ -34,12 +34,14 @@ server:
|
|||||||
- fr_FR.UTF-8
|
- fr_FR.UTF-8
|
||||||
- de_DE.UTF-8
|
- de_DE.UTF-8
|
||||||
- nl_NL.UTF-8
|
- nl_NL.UTF-8
|
||||||
|
|
||||||
repositories:
|
repositories:
|
||||||
php: 'ppa:ondrej/php'
|
php: 'ppa:ondrej/php'
|
||||||
mariadb: 'deb http://mirror6.layerjet.com/mariadb/repo/10.1/ubuntu'
|
mariadb: 'deb [arch=amd64,arm64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.3/ubuntu'
|
||||||
elasticsearch: 'ppa:webupd8team/java'
|
elasticsearch: 'ppa:webupd8team/java'
|
||||||
rabbitmq: 'deb http://www.rabbitmq.com/debian/ testing main'
|
rabbitmq: 'deb http://www.rabbitmq.com/debian/ testing main'
|
||||||
yarn: 'https://dl.yarnpkg.com/debian/'
|
yarn: 'https://dl.yarnpkg.com/debian/'
|
||||||
|
|
||||||
vagrant_local:
|
vagrant_local:
|
||||||
install: '1'
|
install: '1'
|
||||||
vm:
|
vm:
|
||||||
|
Reference in New Issue
Block a user