Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
Vagrant+salt+Makefile for build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp authored and Dan Mick committed Jan 15, 2014
1 parent e4a910b commit 4030da9
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 0 deletions.
88 changes: 88 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
VERSION=1.0.0
DISTNAMEVER=calamari-clients_$(VERSION)
PKGDIR=calamari-clients-$(VERSION)
TARNAME = ../$(DISTNAMEVER).tar.gz
SRC := $(shell pwd)

INSTALL=/usr/bin/install

UI_BASEDIR = $(DESTDIR)/opt/calamari/webapp/content
UI_SUBDIRS = admin login dashboard
CONFIG_JSON = dashboard/dist/scripts/config.json

FINDCMD =find . \
-name .git -prune \
-o -name node_modules -prune \
-o -name .tmp -prune \
-o -name .sass-cache -prune \
-o -name debian -prune \
-o -print0

# add in just the debian files we want
DEBFILES = \
changelog \
compat \
control \
copyright \
rules \
source/format

build: build-ui $(CONFIG_JSON)

build-ui:
@echo "building ui"
set -e ;\
for d in $(UI_SUBDIRS); do \
echo $$d; \
(cd $$d; \
npm install --loglevel warn && \
bower --allow-root install && \
grunt --no-color saveRevision && \
grunt --no-color build; ) \
done

# for right now, this contains two useful things that should be set
# when running against a live cluster. We could preinstall it in the
# package or do it in a postinstall; it has more visibility here

$(CONFIG_JSON): build-ui
echo '{ "offline": false, "graphite-host": "/graphite" }' \
> $(CONFIG_JSON)


# NB we do not build source packages
dpkg:
dpkg-buildpackage -b -us -uc

install:
@echo "install"
for d in $(UI_SUBDIRS); do \
instdir=$$(basename $$d); \
$(INSTALL) -d $(UI_BASEDIR)/$$instdir; \
cp -rp $$d/dist/* $(UI_BASEDIR)/$$instdir; \
done

clean:
for d in $(UI_SUBDIRS); do \
echo $$d; \
(cd $$d; \
if [ -d node_modules ] ; then grunt --no-color clean; fi) \
done
@rm -f $(CONFIG_JSON)

dist:
@echo "making dist tarball in $(TARNAME)"
for d in $(UI_SUBDIRS); do \
echo $$d; \
(cd $$d; \
npm install --silent; \
grunt --no-color saveRevision) \
done
@rm -rf $(PKGDIR)
@$(FINDCMD) | cpio --null -p -d $(PKGDIR)
@tar -zcf $(TARNAME) $(PKGDIR)
@rm -rf $(PKGDIR)
@echo "tar file made in $(TARNAME)"

.PHONY: dist clean build dpkg install

Empty file added debian/calamari-clients.install
Empty file.
3 changes: 3 additions & 0 deletions debian/calamari-clients.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
3 changes: 3 additions & 0 deletions debian/calamari-clients.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
calamari-clients (0.1) UNRELEASED; urgency=low

* Initial release.

-- Inktank <info@inktank.com> Weds, 18 Dec 2013 14:20:00 -0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
13 changes: 13 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: calamari-clients
Section: misc
Priority: extra
Homepage: http://www.inktank.com/
Maintainer: Inktank <info@intank.com>
Standards-Version: 3.9.2
Build-Depends: ruby, rubygems, make, git, nodejs

Package: calamari-clients
Architecture: all
Depends: calamari-server
Description: Inktank Calamari user interface

1 change: 1 addition & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) 2013, Inktank Storage, Inc. All rights reserved.
6 changes: 6 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/make -f
export DH_VERBOSE=1

%:
# keep your *(#$& hands off my venvs
dh $@ --without python2 --without python3 --without pycentral --without pysupport
22 changes: 22 additions & 0 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"

config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "512"]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end

config.vm.synced_folder "../../", "/git"
config.vm.synced_folder "salt/roots/", "/srv/salt/"
config.vm.provision :salt do |salt|
salt.minion_config = "salt/minion"
salt.run_highstate = true
end
end
2 changes: 2 additions & 0 deletions vagrant/salt/minion
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
master: localhost
file_client: local
42 changes: 42 additions & 0 deletions vagrant/salt/roots/build_deps.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
build_deps:
pkg.installed:
- pkgs:
- ruby
- rubygems
- python-software-properties
- g++
- make
- git
- debhelper

install_node:
pkgrepo.managed:
- humanname: node.js PPA
- name: deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu precise main
- dist: precise
- file: /etc/apt/sources.list.d/node.list
- keyid: B9316A7BC7917B12
- keyserver: keyserver.ubuntu.com
pkg.latest:
- name: nodejs
- refresh: True

bower:
cmd.run:
- name: npm install -g bower@1.2.8
require:
- pkg: install_node

grunt-cli:
cmd.run:
- name: npm install -g grunt-cli
require:
- pkg: install_node

animate:
gem:
- installed
require:
- pkg: rubygems


4 changes: 4 additions & 0 deletions vagrant/salt/roots/top.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

base:
'*':
- build_deps

2 comments on commit 4030da9

@ChristinaMeno
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dan, do you mean to be pulling in the contents of the merge-apps branch like this?
If you do, you are missing some history there.

@dmick
Copy link
Member

@dmick dmick commented on 4030da9 Jan 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is why I asked John if merge-apps was in a state ready for merging or if there ought to be cleanup; not having heard back I assumed it wasn't an issue. Not sure what you mean about "missing history" though; I should be merging all the commits, unless I'm missing something? (i.e. this commit is one such)

Please sign in to comment.