Skip to content

Commit

Permalink
Merge pull request #38 from sw360/mcj/feat/newversions
Browse files Browse the repository at this point in the history
new version ubuntu 20.04, couchdb 3.1.1 and liferay 7.3.4
  • Loading branch information
mcjaeger authored Apr 21, 2021
2 parents fa1a0cb + 3bc63d3 commit 258319c
Show file tree
Hide file tree
Showing 133 changed files with 5,610 additions and 2,963 deletions.
12 changes: 8 additions & 4 deletions download-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ set -eo pipefail
#
# downloading all the big downloads
#
packages='https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64-vagrant.box
https://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.3.3%20GA4/liferay-ce-portal-tomcat-7.3.3-ga4-20200701015330959.tar.gz
packages='https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-vagrant.box
https://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.3.4%20GA5/liferay-ce-portal-tomcat-7.3.4-ga5-20200811154319029.tar.gz
https://search.maven.org/remotecontent?filepath=commons-codec/commons-codec/1.12/commons-codec-1.12.jar commons-codec-1.12.jar
https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar commons-compress-1.20.jar
https://search.maven.org/remotecontent?filepath=org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar commons-collections4-4.4.jar
Expand Down Expand Up @@ -60,7 +60,7 @@ downloadAll(){
return
fi
if [ -e $2 ]; then
onlineSize=`wget $1 --spider --server-response -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}'`
onlineSize=`wget $1 --spider --server-response -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p;}'`
localSize=`wc -c < $2`
if [ "$onlineSize" = "$localSize" ]; then
echo "-[] The file $1 has the same size as the online version. No download."
Expand Down Expand Up @@ -96,6 +96,10 @@ cleanAll(){
echo "remove old xenial-server-cloudimg-amd64-vagrant.box (downloaded by old version of this script)"
rm xenial-server-cloudimg-amd64-vagrant.box
fi
if [ -e bionic-server-cloudimg-amd64-vagrant.box ]; then
echo "remove old bionic-server-cloudimg-amd64-vagrant.box (downloaded by old version of this script)"
rm bionic-server-cloudimg-amd64-vagrant.box
fi
echo "remove old liferay-tomcat-bundle versions"
rm liferay-portal-tomcat-6.2-ce-ga*.zip 2>/dev/null
}
Expand All @@ -114,7 +118,7 @@ setPermissions(){
popd &>/dev/null
}
addBoxToVagrant(){
vagrant box add --force bionic-server-cloudimg-amd64-vagrant "bionic-server-cloudimg-amd64-vagrant.box"
vagrant box add --force focal-server-cloudimg-amd64-vagrant "focal-server-cloudimg-amd64-vagrant.box"
vagrant box add --force aws-dummy "dummy.box"
}

Expand Down
3 changes: 2 additions & 1 deletion generate-box/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if SW360_provider == "virtualbox"

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = 'bionic-server-cloudimg-amd64-vagrant'
config.vm.box = 'focal-server-cloudimg-amd64-vagrant'
config.disksize.size = SW360_VB_DISK

# Virtualbox provider
Expand Down Expand Up @@ -91,6 +91,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

facts = {
"tomcat_admin_password" => SW360_default_password,
"couchdb_admin_password" => SW360_default_password,
"proxy_yes" => SW360_proxy,
"enable_mellon" => SW360_enable_mellon
}
Expand Down
33 changes: 28 additions & 5 deletions puppet/manifests/sw360-base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,60 @@

# Path definitions
$java_home='/usr/lib/jvm/java-11-openjdk-amd64/'
$tomcat_path='/opt/liferay-ce-portal-7.3.3-ga4/tomcat-9.0.33'
$puppet_does_not_allow_escaping='deb https://apache.bintray.com/couchdb-deb bionic main'
$tomcat_path='/opt/liferay-ce-portal-7.3.4-ga5/tomcat-9.0.33'
$puppet_does_not_allow_escaping='deb https://apache.bintray.com/couchdb-deb focal main'

package { ["software-properties-common", "unzip", "curl", "git-core", "maven", "openjdk-11-jdk", "postgresql-10", "apache2", "libapache2-mod-auth-mellon"]:
package { ["make", "software-properties-common", "unzip", "curl", "git-core", "maven", "openjdk-11-jdk", "postgresql", "apache2", "libapache2-mod-auth-mellon"]:
ensure => present,
}

##############################################################################
# bionic does not have couchdb anymore. need to install ppa and then couchdb # #
# since bionic ubuntu does not have couchdb anymore. need to install ppa # #
##############################################################################

exec { 'install-couchdb-add-repo-key':
path => ['/usr/bin', '/usr/sbin'],
command => "curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -",
}

exec { 'install-couchdb-add-repo-url':
path => ['/usr/bin', '/usr/sbin', '/usr/local/sbin', '/usr/local/bin', '/sbin', '/bin'],
command => "echo $puppet_does_not_allow_escaping | sudo tee -a /etc/apt/sources.list",
require => Exec['install-couchdb-add-repo-key'],
}

exec { 'install-couchdb-update-apt':
path => ['/usr/bin', '/usr/sbin'],
command => "sudo apt-get update -y",
require => Exec['install-couchdb-add-repo-url'],
}

exec { 'install-couchdb-install-finally':
path => ['/usr/bin', '/usr/sbin'],
command => "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y couchdb=2.1.2~bionic",
command => "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y couchdb=3.1.1~focal",
require => Exec['install-couchdb-update-apt'],
}

###################
## CouchDB Setup ##
###################

# local.ini: Setup of CouchDB bind port and bind adress
file { 'couchdb_local.ini':
path => '/opt/couchdb/etc/local.ini',
ensure => 'present',
owner => couchdb,
content => template('sw360/couchdb_local.ini.erb'),
notify => Service["couchdb"], # Will cause the service to restart
}

# Restart CouchDB
service { 'couchdb':
ensure => "running",
enable => "true",
require => File['couchdb_local.ini'],
}

##############################################################################
# User configuration, to create the siemagrant user when starting from a #
# standard box. #
Expand Down
76 changes: 46 additions & 30 deletions puppet/manifests/sw360-single.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
$couchdb_bind_port = '5984'

# Path definitions
$tomcat_path='/opt/liferay-ce-portal-7.3.3-ga4/tomcat-9.0.33'
$liferay_install='/opt/liferay-ce-portal-7.3.3-ga4'
$tomcat_path='/opt/liferay-ce-portal-7.3.4-ga5/tomcat-9.0.33'
$liferay_install='/opt/liferay-ce-portal-7.3.4-ga5'
$sw360_settings_path='/etc/sw360'

############################
Expand Down Expand Up @@ -63,25 +63,6 @@
password => postgresql_password('liferay', $liferay_admin_password),
}

###################
## CouchDB Setup ##
###################

# local.ini: Setup of CouchDB bind port and bind adress
file { 'couchdb_local.ini':
path => '/etc/couchdb/local.ini',
ensure => 'present',
owner => couchdb,
content => template('sw360/couchdb_local.ini.erb'),
notify => Service["couchdb"], # Will cause the service to restart
}

# Restart CouchDB
service { 'couchdb':
ensure => "running",
enable => "true",
}

##################
## Tomcat Setup ##
##################
Expand Down Expand Up @@ -139,15 +120,31 @@
}

# Configuration of the sw360 for accessing couchdb
# TODO central couchdb file does not work because it
# spoils the test configuration, leaving it on files in bundles
# file { 'couchdb.properties':
# path => "${sw360_settings_path}/couchdb.properties",
# content => template('sw360/couchdb.properties.erb'),
# owner => 'siemagrant',
# ensure => present,
# require => File['sw360-dir']
# }
file { 'couchdb.properties':
path => "${sw360_settings_path}/couchdb.properties",
content => template('sw360/couchdb.properties.erb'),
owner => 'siemagrant',
ensure => present,
require => File['sw360-dir']
}

# central couchdb file ...
file { 'couchdb_test.properties':
path => "${sw360_settings_path}/couchdb-test.properties",
content => template('sw360/couchdb-test.properties.erb'),
owner => 'siemagrant',
ensure => present,
require => File['sw360-dir']
}

# another "central" couchdb file ...
file { 'databasetest.properties':
path => "${sw360_settings_path}/databasetest.properties",
content => template('sw360/databasetest.properties.erb'),
owner => 'siemagrant',
ensure => present,
require => File['sw360-dir']
}

# Configuration of the sw360 itself
file { 'sw360.properties':
Expand All @@ -158,6 +155,25 @@
require => File['sw360-dir']
}

# creation of separate settings dir for authorization component
file { 'sw360-authorization-dir':
path => "${sw360_settings_path}/authorization",
owner => 'siemagrant',
group => 'siemagrant',
ensure => 'directory',
}

# Configuration of the sw360 rest api (spring stuff)
file { 'application-auth.yml':
path => "${sw360_settings_path}/authorization/application.yml",
content => template('sw360/application.yml.erb'),
owner => 'siemagrant',
ensure => present,
require => File['sw360-authorization-dir']
}

## todo setting for resource server for REST (runs with default settings)

###################
## Apache2 Setup ##
###################
Expand Down
Loading

0 comments on commit 258319c

Please sign in to comment.