README.md 4.92 KB
Newer Older
Buskermolen, Joost's avatar
Buskermolen, Joost committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# leuven.isric.org
| Name        | URL                                    | Branch |
|-------------|----------------------------------------|--------|
| Development | https://leuven.containers.wur.nl |    Master   |
| Production  | https://leuven.isric.org               |    Develop    |

## How it works

This application will be automatically deployed to the development environment when a commit within the `develop` branch has a commit message that starts with either:
* fix: \<COMMIT MESSAGE>
* feat: \<COMMIT MESSAGE>

For example:  
`git commit -m 'fix: Typo in maps.html'`  
Or:  
`git commit -m 'feat: Added new page contact.html'`

## Details
When using the prefixes as shown above in front of your commit message, a process is automatically started. This process will automate the following:
1. Tag your commit with a subsequent version number [PROD ONLY]
2. Build and tag a container with this version number [DEV gets a unique SHA]
3. Push the container to [our centralised repository](https://harbor.containers.wurnet.nl)
4. Modify `kustomization.yaml` manifest in [k8s-deployments repository](https://git.wur.nl/isric/ict/k8s-deployments/-/tree/master/leuven/overlays/dev) to deploy the new container to the [Development environment](https://leuven.containers.wur.nl)

## From Development to Production
If you're happy with the Development version and want to deploy it to Production, just merge your changes to master.

>The version that's currently running on Development will now be automatically deployed to Production

---
31
32
33
34
35
36
37
38
Intro
-----

Generic instructions and documentation concerning the Leuven virtual tour

- [http://leuven.isric.org/](http://leuven.isric.org/)
- [https://ees.kuleuven.be/africa-in-profile/virtuele-tentoonstelling/index.html](https://ees.kuleuven.be/africa-in-profile/virtuele-tentoonstelling/index.html)

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Running local server
--------------------

Local server (`server.py`) was rewritten to python3 (`3.8.4`), using the python3 `http.server` and `socketserver`, both packages are part of basic python3 distribution.

To run locally:

```
python server.py
```
The script binds to port `80`, it may require permissions to bind to a low port number. If so, change port number to `8080` or anything above `1024`, or sudo.

Local docker build
------------------

Script `run.sh` build and runs a local docker image.  


57
58
59
60
61
62
Deployment
----------

Tour is run from OC, project leuven:

```
63
#Note that there are some mis-confusion with image names and locations 
64
oc project leuven
65
66
67
68

docker build -t docker-registry.wur.nl/isric/leuven/leuven-v0-2 .
docker push docker-registry.wur.nl/isric/leuven/leuven-v0-2
oc import-image leuven:latest
69
70
```

71
72
73
The docker image contains a video folder that considerable increases the image size and the time for deployment: `./www/videos` this has been changed into using a pod container that will contain a permanent version of the videos.


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Google tour key
---------------

The google tour key is associated to the `worlsoilmuseum@gmail.com` 

```
key=AIzaSyBNjBofeB7ALxZAN0oTSEOJwQfYvzQfl8w
```

The key  is used on `index.html` around line 30:

```javascirpt
<script>
   var s = document.createElement("script");
		s.type = "text/javascript";
		s.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyBNjBofeB7ALxZAN0oTSEOJwQfYvzQfl8w&callback=initTour";
		$("head").append(s);
</script>
```

Google tour medatainfo
----------------------

97
98
99
100
101
102
103
104
105
106
107
Checking on the network console (browser) we have the [GeoPhotoService.GetMetadata](https://maps.googleapis.com/maps/api/js/GeoPhotoService.GetMetadata?pb=!1m5!1sapiv3!5sUS!11m2!1m1!1b0!2m2!1sen!2sUS!3m3!1m2!1e10!2sAF1QipN8WM2np43B5Ze7P_A3_Ftc_EYPWRYV6BbFWmzl!4m6!1e1!1e2!1e3!1e4!1e8!1e6&callback=_xdc_._vlmdra) url that contains metadata of the tour:


Panoid
------

Panoid is used on `tour.js`  to start the tour and then on `leuven_tour.json`  to define the icon location. Therefore the icon location on the tour is defined by this specific id. Looking at the tour on a browser the current panoid can be obtain on the console, inspecting object `panorama.location`
 
```
 >> panorama.location
```
108

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
109
110
111
Google has new documentation concerning the customization of streeview: [here](https://developers.google.com/maps/documentation/javascript/examples/streetview-custom-simple?hl=nl
)

112
113
Development Notes
-----------------
Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
114
check
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Hierbij de files voor de virtuele tour

De bestanden staan geordend zoals ze op mijn machine werken

Plaatsen waar het pad mogelijk aangepast moet worden:
-www/assets/js/tour.js : 

regel 17 -21 (Het pad van de links wanneer op de icoontjes wordt geklikt)

regel 28,29,30,31,32: img src (Het pad naar de icoontjes in de tour)

De links worden opgebouwd door het basis pad zoals in tour.js te koppelen aan de url per icoontje zoals in www/assets/tour/leuven_tour.json staat.

De gebruikte pdf-en staan in de folder www/assets/pdf.

De gebruikte video’s staan in de folder www/assets/video.

De foto’s van de objecten in de vitrinekasten en de foto’s van de panelen staan in www/images.