Skip to content
Permalink
Browse files
Create gh-pages branch via GitHub
  • Loading branch information
soperd committed Nov 27, 2018
1 parent 8797db7 commit 98430703e25057b195b911e9467bbc99bf503ef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
@@ -34,13 +34,13 @@
<h3>
<a id="weather" class="anchor" href="#weather" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Weather</h3>
<p>This week's weather. This uses the user's saved location if they set one:</p>
<p><img src="img/week_weather.png" alt="The week's weather"></p>
<p><img src="images/week_weather.png" alt="The week's weather"></p>
<p>This week's weather at a given location (Coventry):</p>
<p><img src="img/week_location_weather.png" alt="The week's weather at location"></p>
<p><img src="images/week_location_weather.png" alt="The week's weather at location"></p>
<h3>
<a id="location" class="anchor" href="#location" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Location</h3>
<p>The bot can remember your location, resolve, and recite it:</p>
<p><img src="img/location_datastore.png" alt="Remembering location"></p>
<p><img src="images/location_datastore.png" alt="Remembering location"></p>
<p>This automatically resolves the location's coordinates using <a href="https://nominatim.openstreetmap.org/">Nominantim</a>.</p>
<h2>
<a id="design" class="anchor" href="#design" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Design</h2>
@@ -83,11 +83,11 @@
<p>All code was to be hosted on Coventry University's GitHub server. The stable version of the project is hosted on my account, with the other members of my team having their own fork. This was done to enforce a policy of code merging via pull requests, rather than allowing every member to merge freely, as I thought this could create merge conflicts and become messy quickly.</p>
<p>Setting up Azure DevOps, I noticed their Continuous Integration platform and thought it would be a good idea to have some kind of CI for this project. However, with Azure, it wanted us to move our repo from the university's GitHub which wasn't ideal. I have had experience with <a href="https://jenkins.io/">Jenkins</a> before and recalled setting it up on my home server, so I decided to try it out with this project and after much trial and error with Jenkin's pipeline syntax, I managed to get something working.</p>
<p>Below is the current pipeline configuration. The idea here was to have one step for the building and testing of the project and the other for Docker building and deployment to a private registry also hosted on my home server.</p>
<p><img src="img/jenkins.png" alt="Jenkins pipeline example"></p>
<p><img src="images/jenkins.png" alt="Jenkins pipeline example"></p>
<p>I used the webhook feature in GitHub so that Jenkins would be notified of new PRs, commits, and branches. This meant that Jenkins would automatically build and test the codebase as the repo was being updated. Jenkins is also able to inform GitHub of the outcome of the pipeline and display a green tick or red cross if the pipeline succeeded or failed respectively.</p>
<p>Below is an example. Each commit with a green tick has been ran on Jenkins and passed all steps.</p>
<p><img src="img/jenkins_integration_example.png" alt="Jenkins PR integration example"></p>
<p><img src="img/jenkins_integration_example2.png" alt="Another Jenkins PR integration example"></p>
<p><img src="images/jenkins_integration_example.png" alt="Jenkins PR integration example"></p>
<p><img src="images/jenkins_integration_example2.png" alt="Another Jenkins PR integration example"></p>
<h2>
<a id="reflection" class="anchor" href="#reflection" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Reflection</h2>
<p>I think my design worked well for the most part. If we decided we wanted to integrate the bot into WhatsApp or Messenger, I feel that my design would aid in porting our features over to the new platform. This design also allows for multiple bots with similar features on the same platform, which I am happy with. I do however, believe that in some areas my code is poorly implemented, such as the <code>global_services</code> dictionary. This seems like a bit of a hack, and I feel I could have found a better way to inject services into the bots. That being said, this is the first time I've used a custom decorator in Python and I can see its potential elsewhere.</p>

0 comments on commit 9843070

Please sign in to comment.