README.md 4.19 KB
Newer Older
Buskermolen, Joost's avatar
Buskermolen, Joost committed
1
# leuven.isric.org
2

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
3 4
Locations:

Buskermolen, Joost's avatar
Buskermolen, Joost committed
5 6
| Name        | URL                                    | Branch |
|-------------|----------------------------------------|--------|
Buskermolen, Joost's avatar
Buskermolen, Joost committed
7
| Development | https://leuven.containers.wur.nl |    Develop   |
Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
8 9 10 11 12 13
| Production  | https://leuven.isric.org          |    Master    |

**Note:** This repository implements git LFS for PDF, images and videos.
## Implemented

Places implementing.
14 15 16

- [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)
Buskermolen, Joost's avatar
Buskermolen, Joost committed
17 18 19 20

## 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:
21

Buskermolen, Joost's avatar
Buskermolen, Joost committed
22 23 24 25 26 27 28 29 30
* 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
31

Buskermolen, Joost's avatar
Buskermolen, Joost committed
32 33 34 35 36 37 38
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
39

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
40
If you're happy with the Development version and want to deploy it to Production, just merge your changes to master.
41

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
42
## Persistent volumes
43

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
44
Deployment implements a persistant volume for folder `www/videos` as those are big files.
45

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
46
Currentely sync to folder has be be done manually. Ticket `leuven#1` will make it automatically.
47

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
48
## Running local server
49

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
50
Website is plain JS/HTML any local serving server can be used.
51

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
52
## Local docker build
53

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
54
To run a local docker instance:
55

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
56 57 58
```bash
docker build --no-cache -t leuven .
docker run -p8080:8080  
59
```
60

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
61
## Google tour key
62

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
63
The google tour key is associated to the `worlsoilmuseum@gmail.com`
64

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
65
```bash
66 67 68 69 70 71 72 73 74 75 76 77 78 79
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>
```

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
80
## Google tour medatainfo
81

82

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
83
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:
84

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
85
## Panoid
86 87 88

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`
 
Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
89
```javascript
90 91
 >> panorama.location
```
92

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

Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
96 97 98
## Development Notes


Jorge S. Mendes de Jesus's avatar
Jorge S. Mendes de Jesus committed
99
check
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
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.