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

Upsun Quick start guide #3554

Merged
merged 79 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
46029aa
Quick start guide - first draft
flovntp Oct 31, 2023
b835c71
Paul's feedback on slack
flovntp Nov 3, 2023
9acecba
solving first feedback from Paul and adding navigation at the bottom …
flovntp Nov 3, 2023
c804366
adding warning when doing changes (create branch)
flovntp Nov 6, 2023
277a36b
solve gramar issue
flovntp Nov 6, 2023
65aa543
changing for default main branch (adding comments mentionning master …
flovntp Nov 6, 2023
9674eb8
uncomment Gitlab and Bitbucket links as it is still valid
flovntp Nov 8, 2023
cfcdc7b
Merge branch 'main' into fix-generic-gstarted
flovntp Jan 19, 2024
87b2040
local.
chadwcarlson Jan 23, 2024
d7865f1
WIP: singular getting started.
chadwcarlson Jan 29, 2024
0296592
small improvement
flovntp Feb 2, 2024
2c99d2f
adding Symfony guide in the get-started/stacks
flovntp Feb 5, 2024
b3ea446
merge with main
flovntp Feb 5, 2024
b6e8856
configure Node, PHP and Python draft
flovntp Feb 5, 2024
4454d38
review from Chad
flovntp Feb 5, 2024
f8297b4
General GS guide cleanup.
chadwcarlson Feb 6, 2024
0d6e279
Merge main into fix-generic-gstarted.
chadwcarlson Feb 6, 2024
5c71736
Fix shortcode build.
chadwcarlson Feb 6, 2024
1e8e11b
resolve file transfer.
chadwcarlson Feb 6, 2024
6f9aa55
Moar fixes.:
chadwcarlson Feb 6, 2024
21a08a4
merge conflicts with main
flovntp Feb 7, 2024
2a9e040
adding SFTP to accept.txt + missing vendorization
flovntp Feb 7, 2024
bf8bf4f
Merge branch 'main' into fix-generic-gstarted
chadwcarlson Feb 7, 2024
7cdbac1
Resolve some feedback.
chadwcarlson Feb 12, 2024
2cb1fca
remove local hugo file
flovntp Feb 13, 2024
983bc88
Apply suggestions from code review
flovntp Feb 13, 2024
83f968f
Apply suggestions from code review
flovntp Feb 13, 2024
cb2ac6c
Apply suggestions from code review
flovntp Feb 13, 2024
7abef2b
Apply suggestions from code review
flovntp Feb 13, 2024
11f1ab4
changing create project screenshot + lissing end of note
flovntp Feb 13, 2024
7321562
create project: adding menu with anchor
flovntp Feb 13, 2024
40d9db8
moving warning block outside of the codetab
flovntp Feb 13, 2024
dfac4a0
make-changes: adding title + note block on deploy section
flovntp Feb 13, 2024
a0d297b
adding a step for keeping the branch up-to-date
flovntp Feb 13, 2024
1cb3830
removing CLI focus mention in the requirements
flovntp Feb 13, 2024
077dcd8
merge main
flovntp Feb 13, 2024
aaa93cb
adding src/friday/_index.md in the ignore list
flovntp Feb 14, 2024
d45b28d
Merge branch 'main' into fix-generic-gstarted
flovntp Feb 14, 2024
10776ad
Merge branch 'main' into fix-generic-gstarted
flovntp Feb 14, 2024
a2131fb
remove duplicate config.yaml-baseUrl and using RelPermalink for navig…
flovntp Feb 14, 2024
acd0971
Update sites/friday/src/get-started/stacks/django.md
flovntp Feb 15, 2024
3b21e97
merge main
flovntp Feb 15, 2024
72386b3
set-resources: display issue
flovntp Feb 16, 2024
c4528b1
Friday - config.yaml: adding _index.md in the exclude list
flovntp Feb 16, 2024
b3d00b6
Gugus' reviews + adding Frameworks in the language doc page
flovntp Feb 16, 2024
f6fab62
Fix CLI shortcode.
chadwcarlson Feb 16, 2024
0f45aa6
Configure/index intro.
chadwcarlson Feb 16, 2024
36b81d2
env var note.
chadwcarlson Feb 16, 2024
8c941cd
Fix activate environment links
chadwcarlson Feb 16, 2024
291c98b
sync link.
chadwcarlson Feb 16, 2024
b814cf6
Small tweaks + image fix.
chadwcarlson Feb 16, 2024
3bca907
Default resources.
chadwcarlson Feb 16, 2024
4fcb163
resources and make-changes suggestions.
chadwcarlson Feb 16, 2024
c73e427
Move third-party out.
chadwcarlson Feb 16, 2024
0e447e9
Small tweaks
AnouckColson Feb 20, 2024
68da24e
Merge branch 'main' into fix-generic-gstarted
flovntp Feb 20, 2024
bc7367b
Delete sites/friday/http:/127.0.0.1:5001
gilzow Feb 20, 2024
e917eac
updates sentence structure
gilzow Feb 20, 2024
7c0ed14
adds link to fuller explanation of file
gilzow Feb 20, 2024
58ef2b6
Merge pull request #3792 from platformsh/gilzow-patch-2
flovntp Feb 21, 2024
cad8427
Merge branch 'main' into fix-generic-gstarted
flovntp Feb 21, 2024
d16b0ca
move end of note
flovntp Feb 21, 2024
7c7f063
remove sentence that belong to the console path
flovntp Feb 21, 2024
db975cd
adding codetab for push during change, depending on the Git path
flovntp Feb 21, 2024
4dae74a
adding codetab for push during create project, depending on the Git path
flovntp Feb 21, 2024
b883c1f
adding codetab for push during create project, depending on the Git path
flovntp Feb 21, 2024
5c291fe
adding cursor: pointer on summary
flovntp Feb 21, 2024
e150df3
split merge depending on the GIT path
flovntp Feb 21, 2024
dd5427b
if Third party inte, git push origin
flovntp Feb 21, 2024
e548025
remove upsun repo destination as it is origin
flovntp Feb 21, 2024
598f5b1
proper way to add customer css
flovntp Feb 21, 2024
fafb7cf
remove useless sentence
flovntp Feb 21, 2024
cb5cddb
move the errro on first push to configuration page
flovntp Feb 21, 2024
c521164
changing sentence for charging all activated env
flovntp Feb 21, 2024
815f790
warning on charging activ. env in the third party prov. tab
flovntp Feb 21, 2024
1354107
same sentence added for both console and cli regarding local source c…
flovntp Feb 21, 2024
f26a8f5
removing third party provider mention
flovntp Feb 22, 2024
1a745a2
missing removal of codetabs
flovntp Feb 22, 2024
2213727
Update sites/friday/src/get-started/stacks/_index.md
chadwcarlson Feb 22, 2024
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
2 changes: 1 addition & 1 deletion sites/friday/src/get-started/express/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Express
title: (REMOVE) Express
description: Welcome to our quick-start guide on hosting [Express](https://expressjs.com/) on {{< vendor/name >}} where we will demonstrate just how simple it is to host your [Express](https://expressjs.com/) projects on our PaaS. Follow the steps detailed below and you’ll have everything set up in no time.
---

Expand Down
2 changes: 1 addition & 1 deletion sites/friday/src/get-started/nextjs/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Next.js
title: (REMOVE) Next.js
description: Welcome to our quick-start guide on hosting [Next.js](https://nextjs.org/) on {{< vendor/name >}}, where we will demonstrate just how simple it is to host your [Next.js](https://nextjs.org/) projects on our PaaS. Follow the steps detailed below and you’ll have everything set up in no time.
---

Expand Down
2 changes: 1 addition & 1 deletion sites/friday/src/get-started/nextjs/local.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Local development"
title: "(REMOVE) Local development"
weight: -120
description: |
Once Your Next.js application has been deployed on {{% vendor/name %}}, you might want to start developing your application locally.
Expand Down
89 changes: 89 additions & 0 deletions sites/friday/src/get-started/quick-start/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Quick Start
weight: -100
description: Welcome to our quick-start guide on hosting any stacks on {{< vendor/name >}} where we will demonstrate just how simple it is to host your projects on our PaaS. Follow the steps detailed below and you’ll have everything set up in no time.
---

{{% description %}}

If you're trying to host a Django, a Laravel, nor a Flask stack, please follow corresponding guide:
flovntp marked this conversation as resolved.
Show resolved Hide resolved

- [Django Getting started guide](../django/_index.md)
- [Laravel Getting started guide](../laravel/_index.md)
- [Flask Getting started guide](../flask/_index.md)

{{% guides/link-philosophy %}}

{{< note title=”Tip” >}}
To get your project up and running as quickly as possible, experiment with the [{{% vendor/name %}} demo app](https://console.upsun.com/projects/create-project/demo) before following this guide.
{{< /note >}}

{{% guides/requirements name="Stacks" %}}

## Create your local app

First things first, if you don’t have a local project, you need one. So please create your project locally by following the official guide of your choice.

Example:
- [Express installation guide](https://expressjs.com/en/starter/installing.html)
- [Next.js installation guide](https://nextjs.org/docs/getting-started/installation)
- [Strapi installation guide](https://docs.strapi.io/dev-docs/installation)


## Initialize your Git repository

We need to initialize the local Git repository and commit local files, using the following command:

```bash {location="Terminal"}
git init
git add .
git commit -m "Init my application"
```

{{< note title="Tips" >}}

Depending on your stack, you should also ignore adding ``node_modules`` folder (or any other unwanted folders in your Git repository) to the Git repository by using the following commands to do so:

```bash {location="Terminal"}
echo "/node_modules" >> .gitignore
git add .gitignore && git commit -m "adding node_modules folder in .gitignore file"
```
{{< /note >}}

## Choose your Git workflow

{{% vendor/name %}} projects can be used as a classic Git repository where you will be able to push your source code in different ways, using either the Git CLI or the {{% vendor/name %}} CLI. You can choose which way—or Git workflow— you would like to use for your project from the following options:

- Your project source code will be **hosted on a {{% vendor/name %}} Git repository**
- Your project source code will be **hosted on your own GitHub repository**

{{< codetabs >}}
+++
title={{% vendor/name %}} Git repository
+++
For the rest of this guide, you will use the normal Git workflow (`git add . && git commit -m "message" && git push {{% vendor/cli %}}`) to commit your source code changes to Git history, and use the {{% vendor/name %}} CLI to deploy your [{{% vendor/name %}} environment](/environments.html) with the latest code updates.

<--->
+++
title=GitHub repository
+++
{{% vendor/name %}} provides a feature called [Github integration](integrations/source/github.md) that allows your {{% vendor/name %}} project to be fully integrated with your Github repository.
This enables you, as a developer, to use a normal Git workflow (`git add . && git commit -m "message" && git push`) to deploy your environment—with no need to connect to the {{% vendor/name %}} Console.

{{< note >}}
Please make sure you that you have already completed the following steps before adding a [Github integration](integrations/source/github.md):

1. Create a Git repository in your own organization following the relevant [Github repository creation guide](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository).
2. Create a [Github integration](integrations/source/github.md).
3. Add a Git remote to your local project, from the root of your project, by inputting the following:

```bash {location="Terminal"}
git remote add origin <urlOfYourOwnGitHubRepo>
git add . && git commit -m "init my app"
git push origin
```
{{< /note >}}

{{< /codetabs >}}

## Next steps
135 changes: 135 additions & 0 deletions sites/friday/src/get-started/quick-start/configure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
title: Configure your project
weight: 20
description: Configure your project
---

## Configure your project

To be able to host your application on {{% vendor/name %}}, some YAML configuration files are needed at the root of your project to manage the way your application will behave.
These YAML configuration files are located into a `.{{% vendor/cli %}}/` folder at the root of your source code, the architecture of which will look like this:
```
my-app
├── .{{% vendor/cli %}}
│ └── config.yaml
├── [.environment]
└── <project sources>
```

{{< note >}}
{{% get-started/environment-note %}}
{{< /note >}}

To pre-generate these YAML files, please use the following command from the root of your project and follow the prompts:
```bash {location="Terminal"}
{{% vendor/cli %}} project:init
```

The `{{% vendor/cli %}} project:init` command (shortcut `{{% vendor/cli %}} ify`) will automatically detect which stack that you’re using, ask if you want to add any services, and generate the corresponding `config.yaml` YAML files, like so:
```yaml {location=".{{% vendor/cli %}}/config.yaml"}
{{< code-link destination="/create-apps/app-reference.html" text="applications" title="Complete list of all available properties" >}}:
app:
{{< code-link destination="/create-apps/app-reference.html#source" text="source" title="Application source code directory. Click for more information" >}}:
root: "/"
{{< code-link destination="/create-apps/app-reference.html#types" text="type" title="The runtime the application uses. Click to see the complete list of available runtimes." >}}: "<runtime>:<version>"
{{< code-link destination="/create-apps/app-reference.html#types" text="web" title="The web key configures the web server running in front of your app. Click for more information." >}}:
{{< code-link destination="/create-apps/app-reference.html#web-commands" text="commands" title="Commands are run once after deployment to start the application process. Click for more information." >}}:
{{< code-link destination="/languages/nodejs.html#4-start-your-app" text="start" title="The command to launch your app. If it terminates, it’s restarted immediately. You can use the $PORT or the $SOCKET environment variable depending on the socket family of your upstream. Click for more information." >}}: "// (optional) command to start Node server"
{{< code-link destination="/create-apps/app-reference.html#build" text="build" title="Specifies a default set of build tasks to run. Flavors are language-specific. Click for more information" >}}:
flavor: none
{{< code-link destination="/create-apps/app-reference.html#web-commands" text="dependencies" title="Installs global dependencies as part of the build process. They’re independent of your app’s dependencies and are available in the PATH during the build process and in the runtime environment. They’re installed before the build hook runs using a package manager for the language. Click for more information." >}}:
# nodejs:
# sharp: "*"
#{{< code-link destination="/add-services.html#available-services" text="services" title="Click to get Full list of available services." >}}:
# db:
# type: postgresql:14
{{< code-link destination="/define-routes.html" text="routes" title="Each route describes how an incoming URL is going to be processed. Click for more information" >}}:
"https://{default}/":
type: upstream
upstream: "app:http"
# A basic redirect definition
# More information: {{% vendor/url_doc %}}/define-routes.html#basic-redirect-definition
"https://www.{default}/":
type: redirect
to: "https://{default}/"
```

[//]: # ({{< note >}})
[//]: # (In the current guide, services are added to your project at a [later stage]&#40;/get-started/express/add-database.md&#41;.)
[//]: # ({{< /note >}})

Then commit your new files, using the following command:

```bash {location="Terminal"}
git add [.environment] .{{% vendor/cli %}}/config.yaml
git commit -m "{{% vendor/name %}} config files"
```

[//]: # (TODO not sure that .environment would be generated each time we use project:init)
{{< note >}}
Depending on your choice during the ``{{% vendor/cli %}} project:init`` command to add or not a service, ``.environment`` file could be missing from your source code, so please remove it from the previous `git add` command if that's the case.
{{< /note >}}

## Set your project remote

{{< note >}}
If you used the {{% vendor/name %}} CLI command `{{% vendor/cli %}} project:create` to create your project and your local Git repository has already been initialized, your local source code should already contain a ``.{{% vendor/cli %}}/local/project.yaml`` file. This file contains your `projectId`, and you already have a Git remote repository set to `{{% vendor/cli %}}`.
You can jump to [deploying your project](#deploy).
{{< /note >}}

There are slightly different ways to link your local project to your {{% vendor/name %}} project based on the Git workflow you chose for your project, as discussed earlier in this guide.

{{< codetabs >}}
+++
title={{% vendor/name %}} Git repository
+++
If you host your source code on an {{% vendor/name %}} Git repository, and you failed to answer `y` (yes) to the question `Set the new project <projectName> as the remote for this repository? [Y/n]` during the ``project:create`` command, you need to let the {{% vendor/name %}} CLI know which linked project you want to deploy to.

To do so, use the {{% vendor/name %}} CLI to set a remote project:
```bash {location="Terminal"}
{{% vendor/cli %}} project:set-remote <projectId>
```

This command will add a new remote called `{{% vendor/cli %}}` to your local Git repo as you can see below:
```bash {location="Terminal"}
git remote
{{% vendor/cli %}}
...
```

It will also create a new `.{{% vendor/cli %}}/local/project.yaml` file that will contain the given `<projectId>`, to store this information for the {{% vendor/name %}} CLI interaction.

{{< note >}}
If you don’t remember your `<projectId>` from the previous steps, you can get it back using this command line and select the one you created:
```bash {location="Terminal"}
{{% vendor/cli %}} project:list
```
{{< /note >}}

<--->
+++
title=GitHub repository
+++
{{% guides/whitelabel/git_integration git="GitHub" stack="" %}}
<--->

[//]: # (TODO uncomment this tab when Gitlab or Bitbucket integration would be available)
[//]: # (+++)

[//]: # (title=Gitlab repository)

[//]: # (+++)

[//]: # ({{% guides/whitelabel/git_integration git="Gitlab" stack="Express" %}})

[//]: # (<--->)

[//]: # (+++)

[//]: # (title=Bitbucket repository)

[//]: # (+++)

[//]: # ({{% guides/whitelabel/git_integration git="Bitbucket" stack="Express" %}})

{{< /codetabs >}}
68 changes: 68 additions & 0 deletions sites/friday/src/get-started/quick-start/create-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Create a new project
weight: 10
description: Configure your project
---

To create a new project on {{% vendor/name %}}, you can either use the {{% vendor/name %}} CLI or the {{% vendor/name %}} Console.

{{< codetabs >}}
+++
title=Using the CLI
+++
To create a new project with the {{% vendor/name %}} CLI, use the following command and follow the prompt:
```bash {location="Terminal"}
{{% vendor/cli %}} project:create
```

{{< note >}}
When creating a new project using the {{% vendor/name %}} CLI command `project:create`, you will be asked if you want to set the local remote to your new project. Enter **Yes (y)**.

Your local source code will be automatically linked to your newly created {{% vendor/name %}} project by creating a `.{{% vendor/cli %}}/local/project.yaml` file that will contain the corresponding `<projectId>` and set a Git remote to `{{% vendor/cli %}}`.

```bash {location="Terminal"}
git remote
{{% vendor/cli %}}
```

If not, please refer to [Set project remote](#set-project-remote) section.
{{< /note >}}

<--->
+++
title=Using the Console
+++

[Create a new project from scratch]({{% create-project-link scratch=true %}}).

If you do not already have an organization created to put the project in, you'll first be instructed to create one.

Once you have done so, select that organization from the dropdown, and select **Create from scratch**.

In the form, fill in details like the project name and [region](/development/regions.md).
You'll be able to define resources for the project after your first push.

After creating a project with the Console, you need to let the {{% vendor/name %}} CLI know which linked project you want to deploy to.

To do so, use the {{% vendor/name %}} CLI to set a remote project:
```bash {location="Terminal"}
{{% vendor/cli %}} project:set-remote <projectId>
```

This command will add a new remote called `{{% vendor/cli %}}` to your local Git repo as you can see below:
```bash {location="Terminal"}
git remote
origin
{{% vendor/cli %}}
```

It will also create a new `.{{% vendor/cli %}}/local/project.yaml` file that will contain the given `<projectId>`, to store this information for the {{% vendor/name %}} CLI interaction.

{{< note >}}
If you don’t remember your `<projectId>` from the previous steps, you can get it back using this command line and select the one you created:
```bash {location="Terminal"}
{{% vendor/cli %}} project:list
```
{{< /note >}}

{{< /codetabs >}}
flovntp marked this conversation as resolved.
Show resolved Hide resolved
50 changes: 50 additions & 0 deletions sites/friday/src/get-started/quick-start/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Deploy
weight: 30
description: Welcome to our quick-start guide on hosting any stacks on {{< vendor/name >}} where we will demonstrate just how simple it is to host your projects on our PaaS. Follow the steps detailed below and you’ll have everything set up in no time.
---

## Deploy

And just like that, it’s time to deploy!

Depending on the Git workflow you choose at the beginning of this tutorial, there are two ways to deploy your source code changes.

{{< codetabs >}}

+++
title=Using {{% vendor/name %}} Git repository
+++

When using the {{% vendor/name %}} Git repository as your main repository, you can push your code using the normal Git workflow (`git add . && git commit -m "message" && git push {{% vendor/cli %}}`). This pushes your source code changes to your `{{% vendor/cli %}}` remote repository. Alternatively, you can use the following {{% vendor/name %}} CLI command:
```bash {location="Terminal"}
{{% vendor/cli %}} push
```

<--->
+++
title=Using third-party Git repository
+++

When using an external Git repository (GitHub, GitLab, or Bitbucket) to store your source code and having the Git integration feature enabled, on each code updates, you will need to use the normal Git workflow (`git add . && git commit -m "message" && git push`) to push your code to your external repository. To do so, run the following command:
```bash {location="Terminal"}
git push origin
```

Your GitHub/GitLab/Bibucket integration process will then automatically create a new environment if you’re pushing a new Git branch, and deploy changes to your corresponding environment.
{{< /codetabs >}}

{{% vendor/name %}} will now read your configuration files, and begin building your application image.

{{< note >}}
By default, {{% vendor/name %}} will use the default resource allocation for each of your services/apps. To change allocated resources to each of your services/apps, please see [how to set resources to your project](./set-resources.md) section
{{< /note >}}

Et voilà, your application is live!


[//]: # (**Your first push)

[//]: # (will fail**; don't worry, this is expected. At this point {{% vendor/cli %}} is not aware of the resources)

[//]: # (your application needs. You need to define how much CPU, memory, and disk to assign to the various containers. Back in your terminal, run:)
19 changes: 19 additions & 0 deletions sites/friday/src/get-started/quick-start/local/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Local development
weight: 70
description: |
Sync {{% vendor/name %}} with your local environments to start contributing.
---

A significant amount of work developing your app takes place locally rather than on an active {{% vendor/name %}} environment.
You want to ensure that the process of local development is as close as possible to a deployed environment.

You can achieve this through various approaches.
Each of these examples:

- Creates a local development environment for your site.
- Syncs data from the active {{% vendor/name %}} environment where team review takes place.
- Commits aspects of that local development method to the project so collaborators can replicate configuration to contribute.

[//]: # (If you're already using Docker Compose,)
[//]: # (consult the Community guide on [using Docker Compose with Django and {{% vendor/name %}}]&#40;https://community.platform.sh/t/using-docker-compose-with-django/1205&#41;.)
Loading
Loading