Add packaging spec and config files

Change-Id: Ic685477e11dd28ba5db39752ffe532f518287654
This commit is contained in:
Honza Pokorny 2016-07-20 13:52:11 -03:00 committed by Haikel Guemar
parent bb2a8a11bd
commit 71cfdb0a8b
7 changed files with 3827 additions and 13 deletions

View File

@ -1 +1,3 @@
!node_modules.tar.gz
tripleo-ui-*.tgz
tripleo-ui-*.tar.gz

3683
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -62,12 +62,11 @@
"es6-promise": "~3.2.1"
},
"scripts": {
"test": "karma start --single-run",
"test:watch": "karma start",
"build": "webpack",
"lint": "eslint src",
"start": "webpack-dev-server --progress",
"prepublish": "sh packaging/prepublish.sh",
"build": "webpack"
"test": "karma start --single-run",
"test:watch": "karma start"
},
"repository": {
"type": "git",

View File

@ -0,0 +1,75 @@
%global sname openstack-tripleo-ui-deps
%global commit 38664a13b4a74f9bcca3384f6ad4184a298db140
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: %{sname}
Version: 1
Release: 2%{?dist}
Summary: Source dependencies for TripleO UI
License: ASL 2.0
URL: http://tripleo.org
# The source for this package was pulled from git. Use the following commands
# to generate the tarball.
#
# $ git clone https://github.com/openstack/tripleo-ui.git
# $ cd tripleo-ui
# $ git checkout %{commit}
# $ npm install
# $ tar czf tripleo-ui-deps-%{shortcommit}.tar.gz node_modules
Source0: tripleo-ui-deps-%{shortcommit}.tar.gz
BuildRequires: nodejs
BuildRequires: git
Requires: %{sname}-babel = %{version}-%{release}
Requires: %{sname}-phantomjs = %{version}-%{release}
Requires: %{sname}-webpack = %{version}-%{release}
%description
Source dependencies for TripleO UI
%package babel
Summary: Source dependencies for TripleO UI (babel)
%description babel
Source dependencies for TripleO UI (babel)
%package phantomjs
Summary: Source dependencies for TripleO UI (phantomjs)
%description phantomjs
Source dependencies for TripleO UI (phantomjs)
%package webpack
Summary: Source dependencies for TripleO UI (webpack)
%description webpack
Source dependencies for TripleO UI (webpack)
%prep
%autosetup -n node_modules -S git
%build
%install
mkdir -p %{buildroot}/opt/%{name}/
cp -rf %{_builddir}/node_modules %{buildroot}/opt/%{name}/
%files
/opt/%{name}/
%exclude /opt/%{name}/node_modules/babel*
%exclude /opt/%{name}/node_modules/phantomjs*
%exclude /opt/%{name}/node_modules/webpack*
%files babel
/opt/%{name}/node_modules/babel*
%files phantomjs
/opt/%{name}/node_modules/phantomjs*
%files webpack
/opt/%{name}/node_modules/webpack*
%changelog
* Tue Jul 26 2016 Honza Pokorny <honza@redhat.com> 1-2
- First RPM

View File

@ -0,0 +1,46 @@
%global sname openstack-tripleo-ui
%global commit 38664a13b4a74f9bcca3384f6ad4184a298db140
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global checkout .%{shortcommit}git
Name: %{sname}
Version: 0.0.1
Release: 0.1%{?checkout}%{?dist}
Summary: TripleO UI --- GUI for the TripleO project
License: ASL 2.0
URL: http://tripleo.org
# Source0 is created by running "npm pack"
Source0: http://tarballs.openstack.org/tripleo-ui/tripleo-ui-%{shortcommit}.tar.gz
Source1: tripleo-ui.conf
BuildRequires: nodejs
BuildRequires: git
BuildRequires: %{sname}-deps = 1
BuildArch: noarch
%description
%prep
%autosetup -n package -S git
%build
rm -rf node_modules
ln -s /opt/%{name}-deps/node_modules .
npm run build
%install
mkdir -p %{buildroot}/%{_datadir}/%{name}
mkdir -p %{buildroot}/var/www/%{name}
mkdir -p %{buildroot}/etc/httpd/conf.d/
cp -rf dist %{buildroot}/var/www/%{name}/
cp -rf %{SOURCE1} %{buildroot}/etc/httpd/conf.d/%{sname}.conf
%files
%{_localstatedir}/www/%{sname}
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{sname}.conf
%license LICENSE
%doc README.md
%changelog
* Tue Jul 26 2016 Honza Pokorny <honza@redhat.com> 0.0.1-0.1.38664a1git
- First RPM

View File

@ -1,8 +0,0 @@
#!/bin/env bash
# Create a tarball of node_modules so that it's included in the bundle created
# by "npm pack".
rm -rf tripleo-ui-*\.tar.gz
npm prune
tar czf node_modules.tar.gz node_modules

17
packaging/tripleo-ui.conf Normal file
View File

@ -0,0 +1,17 @@
Listen 3000
<VirtualHost *:3000>
DocumentRoot "/var/www/openstack-tripleo-ui/dist"
<Directory "/var/www/openstack-tripleo-ui/dist">
Require all granted
Options +FollowSymLinks +Indexes
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</Directory>
</VirtualHost>