Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: v0.7.2 #443

Merged
merged 5 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ e2e/users.toml

.shuttle-*
docker-compose.rendered.yml

.env
node_modules/
package.json
yarn.lock

*.wasm
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 111 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RUST_LOG?=debug

DOCKER_COMPOSE_ENV=STACK=$(STACK) BACKEND_TAG=$(TAG) PROVISIONER_TAG=$(TAG) POSTGRES_TAG=${POSTGRES_TAG} APPS_FQDN=$(APPS_FQDN) DB_FQDN=$(DB_FQDN) POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) RUST_LOG=$(RUST_LOG) CONTAINER_REGISTRY=$(CONTAINER_REGISTRY) MONGO_INITDB_ROOT_USERNAME=$(MONGO_INITDB_ROOT_USERNAME) MONGO_INITDB_ROOT_PASSWORD=$(MONGO_INITDB_ROOT_PASSWORD)

.PHONY: images clean src up down deploy shuttle-% postgres docker-compose.rendered.yml test
.PHONY: images clean src up down deploy shuttle-% postgres docker-compose.rendered.yml test bump-% deploy-examples publish publish-% --validate-version

clean:
rm .shuttle-*
Expand Down Expand Up @@ -94,3 +94,113 @@ shuttle-%: ${SRC} Cargo.lock
$(BUILDX_FLAGS) \
-f Containerfile \
.

# Bunch of targets to make bumping the shuttle version easier
#
# Dependencies: git, cargo-edit, fastmod, ripgrep
# Usage: make bump-version current=0.6.3 version=0.7.0
bump-version: --validate-version
git checkout development
git fetch --all
git pull upstream
git checkout -b "chore/v$(version)"
cargo set-version --workspace "$(version)"

$(call next, bump-resources)

bump-resources:
git commit -m "chore: v$(version)"
fastmod --fixed-strings $(current) $(version) resources

$(call next, bump-examples)

bump-examples:
git commit -m "chore: resources v$(version)"
fastmod --fixed-strings $(current) $(version) examples

$(call next, bump-misc)

bump-misc:
git commit -m "docs: v$(version)"
fastmod --fixed-strings $(current) $(version)

$(call next, bump-final)

bump-final:
git commit -m "misc: v$(version)"
git push --set-upstream origin $$(git rev-parse --abbrev-ref HEAD)

echo "Make pull request and confirm everything is okay. Then run:"
echo "make publish"

# Deploy all our example using the command set in shuttle-command
# Usage: make deploy-example shuttle-command="cargo shuttle" -j 2
deploy-examples: deploy-examples/rocket/hello-world \
deploy-examples/rocket/persist \
deploy-examples/rocket/postgres \
deploy-examples/rocket/secrets \
deploy-examples/rocket/authentication \
deploy-examples/axum/hello-world \
deploy-examples/axum/websocket \
deploy-examples/poem/hello-world \
deploy-examples/poem/mongodb \
deploy-examples/poem/postgres \
deploy-examples/salvo/hello-world \
deploy-examples/tide/hello-world \
deploy-examples/tide/postgres \
deploy-examples/tower/hello-world \
deploy-examples/warp/hello-world \

echo "All example have been redeployed"

deploy-examples/%:
cd examples/$(*); $(shuttle-command) project rm || echo -e "\x1B[33m>> Nothing to remove for $*\x1B[39m"
sleep 5
cd examples/$(*); $(shuttle-command) project new
sleep 5
cd examples/$(*); $(shuttle-command) deploy

define next
cargo check # To update Cargo.lock
git add --all
git --no-pager diff --staged

echo -e "\x1B[36m>> Is this correct?\x1B[39m"
read yn; if [ $$yn != "y" ]; then echo "Fix the issues then continue with:"; echo "make version=$(version) current=$(current) $1"; exit 2; fi

make $1
endef

# Publish all our crates to crates.io
# See CONTRIBUTING.md for the dependency graph
# Usage: make publish -j 4
publish: publish-resources publish-cargo-shuttle
echo "The branch can now be safely merged"

publish-resources: publish-resources/aws-rds \
publish-resources/persist \
publish-resources/shared-db

publish-cargo-shuttle: publish-resources/secrets
cd cargo-shuttle; cargo publish
sleep 10 # Wait for crates.io to update

publish-service: publish-codegen publish-common
cd service; cargo publish
sleep 10 # Wait for crates.io to update

publish-codegen:
cd codegen; cargo publish
sleep 10 # Wait for crates.io to update

publish-common:
cd common; cargo publish
sleep 10 # Wait for crates.io to update

publish-resources/%: publish-service
cd resources/$(*); cargo publish
sleep 10 # Wait for crates.io to update

--validate-version:
echo "$(version)" | rg -q "\d+\.\d+\.\d+" || { echo "version argument must be in the form x.y.z"; exit 1; }
echo "$(current)" | rg -q "\d+\.\d+\.\d+" || { echo "current argument must be in the form x.y.z"; exit 1; }
8 changes: 4 additions & 4 deletions cargo-shuttle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-shuttle"
version = "0.7.1"
version = "0.7.2"
edition = "2021"
license = "Apache-2.0"
description = "A cargo command for the shuttle platform (https://www.shuttle.rs/)"
Expand Down Expand Up @@ -43,15 +43,15 @@ uuid = { version = "1.1.2", features = ["v4"] }
webbrowser = "0.7.1"

[dependencies.shuttle-common]
version = "0.7.1"
version = "0.7.2"
path = "../common"

[dependencies.shuttle-secrets]
version = "0.7.1"
version = "0.7.2"
path = "../resources/secrets"

[dependencies.shuttle-service]
version = "0.7.1"
version = "0.7.2"
path = "../service"
features = ["loader"]

Expand Down
2 changes: 1 addition & 1 deletion cargo-shuttle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $ cargo shuttle init --rocket my-rocket-app

This should generate the following dependency in `Cargo.toml`:
```toml
shuttle-service = { version = "0.7.1", features = ["web-rocket"] }
shuttle-service = { version = "0.7.2", features = ["web-rocket"] }
```

The following boilerplate code should be generated into `src/lib.rs`:
Expand Down
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shuttle-codegen"
version = "0.7.1"
version = "0.7.2"
edition = "2021"
license = "Apache-2.0"
description = "Proc-macro code generator for the shuttle.rs service"
Expand Down
Loading