From f5e40fefe0eda761c05a2654e42cde80d2d3408f Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 2 Jul 2016 12:32:07 +0300 Subject: [PATCH] added make distribution, updated travis and docker files --- .docker/make/debian/Dockerfile | 22 ++++++++++++++++++++++ .travis.yml | 5 +++++ Makefile | 8 ++++++++ utils/make/make-ci.sh | 31 +++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 .docker/make/debian/Dockerfile create mode 100644 utils/make/make-ci.sh diff --git a/.docker/make/debian/Dockerfile b/.docker/make/debian/Dockerfile new file mode 100644 index 00000000..7a7a5c99 --- /dev/null +++ b/.docker/make/debian/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:latest + +MAINTAINER Nikita Sobolev (mail@sobolevn.me) + +# Dependencies and project initialization: + +RUN apt-get update && \ + apt-get install -y man make git apt-transport-https && \ + apt-get autoremove && apt-get autoclean + +# This will increase the container size, but speed up the build, +# since this part will change, while the dependencies won't: + +RUN mkdir /code +WORKDIR /code + +# Removing `origin` for good: + +RUN git clone -q https://github.com/sobolevn/git-secret.git && \ + cd git-secret && git remote rm origin + +WORKDIR /code/git-secret diff --git a/.travis.yml b/.travis.yml index e7298030..f4ec83e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ matrix: fast_finish: true include: + - os: linux + env: GITSECRET_DIST="make"; DOCKER_DIST="debian" + services: docker + sudo: required + language: ruby - os: linux env: GITSECRET_DIST="deb"; DOCKER_DIST="debian"; services: docker diff --git a/Makefile b/Makefile index 202caf10..d2d01b5b 100644 --- a/Makefile +++ b/Makefile @@ -127,3 +127,11 @@ deploy-rpm: build-rpm @chmod +x "./utils/rpm/rpm-deploy.sh"; sync; \ export SECRET_PROJECT_ROOT="${PWD}"; \ "./utils/rpm/rpm-deploy.sh" + +# make: + +.PHONY: test-make-ci +test-make-ci: clean install-test + @chmod +x "./utils/make/make-ci.sh"; sync; \ + export SECRET_PROJECT_ROOT="${PWD}"; \ + "./utils/make/make-ci.sh" diff --git a/utils/make/make-ci.sh b/utils/make/make-ci.sh new file mode 100644 index 00000000..3aeb9179 --- /dev/null +++ b/utils/make/make-ci.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e + +# Note that this file is created for test purposes: +# 1. It runs inside the Docker container +# 2. It does not use `sudo` or anything +# 3. If you would like to install a package with `make` on your system, +# see `Installation` + +source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh" + + +# Integration tests +function integration_tests { + # Installing the package: + make build + make install + + # Testing the installation: + which "git-secret" + + # Test the manuals: + man --where "git-secret" # .7 + man --where "git-secret-init" # .1 +} + +integration_tests + +# Unit tests: +source "${SECRET_PROJECT_ROOT}/utils/tests.sh"