|
@@ -0,0 +1,62 @@
|
|
1
|
+#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+echo "This script will attempt to build Marlin for all known configurations."
|
|
4
|
+echo "In case of failure, the current configuration remains in your repository."
|
|
5
|
+echo "To revert to your current version, run 'git checkout -f'."
|
|
6
|
+
|
|
7
|
+self=`basename "$0"`
|
|
8
|
+HERE=`dirname "$0"`
|
|
9
|
+
|
|
10
|
+# Check dependencies
|
|
11
|
+which curl 1>/dev/null 2>&1 || { echo "curl not found, please install it"; exit ; }
|
|
12
|
+which git 1>/dev/null 2>&1 || { echo "git not found, please install it"; exit ; }
|
|
13
|
+if [ -z "$1" ]; then
|
|
14
|
+ echo ""
|
|
15
|
+ echo "ERROR: "
|
|
16
|
+ echo " Expected parameter: $self base_branch [resume_point]"
|
|
17
|
+ echo " with:"
|
|
18
|
+ echo " base_branch The branch in the Configuration repository to use"
|
|
19
|
+ echo " resume_point If not empty, resume building from this board"
|
|
20
|
+
|
|
21
|
+ exit
|
|
22
|
+fi
|
|
23
|
+
|
|
24
|
+# Check if called in the right folder
|
|
25
|
+if [ ! -e "Marlin/src" ]; then
|
|
26
|
+ echo "This script must be called from the root folder of a Marlin repository, please navigate to this folder and call:"
|
|
27
|
+ echo "buildroot/ci-check/$self $1"
|
|
28
|
+ exit
|
|
29
|
+fi
|
|
30
|
+
|
|
31
|
+# Check if the current repository has unmerged changes
|
|
32
|
+if [ -z "$2" ]; then
|
|
33
|
+ git diff --quiet || { echo "Your current repository is not clean. Either commit your change or stash them, and re-run this script"; exit ; }
|
|
34
|
+else
|
|
35
|
+ echo "Resuming from $2"
|
|
36
|
+fi
|
|
37
|
+
|
|
38
|
+TMPDIR=`mktemp -d`
|
|
39
|
+
|
|
40
|
+# Ok, let's do our stuff now
|
|
41
|
+# First extract the current temporary folder
|
|
42
|
+echo "Fetching configuration repository"
|
|
43
|
+if [ ! -e "$TMPDIR/README.md" ]; then
|
|
44
|
+ git clone --single-branch --branch "$1" https://github.com/MarlinFirmware/Configurations.git "$TMPDIR" || { echo "Failed to clone the configuration repository"; exit ; }
|
|
45
|
+ rm -r $TMPDIR/.git
|
|
46
|
+fi
|
|
47
|
+
|
|
48
|
+echo
|
|
49
|
+echo "Start building now..."
|
|
50
|
+echo "====================="
|
|
51
|
+shopt -s nullglob
|
|
52
|
+for config in $TMPDIR/config/examples/*/; do
|
|
53
|
+ [ -d "${config}" ] || continue
|
|
54
|
+ base=`basename "$config"`
|
|
55
|
+ if [ ! -z "$2" ] && [ "$2" != "$base" ]; then
|
|
56
|
+ echo "Skipping $base..."
|
|
57
|
+ continue
|
|
58
|
+ fi
|
|
59
|
+ "$HERE/build_example" "internal" "$TMPDIR" "$base" || { echo "Failed to build $base"; exit ; }
|
|
60
|
+done
|
|
61
|
+
|
|
62
|
+rm -r "$TMPDIR"
|