From 2e894ea86f889b0490e4ad7f100fe3d86cb5eba1 Mon Sep 17 00:00:00 2001 From: Aymeric Beaumet Date: Fri, 15 Sep 2017 17:15:12 +0200 Subject: [PATCH] Run the tests on a CI (#215) * Add CircleCI and make tests pass on ubuntu:16.04 * Add badge to readme * Add debian stable to CircleCI * Fix pkill on CircleCI debian --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- tools/confidence_test.sh | 2 +- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..65fff28 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,56 @@ +version: 2 + +workflows: + version: 2 + ci: + jobs: + - debian + - ubuntu + +jobs: + + debian: + docker: + - image: debian:9.1 + steps: + - checkout + - run: + name: 'Installing' + command: | + apt-get update -y + apt-get install -y build-essential expect git gnupg2 pinentry-tty procps rpm ruby-dev + gem install fpm + - run: + name: 'Cleaning' + command: | + rm -rf ~/.gpnupg + make clean + - run: + name: 'Testing' + command: | + GPG=gpg2 make test + make packages-deb + make packages-rpm + + ubuntu: + docker: + - image: ubuntu:16.04 + steps: + - checkout + - run: + name: 'Installing' + command: | + apt-get update -y + apt-get install -y build-essential expect git gnupg2 pinentry-tty procps rpm ruby-dev + gem install fpm + - run: + name: 'Cleaning' + command: | + rm -rf ~/.gpnupg + make clean + - run: + name: 'Testing' + command: | + GPG=gpg2 make test + make packages-deb + make packages-rpm \ No newline at end of file diff --git a/README.md b/README.md index 866249f..a82c982 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -BlackBox +BlackBox ![CircleCI](https://circleci.com/gh/StackExchange/blackbox.svg?style=shield) ======== Safely store secrets in a VCS repo (i.e. Git, Mercurial, Subversion or Perforce). These commands make it easy for you to Gnu Privacy Guard (GPG) encrypt specific files in a repo so they are "encrypted at rest" in your repository. However, the scripts make it easy to decrypt them when you need to view or edit them, and decrypt them for use in production. Originally written for Puppet, BlackBox now works with any Git or Mercurial repository. diff --git a/tools/confidence_test.sh b/tools/confidence_test.sh index 0e9b8f2..abca0a7 100755 --- a/tools/confidence_test.sh +++ b/tools/confidence_test.sh @@ -225,7 +225,7 @@ become_bob # This users's default group: DEFAULT_GID_NUM=$(id -g) # Pick a group that is not the default group: -TEST_GID_NUM=$(id -G | fmt -1 | sort -rn | grep -xv "$(id -u)" | grep -xv "$(id -g)" | head -1) +TEST_GID_NUM=$(grep -v "$DEFAULT_GID_NUM" /etc/group | cut -d: -f3 | sort -rn | head -1) echo "DEFAULT_GID_NUM=$DEFAULT_GID_NUM" echo "TEST_GID_NUM=$TEST_GID_NUM"