Skip to content

Commit

Permalink
try quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ofTheo committed Dec 5, 2023
1 parent 2c11d7e commit c8570f1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/manual-web-examples.yml
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: ./scripts/ci/$TARGET/install_web_examples.sh
- name: Build
run: docker exec -e GA_EXAMPLES_USER=${{ secrets.SSH_USER }} -e GA_EXAMPLES_SERVER=${{ secrets.SSH_SERVER }} -e GA_EXAMPLES_KEY=${{ secrets.SSH_KEY }} -e GH_HEAD_REF=${{ github.head_ref }} -e GH_BRANCH=${{ github.ref_name }} -e GH_ACTIONS=true -i emscripten sh -c "scripts/ci/$TARGET/examples_to_build.sh"
run: docker exec -e GA_EXAMPLES_USER=${{ secrets.SSH_USER }} -e GA_EXAMPLES_SERVER=${{ secrets.SSH_SERVER }} -e GA_EXAMPLES_KEY="${{ secrets.SSH_KEY }}" -e GH_HEAD_REF=${{ github.head_ref }} -e GH_BRANCH=${{ github.ref_name }} -e GH_ACTIONS=true -i emscripten sh -c "scripts/ci/$TARGET/examples_to_build.sh"
env:
GA_EXAMPLES_USER: ${{ secrets.SSH_USER }}
GA_EXAMPLES_SERVER: ${{ secrets.SSH_SERVER }}
Expand Down
98 changes: 49 additions & 49 deletions scripts/ci/emscripten/examples_to_build.sh
Expand Up @@ -13,52 +13,52 @@ folders=(
echo "RUNNING IN CI ${GH_BRANCH} ${GH_ACTIONS}"
echo "TRYING USER/SERVER ${GA_EXAMPLES_USER}@${GA_EXAMPLES_SERVER}"

cur_root=$(pwd);
cd $cur_root;
mkdir -p out
out_folder="$cur_root/out"

# Iterate through the folder paths
for folder in "${folders[@]}"; do
# Check if the folder exists
if [ -d "$folder" ]; then

# Change to the directory
cd $folder
cp ../../../scripts/templates/emscripten/Makefile .
cp ../../../scripts/templates/emscripten/config.make .
emmake make -j2 Release

errorcode=$?
if [[ $errorcode -ne 0 ]]; then
echo "Couldn't build emscripten example: $folder"
else
folder_name=$(basename "$folder")
cp -r "bin/em/$folder_name" "$out_folder/"
fi

cd $cur_root
else
echo "Folder does not exist: $folder"
fi
done

cd $cur_root;
DO_UPLOAD="false"

#if [[ "$GH_ACTIONS" = true && "${GH_BRANCH}" == "master" && -z "${GH_HEAD_REF}" ]]; then
if [[ "$GH_ACTIONS" = "true" ]]; then
echo "upload 1/2 - make key file"
# Temporary file to store the private key
key_file=$(mktemp)
echo -e "$GA_EXAMPLES_KEY" > "$key_file"
chmod 600 "$key_file"
DO_UPLOAD="true";
fi

if [ "$DO_UPLOAD" = "true" ]; then
echo "upload 2/2 - time for rsync"
remote_path="/home/ofadmin/openFrameworks.cc/examples/"
rsync -avz -e "ssh -i $key_file" "$out_folder/" "$GA_EXAMPLES_USER@$GA_EXAMPLES_SERVER:$remote_path"
rm -f "$key_file"
fi
#cur_root=$(pwd);
#cd $cur_root;
#mkdir -p out
#out_folder="$cur_root/out"
#
## Iterate through the folder paths
#for folder in "${folders[@]}"; do
# # Check if the folder exists
# if [ -d "$folder" ]; then
#
# # Change to the directory
# cd $folder
# cp ../../../scripts/templates/emscripten/Makefile .
# cp ../../../scripts/templates/emscripten/config.make .
# emmake make -j2 Release
#
# errorcode=$?
# if [[ $errorcode -ne 0 ]]; then
# echo "Couldn't build emscripten example: $folder"
# else
# folder_name=$(basename "$folder")
# cp -r "bin/em/$folder_name" "$out_folder/"
# fi
#
# cd $cur_root
# else
# echo "Folder does not exist: $folder"
# fi
#done
#
#cd $cur_root;
#DO_UPLOAD="false"
#
##if [[ "$GH_ACTIONS" = true && "${GH_BRANCH}" == "master" && -z "${GH_HEAD_REF}" ]]; then
#if [[ "$GH_ACTIONS" = "true" ]]; then
# echo "upload 1/2 - make key file"
# # Temporary file to store the private key
# key_file=$(mktemp)
# echo -e "$GA_EXAMPLES_KEY" > "$key_file"
# chmod 600 "$key_file"
# DO_UPLOAD="true";
#fi
#
#if [ "$DO_UPLOAD" = "true" ]; then
# echo "upload 2/2 - time for rsync"
# remote_path="/home/ofadmin/openFrameworks.cc/examples/"
# rsync -avz -e "ssh -i $key_file" "$out_folder/" "$GA_EXAMPLES_USER@$GA_EXAMPLES_SERVER:$remote_path"
# rm -f "$key_file"
#fi

0 comments on commit c8570f1

Please sign in to comment.