Skip to content

Commit

Permalink
Merge pull request #14 from amezmo/ryan/typos
Browse files Browse the repository at this point in the history
fix many typos
  • Loading branch information
AmezmoOfficial authored Nov 23, 2024
2 parents 85a1203 + 9fe5fe1 commit 868384d
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 95 deletions.
13 changes: 7 additions & 6 deletions api/deployments/cancel-deployment.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Cancel Deployment

```bash
```http
POST /v1/instances/{instance_id}/deployments/{deployment_id}/cancel
```

## Parameters
Parameter | Type | In | Description
------------- | ------|------ |------------------
instance_id | string | uri | The instance id of the environment

Parameter | Type | In | Description
------------- | -------|------ |------------------
instance_id | string | uri | The instance id of the environment
deployment_id | string | uri | The deployment ID

## Response

`200 OK`

```bash
```json
{
"id": 838,
"status": "cancelling"
}
```
```
13 changes: 7 additions & 6 deletions api/deployments/get.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Get a deployment

```bash
```http
GET /v1/instances/{instance_id}/deployments/{deployment_id}
```

## Parameters
Parameter | Type | In | Description
------------- | ------|------ |------------------
instance_id | string | uri | The instance id of the environment

Parameter | Type | In | Description
------------- | -------|------ |------------------
instance_id | string | uri | The instance id of the environment
deployment_id | string | uri | The deployment ID

## Response

`200 OK`

```bash
```json
{
"id": 838,
"status": "cancelled"
}
```
```
30 changes: 18 additions & 12 deletions api/deployments/post.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Create a deployment

You may invoke a deployment on your instance with an optional archive file. This archive file allows you to
upload a complete version of your application without having to use Git. A common use case for deploying with an archive file is when you're using a pipeline provider such as GitHub actions.
You may invoke a deployment on your instance with an optional archive file.
This archive file allows you to upload a complete version of your
application without having to use Git.

See the [Amezmo GitHub Actions](https://github.com/amezmo/github-actions-demo) repository for a complete working example of using GitHub actions to deploy an application.
A common use case for deploying with an archive file is when
you're using a pipeline provider such as GitHub actions.

See the [Amezmo GitHub Actions](https://github.com/amezmo/github-actions-demo) demo
repository for a guide to Deploying PHP applications
with [GitHub actions](https://www.amezmo.com/laravel-hosting-guides/deploying-laravel-with-github-actions).

Deployments with an [archive file](/docs/how-to-guides/creating-zip-files-for-api-deployments) work exactly
like regular Git deployments.

When deploying with the Amezmo API, The `after.pull`
When deploying with the Amezmo API, The `after.pull`
[deployment hook](/docs/deployments/hooks) will not be run.
Instead, use the [after.extract](/docs/deployments/hooks/after-extract) hook to run code after extracting your archive.
Instead, use the [after.extract](/docs/deployments/hooks/after-extract)
hook to run code after extracting your archive.

```bash
```http
POST /v1/instances/{instance_id}/deployments
```

## Parameters

Parameter | Type | In | Description
------------- | -------------
Parameter | Type | In | Description
------------- | ------|------ |------------------
api_key | string | header | **Required**. Your [API key](/docs/api/authentication).
environment | string | body | **Required**. The [environment](/docs/api/environments) name for this deployment. This can be `production` or `staging`.
instance_id | string | uri | **Required**. The ID of the instance that this deployment will be executed on.
Expand All @@ -31,10 +38,9 @@ pusher | string | body | The email address of the user that invoked the
commit | string | body | The git commit hash
tag | string | body | The git tag


## Code samples

```bash
```curl
curl --request POST \
--url https://api.amezmo.com/v1/instances/{instance_id}/deployments \
--header 'Authorization: Bearer {api_key}' \
Expand All @@ -52,13 +58,13 @@ curl --request POST \

`201` Created

```bash
```json
{
"id": 838,
"status": "pending"
}
```

## Resources
- [How to create a ZIP archive for API deployments](/docs/how-to-guides/creating-zip-files-for-api-deployments)

- [How to create a ZIP archive for API deployments](/docs/how-to-guides/creating-zip-files-for-api-deployments)
21 changes: 13 additions & 8 deletions configuration/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

The `/webroot/storage` directory is available for your **production** persistent storage needs. By default,
this directory is created for you when you launch an instance. You should configure your application to
write files to this directory if you need to persist user uploaded content, or other files across deployments. For staging environements, the persistent storage directory follows the same pattern but it's located under `/webroot/$stagingRootDirectory/storage`. To find the value of `$stagingRootDirectory`, search for "Storage directory" under the Git tab.
write files to this directory if you need to persist user uploaded content, or other files across deployments.

For your staging environments, the persistent storage directory follows the same pattern
and it's located under `/webroot/$stagingRootDirectory/storage`.
To find the value of `$stagingRootDirectory`, search for "Storage directory"
under your Git tab in the Amezmo Dashboard

To automatically link a deployment your persistent storage directory, see
[Setting up the storage directory](/docs/how-to-guides/setting-up-the-storage-directory).

## Directory layout

```bash
/webroot
|----logs
Expand All @@ -28,21 +34,20 @@ any files created from your hooks will have correct and expected permissions. Am

The `/webroot/storage/public` is created for [public file uploads](/docs/configuration/public-directory). Files uploaded to
this directory can be accessible from your domain by creating a symbolic link
from `/webroot/storage/public` to `/webroot/current/public`. See the [public directory documentation](/docs/configuration/public-directory) for more details.
from `/webroot/storage/public` to `/webroot/current/public`.
See the [public directory documentation](/docs/configuration/public-directory) for more details.

When uploading files from your PHP app, the default owner and group is `www-data`. At this time,
Amezmo has chosen not to modify the default PHP FPM configuration in an effort to run
the FPM daemon as a non-shell capable access user. We recommend the following file system permissions when
writing and uploading new files to your instance.


## Recommend file permissions settings

The following permission configuration is Amezmo's recommendation for PHP applications hosted on Amezmo. Note that
the example shows a Laravel based configuration array, but these permissions are not specific to Laravel. Any PHP
application hosted on Amezmo should use these permissions and settings.


This file is located at `app/config/filesystems.php`. The

```php
Expand Down Expand Up @@ -85,13 +90,13 @@ return [
];
```

The above permissions provide expected behavior across all application areas. With the above file permissions,
your depoyment hooks may read and write existing and new files and your workers may read and write existing
and new files.
The above permissions provide expected behavior across all application areas.
With the above file permissions, your deployment hooks may read and write existing and
new files and your workers may read and write existing and new files.

## Resources

- [How to Persist Storage Across PHP Deployments on Amezmo Part 1](https://www.youtube.com/watch?v=A-iBIfch6Bw) <span class="badge bg-info">Video</span>
- [How to Change the Default Storage Path in Laravel](https://www.amezmo.com/blog/how-to-change-the-default-storage-path-in-laravel/)
- [Laravel deployment hook for persistent storage](https://github.com/amezmo/demo.amezmo.com/blob/master/.amezmo/before.deploy)
- [Craft CMS deployment hook for persistent storage](https://github.com/amezmo/craftcms-demo/blob/master/.amezmo/before.deploy)

10 changes: 3 additions & 7 deletions databases/ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ then MySQL will available directly, and with any instance on the shared network.
Amezmo dashboard, you can backup, restore, and check the status of your database.

After ensuring that
[SSH is enabled](/docs/instances/ssh#enable-ssh) on your instance,
[SSH is enabled](/docs/instances/enable-or-disable-ssh) on your instance,
then go to Overview > Server Details and find your **SSH port**. An example SSH command is provided for you below:


```bash
ssh -i <id_rsa> -p <your ssh port> \
-L 127.0.0.1:3306:127.0.0.1:3306 \
Expand All @@ -18,14 +17,11 @@ ssh -i <id_rsa> -p <your ssh port> \
**Important**: When you connect to your instance with the SSH command, you'll be able to access
your database over a secure SSH tunnel.


In this example command, the local IP address is `127.0.0.1`, and the local port
is `3306`.
If you're already running a MySQL server on your local machine, be sure to change the port in the command to something else, such as 3307.
is `3306`. If you're already running a MySQL server on your local machine,
be sure to change the port in the command to something else, such as 3307.

## Requirements

Before you can access your MySQL database via SSH, you must upload your public SSH key to your instance.
[Learn more](/docs/instances/ssh) about accessing your instances resources through SSH.


49 changes: 30 additions & 19 deletions deployments/hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ A set of environment variables are given to the script, for your reference.
For example, the file [after.pull](/docs/deployments/hooks/after-pull)
is executed for the event After Pull.


## Hook files

Hooks are files.
In the below sample application directory structure, the `.amezmo` directory is where you define your "hook" scripts.


```bash
# A sample laravel application root directory.
# The `tree -a -L 2 .` command was run inside a Laravel app's root directory.
Expand Down Expand Up @@ -44,11 +43,20 @@ As part of the deployment process, Amezmo will run a chmod across your target de
any files created from your hooks will have correct and expected permissions. Amezmo ensures the owner/group is
`www-data:deployer`. This allows for expected permissions across all areas of your application.

For directories, these are the permissions.

```sh
2775/drwxrwxr-x
```

For directories, the permissions are `2775/drwxrwxr-x`, for files the permissions are `0664/-rw-rw--r--`.
For files, these are the permissions.

```sh
0664/-rw-rw--r--
```

## Hook list

- [before.pull](/docs/deployments/hooks/before-pull)
- [after.pull](/docs/deployments/hooks/after-pull)
- [after.extract](/docs/deployments/hooks/after-extract)
Expand All @@ -57,41 +65,44 @@ For directories, the permissions are `2775/drwxrwxr-x`, for files the permission
- [deploy.success](/docs/deployments/hooks/deploy-success)
- [deploy.failure](/docs/deployments/hooks/deploy-failure)

## .env
The [most recent .env file](/docs/configuration/dotenv), which is the one that you see in the dashboard within the Configuration tab,
is placed into the newly created [deployment directory](/docs/deployments/directories) immediately completion of git pull.
This allows your hooks to use the contents of the `.env` if you desire.
However, the `.env` file loading does not happen automatically.
## Environment File

Your [most recent .env file](/docs/configuration/dotenv), which is the one that you see in your
Amezmo Dashboard under the Configuration tab, is placed into the
newly created [deployment directory](/docs/deployments/directories)
immediately completion of git pull.

This allows your hooks to use the contents of
the `.env` if you desire. However, the `.env` file loading does not happen automatically.
To accomplish this, simply edit your hook file to load it before doing anything else.

## Secrets

[Encrypted environment variables](/docs/secrets) are injected into the hooks environment
and exist in memory only.
You may access them inside your hook file using the bash syntax
for variables such as `$MY_SECRET_VARIABLE_NAME`.
Secrets will never be written to disk and only decrypted to execute hooks.



## Environment variables
Your hook script has access to the following pre-defined environment variables.
In addition to these enviroment variables, Amezmo injects your secret variables as well. For more
information about secrets, see the [Secrets Overview](/docs/secrets) page.

Your hook script has access to the following pre-defined environment variables.
In addition to these environment variables, Amezmo injects your secret variables as well. For more
information about secrets, see the [Secrets Overview](/docs/secrets) page.

| Variable | Description
Variable | Description
-----------|------------
APPLICATION_ROOT | This is where your code is located on the server in the form of `deployment_${sequence_number}.${short_commit_id}`
COMMIT_ID | Git commit hash of the currently executing deployment
COMMIT_ID | Git commit hash of the currently executing deployment
NODE_PATH | The path to the global node.js package binaries
COMPOSER_MEMORY_LIMIT | set to `-1`
PERSISTENT_STORAGE_DIRECTORY | Path to the [persistent storage](/docs/configuration/storage) directory
APP_DOMAIN | Internal domain name for the environmnt
PERSISTENT_STORAGE_DIRECTORY | Path to the [persistent storage](/docs/configuration/storage) directory
APP_DOMAIN | Internal domain name for the environment
REPO_NAME | The name of the repository currently being deployed
DEPLOY_BRANCH | The name of the branch currently being deployed
TARGET_HOOK | The name of hook being executed. This is one of the values listed in the [Hook list](/docs/deployments/hooks/#hook-list)
RELEASE_NUMBER | The generated release number. The value is in the form of `deployment_${sequence_number}.${short_commit_id}`
DEPLOYMENT_DIRECTORY | The fully qualified path to the current in progress deployment.
DEPLOYMENT_DIRECTORY | The fully qualified path to the current in progress deployment.
APP_TYPE | The application type ID such as `drupal`, `laravel`, or `crafctms`
ENVIRONMENT_NAME | The name of the [application environment](/docs/environments)

Expand All @@ -101,6 +112,6 @@ On the Deployments tab, you can see a list of your deployments.
To view a single deployment click on the link in the status column.
Note that, Amezmo will only show the hooks that were executed in the table below.


## Limits

- There is a 10 minute limit on hook execution
33 changes: 18 additions & 15 deletions deployments/index.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# Deployments

Amezmo implements atomic, real-time deployments based on your `git push`
activity. When your repo has new push events, Amezmo will be notified and
Amezmo implements atomic, real-time deployments based on your `git push`
activity. When your repo has new push events, Amezmo will be notified and
immediately begin a deployment process.

You can use Amezmo to ensure your PHP application is highly available. Deployments
on Amezmo combine a series of atomic steps that operate in a pipeline. Pipeline
steps have success conditions. Conditions are checked as a prerequisite for
advancing to the next step in the pipeline. In the case of a negative
on Amezmo combine a series of atomic steps that operate in a pipeline. Pipeline
steps have success conditions. Conditions are checked as a prerequisite for
advancing to the next step in the pipeline. In the case of a negative
success condition evaluation, your deployment pipeline safely terminates leaving
your active, or live site unaffected.
your active, or live site unaffected.

## Deployment pipeline success critera
You can keep your production site highly available to your users or
customers with Amezmo Atomic Deployments&mark. Amezmo deploys your
PHP application with a pipeline Atomicity. This gurantees invariability between
your live production site, and a failed deployment. There's no risk in
automating your [PHP deployments](/docs/git/).

Amezmo deploys your PHP application to production in a pipeline comprised of
indivisible units of well-defined deployment tasks.
## Deployment pipeline success criteria

You can keep your production site highly available to your users or
customers with Amezmo Atomic Deployments&trade; Amezmo deploys your
PHP application with a pipeline Atomicity. Amezmo guarantees invariability between
your live production site, and a failed deployment. There's no risk in
automating your [PHP deployments](/docs/git/).

Amezmo deploys your PHP application to production in a pipeline comprised of
indivisible units of well-defined deployment tasks.

## Configuration files

Expand All @@ -30,16 +29,20 @@ An `.env`, will be placed into your root
any existing `.env` file your archive may have.

## Deployment directories

The deployment directory section describes the layout for zero-downtime deployments
[Learn more](/docs/deployments/directories).

## Hooks

Amezmo's extensible deployment systems provides you the capability to run your own code at
any step of the deployment process. [Learn more](/docs/deployments/hooks).

## Releases

After a successful deployment, then the deployment is considered a release. You may rollback to a previous
release at anytime. [Learn more](/docs/deployments/releases).

## Fault tolerance

Your application will not be affected by a failed deployment, as Amezmo only releases your successful deployments.
Loading

0 comments on commit 868384d

Please sign in to comment.