-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hotfix-uncorrelate
- Loading branch information
Showing
55 changed files
with
823 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "edit" | ||
description: "use sed to edit files in different platforms" | ||
inputs: | ||
paths: | ||
description: "file paths delimited by newline and space" | ||
required: true | ||
statements: | ||
description: "sed statements delimited by newline" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "edit" | ||
shell: bash | ||
run: | | ||
set -e | ||
paths=$(echo "${{ inputs.paths }}" | tr '\n' ' ') | ||
SEDI="sed -i" | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
SEDI="sed -i ''" | ||
fi | ||
${SEDI} -e "${{ inputs.statements }}" $paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "etcd" | ||
description: "stop, clean and start etcd in order" | ||
inputs: | ||
stop: | ||
description: "whether to stop" | ||
required: true | ||
clean: | ||
description: "whether to clean" | ||
required: true | ||
start: | ||
description: "whether to start" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- if: fromJSON(inputs.stop) | ||
name: Stop etcd | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
run: cat etcd.pid | xargs kill -9 | ||
|
||
- if: fromJSON(inputs.clean) | ||
name: Clean etcd | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
run: rm -rf *.etcd etcd.* | ||
|
||
- if: fromJSON(inputs.start) | ||
name: Start etcd | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
run: nohup etcd >etcd.log 2>&1 & echo $! > etcd.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "mongodb" | ||
description: "stop, clean and start mongodb in order" | ||
inputs: | ||
stop: | ||
description: "whether to stop" | ||
required: true | ||
clean: | ||
description: "whether to clean" | ||
required: true | ||
start: | ||
description: "whether to start" | ||
required: true | ||
ports: | ||
description: "ports to run on" | ||
required: false | ||
default: "27017" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- if: fromJSON(inputs.stop) || fromJSON(inputs.clean) | ||
name: unimplemented | ||
shell: bash | ||
run: exit 1 | ||
|
||
- if: fromJSON(inputs.start) | ||
name: Create Mongodb Work Directory | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
run: | | ||
for port in ${{ inputs.ports }}; do | ||
mkdir -p $port | ||
done | ||
- if: fromJSON(inputs.start) | ||
name: Start Mongodb | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
run: | | ||
for port in ${{ inputs.ports }}; do | ||
nohup mongod --port $port --dbpath $port --logpath $port/mongodb.log > /dev/null 2>&1 & | ||
echo $! > $port/mongodb.pid | ||
done |
Oops, something went wrong.