mirror of https://github.com/sobolevn/git-secret
Merge branch 'staging'
commit
59e198f39c
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ "$GITSECRET_DIST" == "rpm" ]]; then
|
||||||
|
# To deploy `rpm`-packages this utility is needed:
|
||||||
|
sudo apt-get install -y rpm;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ! -z "$DOCKER_DIST" ]]; then
|
||||||
|
# When making a non-container build, this step will generate
|
||||||
|
# proper manifest files:
|
||||||
|
make "deploy-${GITSECRET_DIST}";
|
||||||
|
fi
|
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Docker:
|
||||||
|
if [[ ! -z "$DOCKER_DIST" ]]; then
|
||||||
|
TEMPLATE="sobolevn/git-secret-docker-$DOCKER_DIST"
|
||||||
|
DOCKERFILE_PATH=".docker/${GITSECRET_DIST}/${DOCKER_DIST}"
|
||||||
|
|
||||||
|
# Building the local image:
|
||||||
|
docker build -t "$TEMPLATE" "$DOCKERFILE_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Mac:
|
||||||
|
if [[ "$GITSECRET_DIST" == "brew" ]]; then
|
||||||
|
brew install "$GITSECRET_GPG_DEP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Local linux (standart build):
|
||||||
|
if [[ "$GITSECRET_DIST" == "none" ]] && [[ "$GITSECRET_GPG_DEP" == "gnupg2" ]]; then
|
||||||
|
# Installing custom GPG version:
|
||||||
|
sudo apt-get install -y gnupg2
|
||||||
|
fi
|
@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Docker-baised builds:
|
||||||
|
if [[ ! -z "$DOCKER_DIST" ]]; then
|
||||||
|
TEMPLATE="sobolevn/git-secret-docker-$DOCKER_DIST"
|
||||||
|
# Passing the `TRAVIS_COMMIT` into the container:
|
||||||
|
COMMAND="if [ ! -z ${TRAVIS_COMMIT} ]; then git checkout ${TRAVIS_COMMIT}; fi; make test-${GITSECRET_DIST}-ci"
|
||||||
|
|
||||||
|
# This will run the full intergration check inside the `docker` container:
|
||||||
|
# see `test-deb-ci` and `test-rpm-ci` in `Makefile`
|
||||||
|
docker run "$TEMPLATE" /bin/bash -c "$COMMAND"
|
||||||
|
docker ps -a
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Local builds:
|
||||||
|
if [[ "$GITSECRET_DIST" == "brew" ]] || [[ "$GITSECRET_DIST" == "brew" ]]; then
|
||||||
|
# Only running `make test` on standard (non-docker) build,
|
||||||
|
# since it is called inside the docker container anyway.
|
||||||
|
make test
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$(command -v shellcheck)" ]]; then
|
||||||
|
# This means, that `shellcheck` does exist, so run it:
|
||||||
|
echo 'running lint'
|
||||||
|
find src utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
|
||||||
|
# TODO: add tests to lint
|
||||||
|
# see: https://github.com/koalaman/shellcheck/issues/709
|
||||||
|
fi
|
@ -0,0 +1,23 @@
|
|||||||
|
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 install -y ruby ruby-dev ruby-build && \
|
||||||
|
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
|
@ -0,0 +1,23 @@
|
|||||||
|
FROM ubuntu: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 install -y ruby ruby-dev ruby-build && \
|
||||||
|
apt-get autoremove && apt-get autoclean && \
|
||||||
|
mkdir /code
|
||||||
|
|
||||||
|
# This will increase the container size, but speed up the build,
|
||||||
|
# since this part will change, while the dependencies won't:
|
||||||
|
|
||||||
|
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
|
@ -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
|
@ -0,0 +1,22 @@
|
|||||||
|
FROM fedora:latest
|
||||||
|
|
||||||
|
MAINTAINER Nikita Sobolev (mail@sobolevn.me)
|
||||||
|
|
||||||
|
ENV HOME /root
|
||||||
|
|
||||||
|
RUN dnf update -y && \
|
||||||
|
dnf install -y gnupg man make gcc git tar > /dev/null && \
|
||||||
|
dnf install -y which pciutils redhat-rpm-config rpm-build zlib-devel && \
|
||||||
|
dnf -y group install 'Development tools' && \
|
||||||
|
dnf install -y ruby ruby-devel rubygems && \
|
||||||
|
dnf -y autoremove && \
|
||||||
|
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
|
@ -0,0 +1,93 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
Your contributions are always welcome!
|
||||||
|
|
||||||
|
## Process
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
|
||||||
|
Before starting make sure you have:
|
||||||
|
|
||||||
|
- git
|
||||||
|
- bash
|
||||||
|
- gnupg (or gnupg2)
|
||||||
|
- [shellcheck](https://github.com/koalaman/shellcheck)
|
||||||
|
|
||||||
|
Only required if dealing with manuals, `gh-pages` or releases:
|
||||||
|
|
||||||
|
- ruby, ruby-dev
|
||||||
|
|
||||||
|
### Getting started
|
||||||
|
|
||||||
|
1. Create your own or pick an opened issue from the [tracker][tracker]. Take a look at the [`help-wanted` tag][help-wanted]
|
||||||
|
2. Fork and clone your repository: `git clone https://github.com/${YOUR_NAME}/git-secret.git`
|
||||||
|
3. Make sure that everything works fine by running `make test`
|
||||||
|
|
||||||
|
### Development Process
|
||||||
|
|
||||||
|
1. Firstly, you will need to setup development hooks with `make install-hooks`
|
||||||
|
2. Make changes to the files that need to be changed
|
||||||
|
3. When making changes to any files inside `src/` you will need to rebuild the binary `git-secret` with `make clean && make build` command
|
||||||
|
4. Run [`shellcheck`][shellcheck] against all your changes with `find src utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}`
|
||||||
|
5. Now, add all your files to the commit with `git add --all` and commit changes with `git commit`, make sure you write a good message, which will explain your work
|
||||||
|
6. When running `git commit` the tests will run automatically, your commit will be canceled if they fail
|
||||||
|
7. Push to your repository, make a pull-request against `develop` branch. Please, make sure you have **one** commit per pull-request
|
||||||
|
|
||||||
|
### Branches
|
||||||
|
|
||||||
|
We have three long-live branches: `master`, `staging` and `develop` (and `gh-pages` for static site).
|
||||||
|
|
||||||
|
It basically looks like that:
|
||||||
|
|
||||||
|
> `your-branch` -> `develop` -> `staging` -> `master`
|
||||||
|
|
||||||
|
- `master` branch is protected, since `antigen` and tools like it install the app from the main branch directly. So only fully tested code goes there
|
||||||
|
- `staging` - this branch is used to create a new `git` tag and a `github` release, then it gets merged into `master`
|
||||||
|
- `develop` is where the development is done and the branch you should send your pull-requests to
|
||||||
|
|
||||||
|
### Continuous integration
|
||||||
|
|
||||||
|
CI is done with the help of `travis`. `travis` handles multiple environments:
|
||||||
|
|
||||||
|
- `Docker`-based jobs or so-called 'integration tests', these tests create a local release, install it with the package manager and then run unit-tests and system checks
|
||||||
|
- `OSX` jobs, which handle basic unit-tests on `OSX`
|
||||||
|
- Native `travis` jobs, which handle basic unit-tests and stylechecks
|
||||||
|
|
||||||
|
### Release process
|
||||||
|
|
||||||
|
The release process is defined in the `git`-hooks and `.travis.yml`.
|
||||||
|
|
||||||
|
When creating a commit inside the `staging` branch (it is usually a documentation and changelog update with the version bump inside `src/version.sh`) it will trigger two main events.
|
||||||
|
|
||||||
|
Firstly, new manuals will be created and added to the current commit with `make build-man` on `pre-commit` hook.
|
||||||
|
|
||||||
|
Secondly, after the commit is successfully created it will also trigger `make build-gh-pages` target on `post-commit` hook, which will push new manuals to the [git-secret site][git-secret-site]. And the new `git` tag will be automatically created if the version is changed:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
if [[ "$NEWEST_TAG" != "v${SCRIPT_VERSION}" ]]; then
|
||||||
|
git tag -a "v${SCRIPT_VERSION}" -m "version $SCRIPT_VERSION"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
Then it will be merged inside `master` when ready.
|
||||||
|
|
||||||
|
#### Travis releases
|
||||||
|
|
||||||
|
When creating a commit inside `master` branch, `travis` on successful build will publish new `deb` and `rpm` packages to [`bintray`][bintray].
|
||||||
|
|
||||||
|
If you wish to override a previous release (*be careful*) you will need to add `"override": 1` into `matrixParams`, see `deb-deploy.sh` and `rpm-deploy.sh`
|
||||||
|
|
||||||
|
#### Manual releases
|
||||||
|
|
||||||
|
Releases to `brew` are made manually.
|
||||||
|
|
||||||
|
#### Dockerhub releases
|
||||||
|
|
||||||
|
[`Dockerhub`][Dockerhub] contains `Docker` images with different OS'es used for testing. It is updated via a `github` webhook on commit into `master`.
|
||||||
|
|
||||||
|
[tracker]: https://github.com/sobolevn/git-secret/issues
|
||||||
|
[help-wanted]: https://github.com/sobolevn/git-secret/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22
|
||||||
|
[shellcheck]: https://github.com/koalaman/shellcheck
|
||||||
|
[git-secret-site]: https://sobolevn.github.io/git-secret/
|
||||||
|
[bintray]: https://bintray.com/sobolevn
|
||||||
|
[Dockerhub]: https://hub.docker.com/r/sobolevn/git-secret/
|
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2016 Nikita Sobolev
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
@ -1,24 +1,30 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
function clean {
|
function clean {
|
||||||
|
local verbose=''
|
||||||
|
|
||||||
OPTIND=1
|
OPTIND=1
|
||||||
|
|
||||||
local verbose=""
|
while getopts 'vh' opt; do
|
||||||
while getopts "vh" opt; do
|
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
v) verbose="v";;
|
v) verbose="v";;
|
||||||
|
|
||||||
h) _show_manual_for "clean";;
|
h) _show_manual_for 'clean';;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
[ "$1" = "--" ] && shift
|
[ "$1" = '--' ] && shift
|
||||||
|
|
||||||
[[ ! -z "$verbose" ]] && echo && echo "cleaing:" || : # bug with custom bash on OSX
|
if [[ ! -z "$verbose" ]]; then
|
||||||
|
echo && echo 'cleaing:'
|
||||||
|
fi
|
||||||
|
|
||||||
find . -name *$SECRETS_EXTENSION -type f | xargs rm -f$verbose
|
find . -name "*$SECRETS_EXTENSION" -type f -print0 | xargs rm -f$verbose
|
||||||
|
|
||||||
[[ ! -z "$verbose" ]] && echo || : # bug with custom bash on OSX
|
if [[ ! -z "$verbose" ]]; then
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
GITSECRET_VERSION='0.2.1' # shellcheck disable=2034
|
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
# TODO: create tests for this command.
|
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Initializing and settings:
|
|
||||||
READ_PEM=0644
|
|
||||||
EXEC_PEM=0755
|
|
||||||
|
|
||||||
SCRIPT_NAME="git-secret"
|
|
||||||
SCRIPT_DESCRIPTION="A bash-tool to store your private data inside a git repository."
|
|
||||||
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
|
|
||||||
: ${SCRIPT_EPOCH:=0}
|
|
||||||
: ${SCRIPT_ITERATION:=1}
|
|
||||||
|
|
||||||
if [[ -z "$SCRIPT_BUILD_DIR" ]]; then
|
|
||||||
SCRIPT_BUILD_DIR="${HOME}/debbuild-${SCRIPT_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
SCRIPT_DEST_DIR="${SCRIPT_BUILD_DIR}/installroot"
|
|
||||||
|
|
||||||
# Preparing the files
|
|
||||||
rm -rf "$SCRIPT_BUILD_DIR"
|
|
||||||
mkdir -p "$SCRIPT_DEST_DIR"
|
|
||||||
|
|
||||||
# Coping the files inside the build folder:
|
|
||||||
install -D -T -b -m "$EXEC_PEM" -T "git-secret" "${SCRIPT_DEST_DIR}/usr/bin/git-secret"
|
|
||||||
install -m "$READ_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man1"
|
|
||||||
install -m "$READ_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man7"
|
|
||||||
for file in man/man1/* ; do
|
|
||||||
if [[ "$file" == *.ronn ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
install -D -T -b -m "$READ_PEM" -T "$file" "${SCRIPT_DEST_DIR}/usr/share/${file}"
|
|
||||||
done
|
|
||||||
install -D -T -b -m "$READ_PEM" -T "man/man7/git-secret.7" \
|
|
||||||
"${SCRIPT_DEST_DIR}/usr/share/man/man7/git-secret.7"
|
|
||||||
|
|
||||||
# Building .deb package:
|
|
||||||
cd "$SCRIPT_DEST_DIR" && fpm -s dir -t deb \
|
|
||||||
-a all \
|
|
||||||
-n "$SCRIPT_NAME" \
|
|
||||||
--epoch "$SCRIPT_EPOCH" \
|
|
||||||
--version "$SCRIPT_VERSION" \
|
|
||||||
--iteration "$SCRIPT_ITERATION" \
|
|
||||||
--description="$SCRIPT_DESCRIPTION" \
|
|
||||||
-C "$SCRIPT_DEST_DIR" \
|
|
||||||
.
|
|
@ -0,0 +1,81 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Initializing and settings:
|
||||||
|
READ_PEM=0644
|
||||||
|
EXEC_PEM=0755
|
||||||
|
|
||||||
|
SCRIPT_NAME="git-secret"
|
||||||
|
SCRIPT_DESCRIPTION="A bash-tool to store your private data inside a git repository."
|
||||||
|
SCRIPT_VERSION=$(bash "${PWD}"/git-secret --version)
|
||||||
|
|
||||||
|
# This might be overridden someday:
|
||||||
|
: "${SCRIPT_EPOCH:=0}"
|
||||||
|
: "${SCRIPT_ITERATION:=1}"
|
||||||
|
|
||||||
|
# This may be overridden:
|
||||||
|
if [[ -z "$SCRIPT_BUILD_DIR" ]]; then
|
||||||
|
SCRIPT_BUILD_DIR="${PWD}/build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SCRIPT_DEST_DIR="${SCRIPT_BUILD_DIR}/buildroot"
|
||||||
|
|
||||||
|
|
||||||
|
function locate_deb {
|
||||||
|
find "$SCRIPT_DEST_DIR" -maxdepth 1 -name "*.deb" | head -1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function locate_rpm {
|
||||||
|
find "$SCRIPT_DEST_DIR" -maxdepth 1 -name "*.rpm" | head -1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function preinstall_files {
|
||||||
|
# Preparing the files:
|
||||||
|
rm -rf "$SCRIPT_BUILD_DIR"
|
||||||
|
mkdir -p "$SCRIPT_DEST_DIR"
|
||||||
|
|
||||||
|
# Coping the files inside the build folder:
|
||||||
|
install -D -T -b -m "$EXEC_PEM" -T "git-secret" "${SCRIPT_DEST_DIR}/usr/bin/git-secret"
|
||||||
|
install -m "$EXEC_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man1"
|
||||||
|
install -m "$EXEC_PEM" -d "${SCRIPT_DEST_DIR}/usr/share/man/man7"
|
||||||
|
for file in man/man1/* ; do
|
||||||
|
if [[ "$file" == *.ronn ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -D -T -b -m "$READ_PEM" -T "$file" "${SCRIPT_DEST_DIR}/usr/share/$file"
|
||||||
|
done
|
||||||
|
install -D -T -b -m "$READ_PEM" -T "man/man7/git-secret.7" \
|
||||||
|
"${SCRIPT_DEST_DIR}/usr/share/man/man7/git-secret.7"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function build_package {
|
||||||
|
# Only requires `rpm` or `deb` as first argument:
|
||||||
|
local build_type="$1"
|
||||||
|
|
||||||
|
# See https://github.com/jordansissel/fpm for docs:
|
||||||
|
fpm \
|
||||||
|
-s dir \
|
||||||
|
-t "$build_type" \
|
||||||
|
-a all \
|
||||||
|
-n "$SCRIPT_NAME" \
|
||||||
|
--version "$SCRIPT_VERSION" \
|
||||||
|
--description "$SCRIPT_DESCRIPTION" \
|
||||||
|
--url "https://sobolevn.github.io/git-secret/" \
|
||||||
|
--maintainer "Nikita Sobolev (mail@sobolevn.me)" \
|
||||||
|
--license "MIT" \
|
||||||
|
-C "$SCRIPT_DEST_DIR" \
|
||||||
|
-d "git" \
|
||||||
|
-d "gnupg" \
|
||||||
|
--deb-no-default-config-files \
|
||||||
|
.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function clean_up_files {
|
||||||
|
rm -rf "${SCRIPT_DEST_DIR:?}/usr"
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
preinstall_files
|
||||||
|
|
||||||
|
# Building .deb package:
|
||||||
|
cd "$SCRIPT_DEST_DIR" && build_package "deb"
|
||||||
|
|
||||||
|
# Cleaning up:
|
||||||
|
clean_up_files && cd "${SECRET_PROJECT_ROOT}"
|
@ -0,0 +1,38 @@
|
|||||||
|
#!/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 `.deb` package on your system, see `Installation`
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
# This folder should contain just one .deb file:
|
||||||
|
DEB_FILE_LOCATION=$(locate_deb)
|
||||||
|
|
||||||
|
|
||||||
|
# Integration tests
|
||||||
|
function integration_tests {
|
||||||
|
# Installing the package:
|
||||||
|
dpkg -i "$DEB_FILE_LOCATION"
|
||||||
|
|
||||||
|
# Configuring the dependencies:
|
||||||
|
apt-get -f -y install
|
||||||
|
|
||||||
|
# Testing the installation:
|
||||||
|
dpkg --get-selections | grep "git-secret"
|
||||||
|
which "git-secret"
|
||||||
|
|
||||||
|
# Test the manuals:
|
||||||
|
man --where "git-secret" # .7
|
||||||
|
man --where "git-secret-init" # .1
|
||||||
|
}
|
||||||
|
|
||||||
|
integration_tests
|
||||||
|
|
||||||
|
# Unit tests:
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"
|
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
# Variables, which will be used in `bintray.json`:
|
||||||
|
SCRIPT_VERSION=$(bash "${PWD}/git-secret" --version)
|
||||||
|
RELEASE_DATE=$(date +%Y-%m-%d)
|
||||||
|
|
||||||
|
# add `\"override\": 1 \` into the `matrixParams`, if needed:
|
||||||
|
echo "{ \
|
||||||
|
\"package\": { \
|
||||||
|
\"name\": \"git-secret\", \
|
||||||
|
\"repo\": \"deb\", \
|
||||||
|
\"subject\": \"sobolevn\" \
|
||||||
|
}, \
|
||||||
|
\"version\": {
|
||||||
|
\"name\": \"${SCRIPT_VERSION}\", \
|
||||||
|
\"desc\": \"Version ${SCRIPT_VERSION}\", \
|
||||||
|
\"released\": \"${RELEASE_DATE}\", \
|
||||||
|
\"vcs_tag\": \"v${SCRIPT_VERSION}\", \
|
||||||
|
\"gpgSign\": true \
|
||||||
|
}, \
|
||||||
|
\"files\": [{ \
|
||||||
|
\"includePattern\": \"build/buildroot/(.*\.deb)\", \
|
||||||
|
\"uploadPattern\": \"/git-secret_${SCRIPT_VERSION}_all.deb\", \
|
||||||
|
\"matrixParams\": { \
|
||||||
|
\"deb_distribution\": \"stable\", \
|
||||||
|
\"deb_component\": \"main\", \
|
||||||
|
\"deb_architecture\": \"all\" \
|
||||||
|
} \
|
||||||
|
}], \
|
||||||
|
\"publish\": true \
|
||||||
|
}" > "${SECRET_PROJECT_ROOT}/build/deb_descriptor.json"
|
@ -0,0 +1,32 @@
|
|||||||
|
#!/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`
|
||||||
|
|
||||||
|
|
||||||
|
# Integration tests
|
||||||
|
function integration_tests {
|
||||||
|
# Building the package:
|
||||||
|
make build
|
||||||
|
|
||||||
|
# Installing the package:
|
||||||
|
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:
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"
|
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
# Copying all the required files to the build directory:
|
||||||
|
preinstall_files
|
||||||
|
|
||||||
|
# Building .rpm package:
|
||||||
|
cd "$SCRIPT_DEST_DIR" && build_package "rpm"
|
||||||
|
|
||||||
|
# Cleaning up:
|
||||||
|
clean_up_files && cd "${SECRET_PROJECT_ROOT}"
|
@ -0,0 +1,35 @@
|
|||||||
|
#!/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 `.rpm` package on your system, see `Installation`
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
# This folder should contain just one .rpm file:
|
||||||
|
RPM_FILE_LOCATION=$(locate_rpm)
|
||||||
|
|
||||||
|
|
||||||
|
# Integration tests
|
||||||
|
function integration_tests {
|
||||||
|
# Installing the package:
|
||||||
|
dnf install -y "$RPM_FILE_LOCATION"
|
||||||
|
|
||||||
|
# Testing the installation:
|
||||||
|
dnf info "git-secret"
|
||||||
|
which "git-secret"
|
||||||
|
|
||||||
|
# Test the manuals:
|
||||||
|
man --where "git-secret" # .7
|
||||||
|
man --where "git-secret-init" # .1
|
||||||
|
}
|
||||||
|
|
||||||
|
integration_tests
|
||||||
|
|
||||||
|
# Unit tests:
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"
|
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||||
|
|
||||||
|
# Variables, which will be used in `bintray.json`:
|
||||||
|
SCRIPT_VERSION=$(bash "${PWD}/git-secret" --version)
|
||||||
|
RELEASE_DATE=$(date +%Y-%m-%d)
|
||||||
|
|
||||||
|
# add `\"override\": 1 \` into the `matrixParams`, if needed:
|
||||||
|
echo "{ \
|
||||||
|
\"package\": { \
|
||||||
|
\"name\": \"git-secret\", \
|
||||||
|
\"repo\": \"rpm\", \
|
||||||
|
\"subject\": \"sobolevn\" \
|
||||||
|
}, \
|
||||||
|
\"version\": {
|
||||||
|
\"name\": \"${SCRIPT_VERSION}\", \
|
||||||
|
\"desc\": \"Version ${SCRIPT_VERSION}\", \
|
||||||
|
\"released\": \"${RELEASE_DATE}\", \
|
||||||
|
\"vcs_tag\": \"v${SCRIPT_VERSION}\", \
|
||||||
|
\"gpgSign\": true \
|
||||||
|
}, \
|
||||||
|
\"files\": [{ \
|
||||||
|
\"includePattern\": \"build/buildroot/(.*\.rpm)\", \
|
||||||
|
\"uploadPattern\": \"/git-secret-${SCRIPT_VERSION}-1.noarch.rpm\"
|
||||||
|
}], \
|
||||||
|
\"publish\": true \
|
||||||
|
}" > "${SECRET_PROJECT_ROOT}/build/rpm_descriptor.json"
|
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# `SECRET_PROJECT_ROOT` must be set before running the script.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Running all the bats-tests:
|
||||||
|
cd "${SECRET_PROJECT_ROOT}"; rm -rf temp; mkdir temp; cd temp;
|
||||||
|
bats "${SECRET_PROJECT_ROOT}/tests"
|
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
PREFIX="$1"
|
||||||
|
if [ -z "$PREFIX" ]; then
|
||||||
|
echo "usage: $0 <prefix>" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Binary:
|
||||||
|
rm -f "$PREFIX"/bin/git-secret
|
||||||
|
|
||||||
|
# Manuals:
|
||||||
|
find "$PREFIX"/share/man/man1 -type f -name "git-secret-*.1" -exec rm -f {} \;
|
||||||
|
rm -f "$PREFIX"/share/man/man7/git-secret.7
|
Loading…
Reference in New Issue