forked from TFC-Developers/sw_base_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
61 lines (60 loc) · 2.83 KB
/
.drone.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
kind: pipeline
type: docker
name: compile
steps:
- name: Compile AMXX Plugins
image: 192.168.1.27:5000/my-amxx-compiler
commands:
- cp -r /app/* /drone/src/
- cd /drone/src
- bash -c 'for file in *.sma; do echo "Compiling $file";
script_name=$(basename $file .sma);
echo "Script name $script_name";
rm -f include/script_version.inc include/script_name.inc;
echo "stock const _SCRIPT_DATE[] = \"$(git rev-parse --short HEAD)\";" > include/script_version.inc;
echo "stock const _SCRIPT_NAME[] = \"$script_name\";" > include/script_name.inc;
cat include/script_version.inc;
cat include/script_name.inc;
./amxxpc "$file";
done'
- name: upload-plugins
image: alpine
environment:
SSH_PASSWORD:
from_secret: prod_pw
SSH_USERNAME:
from_secret: prod_user
SERVER_HOST:
from_secret: prod_host
commands:
- apk add --no-cache openssh-client sshpass
- echo \"Pw $SSH_PASSWORD User $SSH_USERNAME Host $SERVER_HOST\"
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "mkdir -p /home/gameservers/amxplugins/"
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "rm -rf /home/gameservers/amxplugins/*"
- sshpass -p $SSH_PASSWORD scp -o StrictHostKeyChecking=no /drone/src/*.amxx $SSH_USERNAME@$SERVER_HOST:/home/gameservers/amxplugins/
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "bash /home/gameservers/install_amxplugins.sh"
when:
branch:
- master
- name: upload-plugins-dev
image: alpine
environment:
SSH_PASSWORD:
from_secret: dev_pass
SSH_USERNAME:
from_secret: dev_user
SERVER_HOST:
from_secret: dev_host
commands:
- apk add --no-cache openssh-client sshpass git
- echo "$(git rev-parse --short HEAD)" > /drone/src/commit.txt # Adds short commit version to commit.txt
- echo "$(git rev-parse --abbrev-ref HEAD)" > /drone/src/branch.txt # Adds current branch to branch.txt
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "mkdir -p /home/tfcserver/amxplugins/"
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "rm -rf /home/tfcserver/amxplugins/*"
- sshpass -p $SSH_PASSWORD scp -o StrictHostKeyChecking=no /drone/src/*.txt $SSH_USERNAME@$SERVER_HOST:/home/tfcserver/amxplugins/
- sshpass -p $SSH_PASSWORD scp -o StrictHostKeyChecking=no /drone/src/*.amxx $SSH_USERNAME@$SERVER_HOST:/home/tfcserver/amxplugins/
- sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SERVER_HOST "bash /home/tfcserver/install_amxplugins.sh"
when:
branch:
exclude:
- master