Skip to content

Commit

Permalink
Edits based on feedback for triggering-jenkins and running-auto-test
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyhdo committed Jun 4, 2018
1 parent 91fd25f commit 90ef5c8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified content/.DS_Store
Binary file not shown.
36 changes: 22 additions & 14 deletions content/1-triggering-jenkins/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ Upload the app you want to test to a GitHub repo.

Go to Jenkins and create a new freestyle project.

<!-- Refer to the this tutorial https://medium.com/@marc_best/trigger-a-jenkins-build-from-a-github-push-b922468ef1ae to :
- install the GitHub integration Plugin
- prepare the Github repository
- add Jenkins Github plugin service
- give the Jenkins user access to the Gihub repository
- deploy SSH key
- update Jenkins job with GitHub configuration -->

1. Install the GitHub integration plugin

On Jenkins, go to 'Manage Jenkins' and then click on 'Manage Plugins'.
Expand All @@ -24,6 +16,8 @@ On Jenkins, go to 'Manage Jenkins' and then click on 'Manage Plugins'.

Click on the tab 'Available', search for the GitHub Integration Plugin, and install it.

![github-integration-plugin](../../images/2-github-integration-plugin.png)

2. Prepare GitHub repository

Go to your Github, click on Settings, and then go to 'Integration & services'. Add the Jenkins Github plugin.
Expand All @@ -49,10 +43,26 @@ In GitHub, go to 'Settings' and 'Deploy keys'. Click on 'Add deploy key' and pas

![deploy-key](../../images/2-deploy-key.png)

To check everything is working, enter the following command as the Jenkins user in your console.
Since we are running Jenkins in a Docker container, we need to run commands as the Jenkins user and not just in your local terminal.

To do this, go to your terminal and enter
```
docker ps
```
Copy the status.

![status](../../images/2-status.png)

Then run this command with your status:
```
docker exec -it 0b541bca2145 /bin/bash
```
Now that you are in the console as the Jenkins user. To check everything is working, enter the following:
```
ssh git@github.com
jenkins@04n971ew0224:/$ ssh git@github.com
```


If everything is correct, you should see:
```
PTY allocation request failed on channel 0
Expand All @@ -76,12 +86,10 @@ You may see an error from adding your repository URL if your "Credentials" are s

![error](../../images/2-error.png)

To fix this, you must set up the credentials under "Source Code Management" under "Repositories" in the configuration.
To fix this, we must add a credential. Under the "Source Code Management" section in "Credentials", click on the 'Add' button.

![credentials](../../images/2-credentials.png)

To add a Credential, click on the 'Add' button next to 'Credentials'.

There are several kinds of credentials you may choose.

- Username with password
Expand All @@ -102,7 +110,7 @@ You may leave the ID and Description empty.

Select the Credential you just created in the Credentials dropdown.

For more information on setting up the credentials, refer to https://www.thegeekstuff.com/2016/10/jenkins-git-setup/
>For more information on setting up the credentials, refer to https://www.thegeekstuff.com/2016/10/jenkins-git-setup/
Under the 'Build Triggers' section, check the box with 'GitHub hook trigger for GITScm polling'.

Expand Down
12 changes: 7 additions & 5 deletions content/2-running-automation-testing/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

3. You should see the username.

![username](../../images/2-username.png)
![username](../../images/2-user.png)

* API key
1. Click on your name in the upper righthand corner again and select settings.
Expand All @@ -24,7 +24,7 @@

![automation](../../images/2-automation.png)

3. On the right hand side, you can select your preferred language, and in the left side of the window you will see the desiredCaps.
3. On the left hand side, you can select your preferred language, and in the right side of the window you will see the desiredCaps.

![automation-settings](../../images/2-automation-settings.png)

Expand All @@ -47,7 +47,7 @@ docker run -d -p 8080:8080 jenkins
```
docker ps
```
Copy the status and enter it in the next command.
Copy the status (highlighted in the image below) and enter it in the next command.

![status](../../images/2-status.png)

Expand All @@ -56,7 +56,7 @@ docker exec -it 0b541bce2145 /bin/bash
```
Copy the admin password that shows up, and go to http://localhost:8080

Enter in your Kobiton username and password. Enter the admin password you got from the terminal when Jenkins prompts you to do so.
Enter in your Kobiton username and password. After logging in, enter the admin password you got from the terminal when Jenkins prompts you to do so.

### 2.2.1 For Jenkins Freestyle
On the left side on the page, click on New Item to start a new Jenkins project.
Expand Down Expand Up @@ -84,10 +84,12 @@ For examples of automation tests, go to https://github.com/kobiton/samples . Cho

Follow our guide on how to trigger a Jenkins build from a Git push and set up the configurations stated.

Add NodeJS Plugin on Jenkins. To do this, go to 'Manage Jenkins' -> 'Manage Plugins' -> Available. Search for NodeJS and install it.
This guide is executing the NodeJS test script from the Koboton samples, so we will add the NodeJS Plugin on Jenkins to execute NodeJS script as a build step. To do this, go to 'Manage Jenkins' -> 'Manage Plugins' -> Available. Search for NodeJS and install it.

![manage-plugins](../../images/2-manage-plugins.png)

If you are using a different language, you may try to find a suitable plugin for your project if necessary.

Go to Configure in your Jenkins project. Add a build step, execute shell.

![build-execute-shell](../../images/2-build-executeshell.png)
Expand Down
Binary file added images/2-github-integration-plugin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2-user.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/2-username.png
Binary file not shown.

0 comments on commit 90ef5c8

Please sign in to comment.