mirror of
https://github.com/Frail7487Real/laughing-spork.git
synced 2024-11-14 10:55:10 -05:00
add name setting instead of hardcoding
This commit is contained in:
parent
25e3d6f952
commit
53b331d61b
2 changed files with 10 additions and 3 deletions
9
.github/workflows/runglobal.yml
vendored
9
.github/workflows/runglobal.yml
vendored
|
@ -8,6 +8,11 @@ on:
|
|||
required: true
|
||||
default: true
|
||||
type: boolean
|
||||
name:
|
||||
description: 'Machine name'
|
||||
required: true
|
||||
default: 'global'
|
||||
type: string
|
||||
oldTailscaleHostname:
|
||||
description: 'Old Tailscale Hostname (not needed)'
|
||||
required: false
|
||||
|
@ -47,7 +52,7 @@ jobs:
|
|||
- name: Change Security Word
|
||||
run: echo "$(whoami):password1!" | sudo chpasswd
|
||||
- name: Start the scale to measure the weight of this server
|
||||
run: sudo tailscale up --hostname="$(if ${{ inputs.runNext }}; then echo global; else echo manual-global-$(TZ=Asia/Tokyo date +%H-%M-%S); fi)" --advertise-exit-node --ssh --authkey ${{ secrets.TAILSCALE_KEY }}
|
||||
run: sudo tailscale up --hostname="$(if ${{ inputs.runNext }}; then echo ${{ inputs.name }}; else echo manual-${{ inputs.name }}-$(TZ=Asia/Tokyo date +%H-%M-%S); fi)" --advertise-exit-node --ssh --authkey ${{ secrets.TAILSCALE_KEY }}
|
||||
- name: Fix the PS having no colors
|
||||
# the problem is actually the bash_profile on runner's home
|
||||
# but i was too lazy and simply did this (works too)
|
||||
|
@ -92,4 +97,4 @@ jobs:
|
|||
chmod +x loop.sh
|
||||
|
||||
# what an argument mess
|
||||
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master global $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }}
|
||||
bash loop.sh ${{ inputs.runNext }} $GH_TOKEN global runglobal.yml master ${{ inputs.name }} $WEBHOOK_URL true ${{ inputs.oldTailscaleHostname }}
|
||||
|
|
4
loop.sh
4
loop.sh
|
@ -80,7 +80,9 @@ check() {
|
|||
command+="-f \"ref=$BRANCH\" -f \"inputs[runNext]=true\" "
|
||||
|
||||
if [[ "$IS_GLOBAL" == "true" ]]; then
|
||||
command+="-f \"inputs[oldTailscaleHostname]=$hostname\""
|
||||
command+="-f \"inputs[oldTailscaleHostname]=$hostname\" "
|
||||
|
||||
command+="-f \"inputs[name]=$NAME\""
|
||||
|
||||
cd /mnt/globalData/toBackup
|
||||
|
||||
|
|
Loading…
Reference in a new issue