-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
33 lines (26 loc) · 814 Bytes
/
deploy.sh
File metadata and controls
33 lines (26 loc) · 814 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
#!/bin/sh -ex
cd "$(dirname "$0")" # ルートディレクトリへ移動
target_branch="Anpo13211-upload-1"
git config --global user.name "CircleCI deployer"
git config --global user.email "<>"
git fetch origin
git checkout $target_branch
git reset --hard origin/main
# Compile the source files
gcc -o a.out 6th_week/bptree_test.cpp 6th_week/bptree.cpp -DTEST
if [ $? -ne 0 ]; then
echo "Compilation failed"
exit 1
fi
# Run the compiled binary and save output
echo "output of a.out: $(./a.out)" > a.txt
# Stage and commit changes
git add a.out a.txt
git commit -m "[skip ci] updates GitHub Pages"
if [ $? -ne 0 ]; then
echo "nothing to commit"
exit 0
fi
# Push changes to the remote branch
git remote set-url origin "git@github.com:Anpo13211/BP-tree.git"
git push -f origin $target_branch