Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmp85 committed Aug 3, 2016
2 parents bc0ccaf + 5a6e383 commit f7a7f7d
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 13 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### citustools v0.4.0 (August 2, 2016) ###

* Adds Travis script to alleviate uncrustify installation

* Adds logic to fully install Travis scripts

* Removes .sh prefix from all Travis executables

### citustools v0.3.3 (August 1, 2016) ###

* Removes packaging support for PostgreSQL 9.4
Expand Down
4 changes: 2 additions & 2 deletions HomebrewFormula/citustools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def message
class Citustools < Formula
desc "Tools and config used in Citus Data projects."
homepage "https://github.com/citusdata/tools"
url "https://github.com/citusdata/tools/archive/v0.3.1.tar.gz"
sha256 "bf06e6dafd142ba042f488e3de20405d5473f866a15b6c3228290130bf9ea144"
url "https://github.com/citusdata/tools/archive/v0.3.3.tar.gz"
sha256 "5133115602299c66be2a78bcc4ccba45e56c42a989d302c21de729d79d39805b"

depends_on "uncrustify"
depends_on Docker
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ export mandir := $(datarootdir)/man
export sysconfdir := $(prefix)/etc
export pkgsysconfdir := $(sysconfdir)/$(PACKAGE_NAME)

DIRNAMES = packaging uncrustify
ifeq ($(TRAVIS), true)
DIRNAMES += travis
endif

# logic from http://stackoverflow.com/a/11206700
SUBDIRS := $(addsuffix /., packaging uncrustify)
SUBDIRS := $(addsuffix /., $(DIRNAMES))
TARGETS := all clean install
SUBDIRS_TARGETS := $(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Tools and configuration common to multiple Citus Data projects.


Guides for getting things done, programming well, and programming in style.

* [OS Packaging](/packaging)
* [Travis CI](/travis)
* [Uncrustify Formatter](/uncrustify)

Expand Down
15 changes: 15 additions & 0 deletions travis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# needed variables will be passed in via top-level Makefile

INSTALL := install -c
INSTALL_SCRIPT := $(INSTALL) -m 755
TRAVIS_SCRIPTS := $(filter-out README.md Makefile,$(wildcard *))

all:

installdirs:
$(INSTALL) -d $(DESTDIR)$(bindir)

install: all installdirs
$(INSTALL_SCRIPT) $(TRAVIS_SCRIPTS) $(DESTDIR)$(bindir)

.PHONY: clean installdirs install
21 changes: 12 additions & 9 deletions travis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,43 @@ With the provided scripts, it's fairly easy to set up a matrix build (on all Pos

These scripts were inspired by [a similar workflow](https://gist.github.com/petere) used by Peter Eisentraut to test his own PostgreSQL extensions (e.g. [`pguri`](https://github.com/petere/pguri/blob/1.20151224/.travis.yml)). Jason Petersen adapted that workflow into a set of scripts, which lived in [a Gist](https://gist.github.com/jasonmp85/9963879) before the creation of this repository.

### `setup_apt.sh`
### `setup_apt`

This script simply adds all necessary official PostgreSQL APT repositories (including those with prerelease software) and updates package lists to prepare for installation.

### `nuke_pg.sh`
### `nuke_pg`

It is possible that your Travis CI virtual machine starts with a PostgreSQL instance already running, though you probably don't want to use it as-is. So we "nuke" it by stopping it and ensuring it never comes back.

### `install_pg.sh`
### `install_pg`

A PostgreSQL version will be installed based on the value of the `PGVERSION` environment variable. In addition, common extension dependencies and development headers are installed. Suitable values for `PGVERSION` might be `9.3`, `9.4`, or `9.5`.

### `install_citus.sh`
### `install_uncrustify`

Similar to `install_pg.sh`, but installs CitusDB instead of vanilla PostgreSQL. The convention is that `PGVERSION` should be set to ten times the CitusDB version (to avoid possible collisions with existing PostgreSQL versions). For instance, a value of `40.0` installs CitusDB 4.0, and `41.0` installs CitusDB 4.1.
Installs a recent `uncrustify` version from a Citus-specific Trusty package stored in S3.
### `install_citus`

### `config_and_start_cluster.sh`
Similar to `install_pg`, but installs CitusDB instead of vanilla PostgreSQL. The convention is that `PGVERSION` should be set to ten times the CitusDB version (to avoid possible collisions with existing PostgreSQL versions). For instance, a value of `40.0` installs CitusDB 4.0, and `41.0` installs CitusDB 4.1.

### `config_and_start_cluster`

Since the "nuke" script removed the only running PostgreSQL cluster, you'll probably want to have one up and running to build, install, and test an extension. This script starts just such a cluster. If the `PG_PRELOAD` environment variable is set, the cluster uses its value for the `shared_preload_libraries` setting.

Note that starting your own cluster is necessary only if you want to build, install, and test your extension in a system-wide cluster. This is the case for most extensions using the PostgreSQL extension build system (i.e. `make install` followed by `make installcheck`), but some advanced use cases may not need a cluster created.

### `pg_travis_test.sh`
### `pg_travis_test`

Runs regression tests against a system-wide cluster, echoing any failures to standard out (and exiting abnormally on failure). This is the actual "test" part of the whole workflow (for most extensions).

### `pg_travis_multi_test.sh`
### `pg_travis_multi_test`

Runs regression tests against a more "complex" extension, usually one that:

* Requires that `./configure` be run before `make` can proceed
* Starts its own PostgreSQL instances within a `check` Make target.

If this script is used, it is likely that `config_and_start_cluster.sh` is unnecessary.
If this script is used, it is likely that `config_and_start_cluster` is unnecessary.

### `build_new_nightly`

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions travis/install_uncrustify
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -eux

uncrustifypkgs="$HOME/.cache/uncrustify_pkgs"
uncrustifyversion="0.63"
uncrustifydownload="uncrustify_${uncrustifyversion}-1_amd64.deb"
uncrustifyurl="https://s3.amazonaws.com/packages.citusdata.com/travis/${uncrustifydownload}"

# install travis uncrustify package
wget -N -P "${uncrustifypkgs}" "${uncrustifyurl}"
sudo dpkg --force-confdef --force-confold --install "${uncrustifypkgs}/${uncrustifydownload}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f7a7f7d

Please sign in to comment.