Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,52 @@ jobs:

- run:
name: set version and build the rpm
no_output_timeout: 20m
command: |
set -x
set -ex

heartbeat() {
label="$1"
while true; do
echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] still running: ${label}"
sleep 60
done
}

run_with_heartbeat() {
label="$1"
shift

echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] starting: ${label}"
heartbeat "${label}" &
heartbeat_pid=$!

"$@"
status=$?

kill "${heartbeat_pid}" 2>/dev/null || true
wait "${heartbeat_pid}" 2>/dev/null || true

echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] finished: ${label} (exit ${status})"
return ${status}
}

version=$(cat VERSION)
echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION
make rpm
run_with_heartbeat "make rpm" make rpm

git config user.email "dev@objectrocket.com"
git config user.name "objectrocketdev"
git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD
rpm -qa | grep ssh
rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64
git push --tags origin
run_with_heartbeat "git push --tags origin" git push --tags origin -vv

echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] creating artifact directory: mongodb_consistent_backup_rpm"
mkdir mongodb_consistent_backup_rpm
echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] copying rpm artifact from /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm"
cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/
echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] artifact copy complete"

- save_cache:
paths:
Expand All @@ -59,4 +90,3 @@ jobs:
- store_artifacts:
path: mongodb_consistent_backup_rpm
destination: mongodb_consistent_backup

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.9
1.4.10
2 changes: 1 addition & 1 deletion mongodb_consistent_backup/Replication/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def config(parser):
parser.add_argument("--replication.max_lag_secs", dest="replication.max_lag_secs", default=10, type=int,
parser.add_argument("--replication.max_lag_secs", dest="replication.max_lag_secs", default=20, type=int,
help="Max lag of backup replica(s) in seconds (default: 10)")
parser.add_argument("--replication.min_priority", dest="replication.min_priority", default=0, type=int,
help="Min priority of secondary members for backup (default: 0)")
Expand Down