-
Notifications
You must be signed in to change notification settings - Fork 42
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 fastapi-framework
- Loading branch information
Showing
4 changed files
with
94 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ lto | |
LTS | ||
LXD | ||
lxd | ||
macOS | ||
Multipass | ||
multipass | ||
nano | ||
|
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 |
---|---|---|
|
@@ -17,18 +17,14 @@ execute: | | |
pip install -r requirements.txt | ||
# [docs:create-venv-end] | ||
# [docs:run-flask] | ||
flask run -p 8000 & | ||
# [docs:run-flask-end] | ||
retry -n 5 --wait 2 curl localhost:8000 | ||
# [docs:curl-flask] | ||
curl localhost:8000 | ||
# [docs:curl-flask-end] | ||
# [docs:stop-flask] | ||
kill $! | ||
# [docs:stop-flask-end] | ||
# [docs:create-rockcraft-yaml] | ||
rockcraft init --profile flask-framework | ||
|
@@ -44,15 +40,18 @@ execute: | | |
# [docs:ls-rock-end] | ||
# [docs:skopeo-copy] | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:flask-hello-world_0.1_amd64.rock docker-daemon:flask-hello-world:0.1 | ||
sudo rockcraft.skopeo --insecure-policy \ | ||
copy oci-archive:flask-hello-world_0.1_amd64.rock \ | ||
docker-daemon:flask-hello-world:0.1 | ||
# [docs:skopeo-copy-end] | ||
# [docs:docker-images] | ||
sudo docker images flask-hello-world:0.1 | ||
# [docs:docker-images-end] | ||
# [docs:docker-run] | ||
sudo docker run --rm -d -p 8000:8000 --name flask-hello-world flask-hello-world:0.1 | ||
sudo docker run --rm -d -p 8000:8000 \ | ||
--name flask-hello-world flask-hello-world:0.1 | ||
# [docs:docker-run-end] | ||
retry -n 5 --wait 2 curl localhost:8000 | ||
|
@@ -70,8 +69,11 @@ execute: | | |
# [docs:stop-docker-end] | ||
# [docs:change-base] | ||
sed -i "s/base: .*/base: bare\nbuild-base: [email protected]/g" rockcraft.yaml | ||
sed -i \ | ||
"s/base: .*/base: bare\nbuild-base: [email protected]/g" \ | ||
rockcraft.yaml | ||
# [docs:change-base-end] | ||
sed -i "s/version: .*/version: 0.1-chiselled/g" rockcraft.yaml | ||
# [docs:chisel-pack] | ||
rockcraft pack | ||
|
@@ -82,9 +84,12 @@ execute: | | |
# [docs:ls-bare-rock-end] | ||
# [docs:docker-run-chisel] | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:flask-hello-world_0.1_amd64.rock docker-daemon:flask-hello-world:0.1 | ||
sudo docker images flask-hello-world:0.1 | ||
sudo docker run --rm -d -p 8000:8000 --name flask-hello-world flask-hello-world:0.1 | ||
sudo rockcraft.skopeo --insecure-policy \ | ||
copy oci-archive:flask-hello-world_0.1-chiselled_amd64.rock \ | ||
docker-daemon:flask-hello-world:0.1-chiselled | ||
sudo docker images flask-hello-world:0.1-chiselled | ||
sudo docker run --rm -d -p 8000:8000 \ | ||
--name flask-hello-world flask-hello-world:0.1-chiselled | ||
# [docs:docker-run-chisel-end] | ||
retry -n 5 --wait 2 curl localhost:8000 | ||
|
@@ -94,7 +99,7 @@ execute: | | |
# [docs:stop-docker-chisel] | ||
sudo docker stop flask-hello-world | ||
sudo docker rmi flask-hello-world:0.1 | ||
sudo docker rmi flask-hello-world:0.1-chiselled | ||
# [docs:stop-docker-chisel-end] | ||
cat time-app.py > app.py | ||
|
@@ -103,9 +108,12 @@ execute: | | |
# [docs:docker-run-update] | ||
rockcraft pack | ||
sudo rockcraft.skopeo --insecure-policy copy oci-archive:flask-hello-world_0.2_amd64.rock docker-daemon:flask-hello-world:0.2 | ||
sudo rockcraft.skopeo --insecure-policy \ | ||
copy oci-archive:flask-hello-world_0.2_amd64.rock \ | ||
docker-daemon:flask-hello-world:0.2 | ||
sudo docker images flask-hello-world:0.2 | ||
sudo docker run --rm -d -p 8000:8000 --name flask-hello-world flask-hello-world:0.2 | ||
sudo docker run --rm -d -p 8000:8000 \ | ||
--name flask-hello-world flask-hello-world:0.2 | ||
# [docs:docker-run-update-end] | ||
retry -n 5 --wait 2 curl localhost:8000/time | ||
|
@@ -123,5 +131,8 @@ execute: | | |
deactivate | ||
rm -rf .venv | ||
# delete all the files created during the tutorial | ||
rm flask-hello-world_0.1_amd64.rock flask-hello-world_0.2_amd64.rock rockcraft.yaml app.py requirements.txt | ||
rm flask-hello-world_0.1_amd64.rock \ | ||
flask-hello-world_0.1-chiselled_amd64.rock \ | ||
flask-hello-world_0.2_amd64.rock \ | ||
rockcraft.yaml app.py requirements.txt | ||
# [docs:cleanup-end] |
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