mirror of https://github.com/sobolevn/git-secret
Adds new installation instructions for deb and rpm (#662)
* Adds new installation instructions for deb and rpm * Fixes CIpull/663/head
parent
6294262692
commit
37a28389d2
@ -0,0 +1,33 @@
|
||||
# Initially copied from
|
||||
# https://github.com/jordansissel/fpm/blob/master/Dockerfile
|
||||
|
||||
# TODO: Move to native image
|
||||
# see: https://github.com/jordansissel/fpm/issues/1782
|
||||
FROM alpine:3.13
|
||||
|
||||
ENV CODE_DIR='/code'
|
||||
ENV SECRET_PROJECT_ROOT="$CODE_DIR"
|
||||
|
||||
RUN apk add --no-cache --update \
|
||||
# fpm deps:
|
||||
ruby \
|
||||
ruby-dev \
|
||||
ruby-etc \
|
||||
gcc \
|
||||
libffi-dev \
|
||||
make \
|
||||
libc-dev \
|
||||
rpm \
|
||||
tar \
|
||||
# Direct dependencies:
|
||||
bash \
|
||||
gawk \
|
||||
git \
|
||||
gnupg \
|
||||
# Assumed to be present:
|
||||
curl
|
||||
|
||||
# Installing fpm:
|
||||
RUN gem install --no-document fpm
|
||||
|
||||
WORKDIR $CODE_DIR
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck disable=2034
|
||||
GITSECRET_VERSION='0.4.0.alpha1'
|
||||
GITSECRET_VERSION='0.4.0'
|
||||
|
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||
|
||||
preinstall_files '-c'
|
||||
|
||||
# Building .deb package:
|
||||
cd "$SCRIPT_DEST_DIR" && build_package "apk"
|
||||
|
||||
# Cleaning up:
|
||||
clean_up_files && cd "${SECRET_PROJECT_ROOT}"
|
@ -1,39 +0,0 @@
|
||||
#!/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 `.apk` package on your system, see `Installation`
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
|
||||
|
||||
# This folder should contain just one .apk file:
|
||||
APK_FILE_LOCATION=$(locate_apk)
|
||||
|
||||
|
||||
# Integration tests
|
||||
function integration_tests {
|
||||
# Installing the package:
|
||||
apk add "$APK_FILE_LOCATION"
|
||||
|
||||
# Configuring the dependencies:
|
||||
apk add --update-cache
|
||||
|
||||
# Testing the installation:
|
||||
apk info | grep 'git-secret'
|
||||
# lint says to use 'command -v' and not 'which'
|
||||
command -v '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"
|
@ -1,31 +0,0 @@
|
||||
#!/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\": \"apk\", \
|
||||
\"subject\": \"sobolevn\" \
|
||||
}, \
|
||||
\"version\": {
|
||||
\"name\": \"${SCRIPT_VERSION}\", \
|
||||
\"desc\": \"Version ${SCRIPT_VERSION}\", \
|
||||
\"released\": \"${RELEASE_DATE}\", \
|
||||
\"vcs_tag\": \"v${SCRIPT_VERSION}\", \
|
||||
\"gpgSign\": true \
|
||||
}, \
|
||||
\"files\": [{ \
|
||||
\"includePattern\": \"build/buildroot/(.*\\\\\\.apk)\", \
|
||||
\"uploadPattern\": \"/git-secret_${SCRIPT_VERSION}_all.apk\" \
|
||||
}], \
|
||||
\"publish\": true \
|
||||
}" > "${SECRET_PROJECT_ROOT}/build/apk_descriptor.json"
|
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "$SECRET_PROJECT_ROOT/utils/build-utils.sh"
|
||||
|
||||
preinstall_files '-c'
|
||||
|
||||
# Building .deb package:
|
||||
cd "$SCRIPT_DEST_DIR" && build_package 'apk'
|
||||
|
||||
# Cleaning up:
|
||||
clean_up_files && cd "$SECRET_PROJECT_ROOT"
|
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$SECRETS_ARTIFACTORY_CREDENTIALS" ]; then
|
||||
echo '$SECRETS_ARTIFACTORY_CREDENTIALS is not set'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "$SECRET_PROJECT_ROOT/utils/build-utils.sh"
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "$SECRET_PROJECT_ROOT/src/version.sh"
|
||||
|
||||
VERSION_NAME="git-secret-${GITSECRET_VERSION}.apk"
|
||||
|
||||
# Artifactory location:
|
||||
BASE_API_URL='https://gitsecret.jfrog.io/artifactory'
|
||||
|
||||
# This folder should contain just one `.apk` file:
|
||||
APK_FILE_LOCATION="$(locate_release 'apk')"
|
||||
APK_FILE_NAME="$(basename "$APK_FILE_LOCATION")"
|
||||
|
||||
|
||||
function upload_with_architecture {
|
||||
local arch="$1"
|
||||
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
--max-time 10 \
|
||||
--retry 3 \
|
||||
--retry-delay 5 \
|
||||
-XPUT "$BASE_API_URL/git-secret-apk/all/main/$arch/$VERSION_NAME" \
|
||||
-T "$APK_FILE_LOCATION"
|
||||
}
|
||||
|
||||
# Full list is here:
|
||||
# http://dl-cdn.alpinelinux.org/alpine/v3.13/main/
|
||||
ARCHITECTURES=(
|
||||
'aarch64'
|
||||
'armhf'
|
||||
'armv7'
|
||||
'mips64'
|
||||
'ppc64le'
|
||||
's390x'
|
||||
'x86_64'
|
||||
'x86'
|
||||
)
|
||||
|
||||
for architecture in "${ARCHITECTURES[@]}"; do
|
||||
upload_with_architecture "$architecture"
|
||||
done
|
||||
|
||||
# Now, we need to trigger metadata reindex:
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
--max-time 5 \
|
||||
--retry 3 \
|
||||
--retry-delay 5 \
|
||||
-XPOST "$BASE_API_URL/api/alpine/git-secret-apk/reindex"
|
||||
|
||||
echo
|
||||
echo "Done: released $APK_FILE_NAME"
|
@ -1,39 +0,0 @@
|
||||
#!/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'
|
||||
# lint says to use 'command -v' and not 'which'
|
||||
command -v '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"
|
@ -1,36 +0,0 @@
|
||||
#!/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\": \"git-secret\", \
|
||||
\"deb_component\": \"main\", \
|
||||
\"deb_architecture\": \"all\" \
|
||||
} \
|
||||
}], \
|
||||
\"publish\": true \
|
||||
}" > "${SECRET_PROJECT_ROOT}/build/deb_descriptor.json"
|
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$SECRETS_ARTIFACTORY_CREDENTIALS" ]; then
|
||||
echo '$SECRETS_ARTIFACTORY_CREDENTIALS is not set'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "$SECRET_PROJECT_ROOT/utils/build-utils.sh"
|
||||
|
||||
# Artifactory location:
|
||||
BASE_API_URL='https://gitsecret.jfrog.io/artifactory'
|
||||
|
||||
# This folder should contain just one `.dev` file:
|
||||
DEB_FILE_LOCATION="$(locate_release 'deb')"
|
||||
DEB_FILE_NAME="$(basename "$DEB_FILE_LOCATION")"
|
||||
|
||||
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
-XPUT "$BASE_API_URL/git-secret-deb/$DEB_FILE_NAME;deb.distribution=git-secret;deb.component=main;deb.architecture=all" \
|
||||
-T "$DEB_FILE_LOCATION"
|
||||
|
||||
# Now, we need to trigger metadata reindex:
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
-XPOST "$BASE_API_URL/api/deb/reindex/git-secret-deb"
|
||||
|
||||
echo
|
||||
echo "Done: released $DEB_FILE_NAME"
|
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$SECRETS_ARTIFACTORY_CREDENTIALS" ]; then
|
||||
echo '$SECRETS_ARTIFACTORY_CREDENTIALS is not set'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
source "$SECRET_PROJECT_ROOT/utils/build-utils.sh"
|
||||
|
||||
# Artifactory location:
|
||||
BASE_API_URL='https://gitsecret.jfrog.io/artifactory'
|
||||
|
||||
# This folder should contain just one `.rpm` file:
|
||||
RPM_FILE_LOCATION="$(locate_release 'rpm')"
|
||||
RPM_FILE_NAME="$(basename "$RPM_FILE_LOCATION")"
|
||||
|
||||
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
-XPUT "$BASE_API_URL/git-secret-rpm/rpm/$RPM_FILE_NAME" \
|
||||
-T "$RPM_FILE_LOCATION"
|
||||
|
||||
# Now, we need to trigger metadata reindex:
|
||||
curl -sS -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
||||
-XPOST "$BASE_API_URL/api/yum/git-secret-rpm?async=1"
|
||||
|
||||
echo
|
||||
echo "Done: released $RPM_FILE_NAME"
|
@ -0,0 +1,9 @@
|
||||
[git-secret-rpm]
|
||||
name=git-secret-rpm
|
||||
baseurl=https://gitsecret.jfrog.io/artifactory/git-secret-rpm
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
|
||||
# Uncomment the following lines to enable repository-level GPG key check:
|
||||
# gpgkey=https://gitsecret.jfrog.io/artifactory/git-secret-rpm/repodata/repomd.xml.key
|
||||
# repo_gpgcheck=1
|
@ -1,39 +0,0 @@
|
||||
#!/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 {
|
||||
# Note that `dnf` must be installed.
|
||||
# CentOS 6 does not support `dnf`.
|
||||
|
||||
# Installing the package:
|
||||
dnf install -y "$RPM_FILE_LOCATION"
|
||||
|
||||
# Testing the installation:
|
||||
dnf info 'git-secret'
|
||||
# 'command -v' is like 'which'
|
||||
command -v '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"
|
@ -1,31 +0,0 @@
|
||||
#!/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"
|
Loading…
Reference in New Issue