Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into avery/keyword-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper authored Sep 13, 2019
2 parents 0e6f76f + c8c674b commit 4b10d68
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 45 deletions.
65 changes: 24 additions & 41 deletions docs/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ workers_dev = false # this field specifies that the worker should not be deploye

```console
$ wrangler publish
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to example.com/*
```

##### workers.dev
Expand All @@ -74,9 +73,8 @@ workers_dev = true # this field specifies that the worker should be deployed to

```console
$ wrangler publish
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker.<your-subdomain>.workers.dev`
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker.<your-subdomain>.workers.dev
```

#### Introducing Environments
Expand Down Expand Up @@ -106,23 +104,20 @@ With this configuration, Wrangler will behave in the following manner:

```console
$ wrangler publish
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at dev.example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to dev.example.com/*
```

```console
$ wrangler publish --env staging
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at staging.example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to staging.example.com/*
```

```console
$ wrangler publish --env production
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to example.com/*
```

#### Staging Environment with workers.dev
Expand All @@ -145,16 +140,14 @@ With this configuration, Wrangler will behave in the following manner:

```console
$ wrangler publish
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to example.com/*
```

```console
$ wrangler publish --env staging
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker-staging.<your-subdomain>.workers.dev
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker-staging.<your-subdomain>.workers.dev
```

#### workers.dev as a first class target
Expand All @@ -178,23 +171,20 @@ With this configuration, Wrangler will behave in the following manner:

```console
$ wrangler publish
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker-dev.<your-subdomain>.workers.dev
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker-dev.<your-subdomain>.workers.dev
```

```console
$ wrangler publish --env staging
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker-staging.<your-subdomain>.workers.dev
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker-staging.<your-subdomain>.workers.dev
```

```console
$ wrangler publish --env production
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker.<your-subdomain>.workers.dev
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker.<your-subdomain>.workers.dev
```

### Custom webpack configurations
Expand Down Expand Up @@ -298,13 +288,8 @@ You will be warned if `workers_dev` is left out of the top level configuration b
```console
$ wrangler publish
<<<<<<< HEAD
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ This command will fail in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
=======
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
>>>>>>> master
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker.<your-subdomain>.workers.dev
Expand Down Expand Up @@ -361,9 +346,8 @@ $ wrangler publish
⚠️ The `private` field is deprecated; please use `workers_dev` to toggle between publishing to your workers.dev subdomain and your own domain.
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker.<your-subdomain>.workers.dev
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker.<your-subdomain>.workers.dev
```
```console
Expand All @@ -372,9 +356,8 @@ $ wrangler publish --release
⚠️ The `private` field is deprecated; please use `workers_dev` to toggle between publishing to your workers.dev subdomain and your own domain.
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at example.com/*
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to example.com/*
```
This backwards compatibility is the reason that a warning is thrown if `workers_dev` is not specified at the top of `wrangler.toml`.
Expand Down
6 changes: 2 additions & 4 deletions src/commands/publish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ fn publish_script(user: &GlobalUser, target: &Target) -> Result<(), failure::Err
.multipart(script_upload_form)
.send()?;

if res.status().is_success() {
message::success("Successfully published your script.");
} else {
if !res.status().is_success() {
failure::bail!(
"Something went wrong! Status: {}, Details {}",
res.status(),
Expand All @@ -63,7 +61,7 @@ fn publish_script(user: &GlobalUser, target: &Target) -> Result<(), failure::Err

info!("{}", &pattern);
message::success(&format!(
"Success! Your worker was successfully published. You can view it at {}",
"Successfully published your script to {}",
&pattern
));

Expand Down

0 comments on commit 4b10d68

Please sign in to comment.