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

Add git function tutorial #9379

Merged
merged 27 commits into from
Sep 11, 2020
Merged

Add git function tutorial #9379

merged 27 commits into from
Sep 11, 2020

Conversation

kfurgol
Copy link
Contributor

@kfurgol kfurgol commented Sep 7, 2020

Description

Changes proposed in this pull request:

  • Added tutorial on how to create a function using Git repository

Related issue(s)

@netlify
Copy link

netlify bot commented Sep 7, 2020

🥰 Documentation preview ready! 🥰

Built with commit 0c0de98

https://deploy-preview-9379--kyma-project-docs-preview.netlify.app

@netlify
Copy link

netlify bot commented Sep 7, 2020

🥰 Documentation preview ready! 🥰

Built with commit 4daa717

https://deploy-preview-9379--kyma-project-docs-preview.netlify.app

@netlify
Copy link

netlify bot commented Sep 7, 2020

🥰 Documentation preview ready! 🥰

Built with commit 74200d6

https://deploy-preview-9379--kyma-project-docs-preview.netlify.app

Copy link
Contributor

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good! :) I prefer use the function from organisation repo, not from account one of our contributors :)

metadata:
name: $NAME
spec:
url: "https://github.com/pPrecel/public-gitops"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the https://github.com/kyma-project/examples.git repository. It's better to ref to repo in organisation, not to repo in account one of our contributors.

apiVersion: serverless.kyma-project.io/v1alpha1
kind: GitRepository
metadata:
name: $NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add also namespace namespace: $NAMESPACE

apiVersion: serverless.kyma-project.io/v1alpha1
kind: Function
metadata:
name: $NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add also namespace namespace: $NAMESPACE

EOF
```

>**NOTE** Auth possibility TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add correct indents (3 or 4 spaces)

runtime: nodejs12
source: $NAME
reference: master
baseDir: js-handler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to orders-service/function

EOF
```

>**NOTE** To see full spec, go to the xxx page
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: Tutorials
---

This tutorial shows how you can create a simple "Hello World!" Function from Git repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tutorial shows how you can create a Function from Git repository. The function from examples repo is a more complex than Hello World! :)


2. Go to the **Functions** view in the left navigation panel and select **Repositories** tab.

3. Click **Connect Repository**, fill in required fields and click **Connect**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click Connect Repository, fill the Url field with https://github.com/kyma-project/examples.git value and click Connect.


3. Click **Connect Repository**, fill in required fields and click **Connect**.

>**NOTE** Auth possibility TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE If you want connect the private repository, change the Authorization field from Public to Key or Basic and fill the required fields -> Auth possibility link TODO


4. Go to the **Functions** tab and click **Create Function**.

3. In the pop-up box, change `Source type` to `From Repository`, fill in required fields and select **Create** to confirm changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. In the pop-up box, change Source type to From Repository, select created Repository's name, fill the Reference field with master and Base directory field with orders-service/function values and select Create to confirm changes.

@netlify
Copy link

netlify bot commented Sep 7, 2020

🥰 Documentation preview ready! 🥰

Built with commit 29f675f

https://deploy-preview-9379--kyma-project-docs-preview.netlify.app

Copy link

@kazydek kazydek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments & suggestions.

docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
Console UI
</summary>

1. Create a Namespace or select one from the drop-down list in the top navigation panel.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sth went wrong with numbering:
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit better, but it still needs updating:
image

docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
```bash
NAME CONFIGURED BUILT RUNNING VERSION AGE
test-function True True True 1 18m
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changes that @aerfio added, the RUNTIME column is printed as well. See this example.
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls add the RUNTIME column.

docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved

4. Go to the **Functions** tab and click **Create Function**.

5. In the pop-up box, change `Source type` to `From Repository`, select created Repository's name, fill the `Reference` field with `master` and `Base directory` field with `orders-service/function` values and select **Create** to confirm changes.
Copy link

@kazydek kazydek Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. In the pop-up box, change `Source type` to `From Repository`, select created Repository's name, fill the `Reference` field with `master` and `Base directory` field with `orders-service/function` values and select **Create** to confirm changes.
5. In the pop-up box, change **Source Type** to `Git repository`, select the repository name, fill in the **Reference** field with `master`, and the **Base Directory** field with `orders-service/function`. Finish by selecting **Create** to confirm changes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source type or Source Type?
Base directory or Base Directory?
@magicmatatjahu, help wanted :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I asked Maciek and it will be capitalized - as in other views)

docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
docs/serverless/08-02-create-git-function.md Outdated Show resolved Hide resolved
kfurgol and others added 2 commits September 10, 2020 12:41
Co-authored-by: Karolina Zydek <karolina.zydek@sap.com>
Co-authored-by: Karolina Zydek <karolina.zydek@sap.com>
kubectl
</summary>

1. Export these variables:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sth is wrong with formatting:
image

Console UI
</summary>

1. Create a Namespace or select one from the drop-down list in the top navigation panel.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit better, but it still needs updating:
image

```bash
NAME CONFIGURED BUILT RUNNING VERSION AGE
test-function True True True 1 18m
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls add the RUNTIME column.

EOF
```

>**NOTE** To see other authorization methods, go to the [documentation]().
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok:
>**NOTE:** Read also about other [supported authentication methods](#details-git-source-type).


>**NOTE** If you are using a private repository, add `auth` object with `type` and `secretName` fields to the spec. For details, see [documentation]().

3. Create a Function CR that specifies the Function's logic:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3. Create a Function CR that specifies the Function's logic and points to the directory with code and dependencies in the given repository.

username: <USERNAME>
password: <PASSWORD>
```
>**NOTE** To see other possible authorization methods, go to the [documentation]().
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK: >**NOTE:** Read also about other [supported authentication methods](#details-git-source-type).


2. Go to the **Functions** view in the left navigation panel and select the **Repositories** tab.

3. Select **Connect Repository**, fill in the `Url` field with `https://github.com/kyma-project/examples.git`, and confirm by selecting **Connect**.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Select **Connect Repository**, fill in the `Url` field with `https://github.com/kyma-project/examples.git`, and confirm by selecting **Connect**.
3. Select **Connect Repository**, fill in the **Url** field with `https://github.com/kyma-project/examples.git`, and confirm by selecting **Connect**.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad - I didn't notice it before.


3. Select **Connect Repository**, fill in the `Url` field with `https://github.com/kyma-project/examples.git`, and confirm by selecting **Connect**.

>**NOTE:** If you want to connect the secured repository with basic authentication, change the **Authorization** field from `Public` to `Basic` and fill the required fields.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>**NOTE:** If you want to connect the secured repository with basic authentication, change the **Authorization** field from `Public` to `Basic` and fill the required fields.
>**NOTE:** If you want to connect the secured repository with basic authentication, change the **Authorization** field from `Public` to `Basic` and fill in the required fields.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, my bad.


4. Go to the **Functions** tab and click **Create Function**.

5. In the pop-up box, change `Source type` to `From Repository`, select created Repository's name, fill the `Reference` field with `master` and `Base directory` field with `orders-service/function` values and select **Create** to confirm changes.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I asked Maciek and it will be capitalized - as in other views)

kazydek
kazydek previously approved these changes Sep 11, 2020
@kfurgol kfurgol merged commit 906b174 into kyma-project:master Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Issues or PRs related to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants