<commit_before># Getting started with Push2Cloud

## Intro
All components of Push2Cloud are hosted on Github (Source) and can also be installed via NPM. To get you started quickly, there is an example deployer in this repository. A deployer in this context is just a package.json file that lets you install all dependencies in a simple fashion.

## Step 1: Clone the repository
As mentioned above, first we get the deployer using git.
```bash
# get push2cloud
git clone https://github.com/push2cloud/push2cloud.git
```

## Step 2: Install dependencies
Next, we install all required components for the example deployment via NPM.
```bash
cd push2cloud/example/deployer
npm install
```

## Step 3: Configure your deployment target
Next, we you need to adopt the deployment manifest for your CloudFoundry target. Make sure to use an empty space so your existing applications are not impacted. Open the file in an editor of your choice.
``` 
vi ../manifests/deployment.json
```
Adopt the following values:

```js
{
  ...
  "target": {
    "api": "https://api.lyra-836.appcloud.swisscom.com",
    "space": "${SPACE}",
    "org": "${ORG}",
    ...
  },
  "domains": {
    "public": "${PUBLIC_DOMAIN}",
    "internal": "${INTERNAL_DOMAIN}"
  },
  "serviceMapping": {
    "*-db" : {
      "type": "${REDIS_TYPE}",
      "plan": "${REDIS_PLAN}"
    }
  },

  ...
}
```
Note: this example uses a Redis database. Gather the `type` and `plan` from your CloudFoundry provider. The example will still display the website without a Redis database, but your data will not be persisted.

## Step 4: Configure your deployment credentials
The workflow we are going to use reads your CloudFoundry credentials out of the environment variables. Export your username and password exactly the same way as you would for the CloudFoundry-CLI:

```bash
export CF_USER=${YOUR_USER}
export CF_PWD=${YOUR_PASSWORD}
```
## Step 5:
Before we start the deployment, we need to run the compiler. This creates the required deployment configuration and prepares the local workspace for packaging.

```bash
node_modules/.bin/p2c compile -e ../manifests/deployment.json
```

Alternativly, you can install the p2c globally
```bash
npm install -g push2cloud-cli
p2c compile -e ../manifests/deployment.json
```

## Step 6:
Finally, we are ready to deploy the example application. Simply start the execution of a workflow:

```
p2c exec ./node_modules/push2cloud-cf-workflows/blueGreen.js
```

You should now have two applications and a service running in your space:

```bash<commit_msg>Update getting_started.md<commit_after># Getting started with Push2Cloud

## Intro
All components of Push2Cloud are hosted on Github (Source) and can also be installed via NPM. To get you started quickly, there is an example deployer in this repository. A deployer in this context is just a package.json file that lets you install all dependencies in a simple fashion.

## Step 1: Clone the repository
As mentioned above, first we get the deployer using git.
```bash
# get push2cloud
git clone https://github.com/push2cloud/push2cloud.git
```

## Step 2: Install dependencies
Next, we install all required components for the example deployment via NPM.
```bash
cd push2cloud/example/deployer
npm install
```

## Step 3: Configure your deployment target
Next, we you need to adopt the deployment manifest for your CloudFoundry target. Make sure to use an empty space so your existing applications are not impacted. Open the file in an editor of your choice.
``` 
vi ../manifests/deployment.json
```
Adopt the following values:

```js
{
  ...
  "target": {
    "api": "https://api.lyra-836.appcloud.swisscom.com",
    "space": "${SPACE}",
    "org": "${ORG}",
    ...
  },
  "domains": {
    "public": "${PUBLIC_DOMAIN}",
    "internal": "${INTERNAL_DOMAIN}"
  },
  "serviceMapping": {
    "*-db" : {
      "type": "${REDIS_TYPE}",
      "plan": "${REDIS_PLAN}"
    }
  },

  ...
}
```
Note: this example uses a Redis database. Gather the `type` and `plan` from your CloudFoundry provider. The example will still display the website without a Redis database, but your data will not be persisted.

## Step 4: Configure your deployment credentials
The workflow we are going to use reads your CloudFoundry credentials out of the environment variables. Export your username and password exactly the same way as you would for the CloudFoundry-CLI:

```bash
export CF_USER=${YOUR_USER}
export CF_PWD=${YOUR_PASSWORD}
```
## Step 5:
Before we start the deployment, we need to run the compiler. This creates the required deployment configuration and prepares the local workspace for packaging.

```bash
node_modules/.bin/p2c compile -e ../manifests/deployment.json -c
```

Alternativly, you can install the p2c globally
```bash
npm install -g push2cloud-cli
p2c compile -e ../manifests/deployment.json
```

## Step 6:
Finally, we are ready to deploy the example application. Simply start the execution of a workflow:

```
p2c exec ./node_modules/push2cloud-cf-workflows/blueGreen.js
```

You should now have two applications and a service running in your space:

```bash
{'fraction_non_alphanumeric': 0.10225269343780607, 'fraction_numerical': 0.008227228207639568, 'mean_word_length': 4.090727816550349, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6580229', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1433, 'n_words': 645}