|
3 | 3 | # List of folder paths to iterate through make sure there is no trailing slash |
4 | 4 | folders=( |
5 | 5 | "examples/3d/pointCloudExample" |
6 | | -# "examples/3d/3DPrimitivesExample" |
7 | | -# "examples/3d/ofxAssimpBoneControlExample" |
8 | | -# "examples/3d/ofxAssimpAdvancedExample" |
9 | | - # "examples/3d/ofxAssimpAdvancedExample" |
| 6 | + "examples/3d/3DPrimitivesExample" |
| 7 | + "examples/3d/ofxAssimpBoneControlExample" |
| 8 | + "examples/3d/ofxAssimpAdvancedExample" |
10 | 9 | # Add more paths as needed |
11 | 10 | ) |
12 | 11 |
|
13 | | -echo "RUNNING IN CI ${GH_BRANCH} ${GH_ACTIONS}" |
14 | | -echo "TRYING USER/SERVER ${GA_EXAMPLES_USER}@${GA_EXAMPLES_SERVER}" |
| 12 | +#echo "RUNNING IN CI ${GH_BRANCH} ${GH_ACTIONS}" |
| 13 | +#echo "TRYING USER/SERVER ${GA_EXAMPLES_USER}@${GA_EXAMPLES_SERVER}" |
15 | 14 |
|
16 | | -#cur_root=$(pwd); |
17 | | -#cd $cur_root; |
18 | | -#mkdir -p out |
19 | | -#out_folder="$cur_root/out" |
20 | | -# |
21 | | -## Iterate through the folder paths |
22 | | -#for folder in "${folders[@]}"; do |
23 | | -# # Check if the folder exists |
24 | | -# if [ -d "$folder" ]; then |
25 | | -# |
26 | | -# # Change to the directory |
27 | | -# cd $folder |
28 | | -# cp ../../../scripts/templates/emscripten/Makefile . |
29 | | -# cp ../../../scripts/templates/emscripten/config.make . |
30 | | -# emmake make -j2 Release |
31 | | -# |
32 | | -# errorcode=$? |
33 | | -# if [[ $errorcode -ne 0 ]]; then |
34 | | -# echo "Couldn't build emscripten example: $folder" |
35 | | -# else |
36 | | -# folder_name=$(basename "$folder") |
37 | | -# cp -r "bin/em/$folder_name" "$out_folder/" |
38 | | -# fi |
39 | | -# |
40 | | -# cd $cur_root |
41 | | -# else |
42 | | -# echo "Folder does not exist: $folder" |
43 | | -# fi |
44 | | -#done |
45 | | -# |
46 | | -#cd $cur_root; |
47 | | -#DO_UPLOAD="false" |
48 | | -# |
49 | | -##if [[ "$GH_ACTIONS" = true && "${GH_BRANCH}" == "master" && -z "${GH_HEAD_REF}" ]]; then |
50 | | -#if [[ "$GH_ACTIONS" = "true" ]]; then |
51 | | -# echo "upload 1/2 - make key file" |
52 | | -# # Temporary file to store the private key |
53 | | -# key_file=$(mktemp) |
54 | | -# echo -e "$GA_EXAMPLES_KEY" > "$key_file" |
55 | | -# chmod 600 "$key_file" |
56 | | -# DO_UPLOAD="true"; |
57 | | -#fi |
58 | | -# |
59 | | -#if [ "$DO_UPLOAD" = "true" ]; then |
60 | | -# echo "upload 2/2 - time for rsync" |
61 | | -# remote_path="/home/ofadmin/openFrameworks.cc/examples/" |
62 | | -# rsync -avz -e "ssh -i $key_file" "$out_folder/" "$GA_EXAMPLES_USER@$GA_EXAMPLES_SERVER:$remote_path" |
63 | | -# rm -f "$key_file" |
64 | | -#fi |
| 15 | +cur_root=$(pwd); |
| 16 | +cd $cur_root; |
| 17 | +mkdir -p out |
| 18 | +out_folder="$cur_root/out" |
| 19 | + |
| 20 | +# Iterate through the folder paths |
| 21 | +for folder in "${folders[@]}"; do |
| 22 | + # Check if the folder exists |
| 23 | + if [ -d "$folder" ]; then |
| 24 | + |
| 25 | + # Change to the directory |
| 26 | + cd $folder |
| 27 | + cp ../../../scripts/templates/emscripten/Makefile . |
| 28 | + cp ../../../scripts/templates/emscripten/config.make . |
| 29 | + emmake make -j2 Release |
| 30 | + |
| 31 | + errorcode=$? |
| 32 | + if [[ $errorcode -ne 0 ]]; then |
| 33 | + echo "Couldn't build emscripten example: $folder" |
| 34 | + else |
| 35 | + folder_name=$(basename "$folder") |
| 36 | + cp -r "bin/em/$folder_name" "$out_folder/" |
| 37 | + fi |
| 38 | + |
| 39 | + cd $cur_root |
| 40 | + else |
| 41 | + echo "Folder does not exist: $folder" |
| 42 | + fi |
| 43 | +done |
| 44 | + |
| 45 | +cd $cur_root; |
| 46 | +DO_UPLOAD="false" |
| 47 | + |
| 48 | +#if [[ "$GH_ACTIONS" = true && "${GH_BRANCH}" == "master" && -z "${GH_HEAD_REF}" ]]; then |
| 49 | +if [[ "$GH_ACTIONS" = "true" ]]; then |
| 50 | + echo "upload 1/2 - make key file" |
| 51 | + # Temporary file to store the private key |
| 52 | + key_file=$(mktemp) |
| 53 | + echo -e "$GA_EXAMPLES_KEY" > "$key_file" |
| 54 | + chmod 600 "$key_file" |
| 55 | + DO_UPLOAD="true"; |
| 56 | +fi |
| 57 | + |
| 58 | +if [ "$DO_UPLOAD" = "true" ]; then |
| 59 | + echo "upload 2/2 - time for rsync" |
| 60 | + remote_path="/home/ofadmin/openFrameworks.cc/examples/" |
| 61 | + rsync -avz -e "ssh -i $key_file" "$out_folder/" "$GA_EXAMPLES_USER@$GA_EXAMPLES_SERVER:$remote_path" |
| 62 | + rm -f "$key_file" |
| 63 | +fi |
0 commit comments