-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtravis.sh
More file actions
executable file
·41 lines (31 loc) · 1016 Bytes
/
Copy pathtravis.sh
File metadata and controls
executable file
·41 lines (31 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Exit on any failure
set -e
SECONDS=0
# Get start time
START_TIME=$(date +"%Y%m%dT%H%M%S")
echo "Start Time: ${START_TIME}"
export build_date=${START_TIME}
export rclone_ver=$(curl -s https://downloads.rclone.org/version.txt | cut -d"v" -f2)
# Check if running in Travis-CI
if [ -z "$TRAVIS_BRANCH" ]; then
echo "Error: this script is meant to run in Travis-CI only"
exit 1
fi
# Check if GitHub token set
if [[ -z "$DH_USERNAME" || -z "$DH_PASSWORD" ]]; then
echo "Error: DOCKERHUB environment variables not set"
exit 2
fi
# Login to dockerhub
echo "${DH_PASSWORD}" | docker login --username $DH_USERNAME --password-stdin
# Register qemu static bins
docker run --rm --privileged multiarch/qemu-user-static:register
# Run the build
./build.sh
# Get start time
END_TIME=$(date +"%Y%m%dT%H%M")
# Display build time statistics
echo "Build Start Time: ${START_TIME}"
echo "Build End Time: ${END_TIME}"
echo "Build Duration: $(($SECONDS / 60)) minutes $((${SECONDS} % 60)) seconds"