Created
January 4, 2022 06:51
-
-
Save yangchenyun/df629c9dbffbd0b73d935214a3694d35 to your computer and use it in GitHub Desktop.
Minibox Yaml Idea
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
{ | |
"steps": [ | |
{ | |
"run": "cp -r /home/box/docker/minibox ", | |
"name": "backup" | |
}, | |
{ | |
"run": "cp -r /home/box/docker/minibox /home/box/docker/minibox/1_2_4-ota", | |
"name": "prepare new" | |
}, | |
{ | |
"run": "cd /home/box/docker/minibox/1_2_4-ota", | |
"name": "Change dir" | |
}, | |
{ | |
"run": "sed 's/harbor\\.turingvideo\\.com\\/minibox\\/minibox:.*/harbor\\.turingvideo\\.com\\/minibox\\/minibox:1\\.2\\.4-ota/' -i ./docker-compose.yml", | |
"name": "Update docker-compose.yaml" | |
}, | |
{ | |
"run": "docker-compose down; docker-compose up -d", | |
"name": "Commit the change" | |
}, | |
{ | |
"run": "sudo docker container ps --format '{{ '{{' }} .Image {{ '}}' }}' > /tmp/1_2_4-ota.result.check-successful", | |
"name": "check successful" | |
}, | |
{ | |
"run": " | |
if ! [ cat /tmp/1_2_4-ota.result.check-successful | grep -E 'minibox:1.2.3$' ]; then | |
docker-compose down; cd /home/box/docker/minibox/backup_for_1_2_4-ota; docker-compose up -d; | |
fi | |
", | |
"name": "Restore if upgrades failed." | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tested on device