forked from MapComplete/MapComplete
		
	Fix deploy script + more robust
This commit is contained in:
		
							parent
							
								
									664b6800a3
								
							
						
					
					
						commit
						47a4284ff6
					
				
					 3 changed files with 9 additions and 10 deletions
				
			
		
							
								
								
									
										2
									
								
								State.ts
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								State.ts
									
										
									
									
									
								
							| 
						 | 
					@ -22,7 +22,7 @@ export class State {
 | 
				
			||||||
    // The singleton of the global state
 | 
					    // The singleton of the global state
 | 
				
			||||||
    public static state: State;
 | 
					    public static state: State;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public static vNumber = "0.0.8b";
 | 
					    public static vNumber = "0.0.8c";
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // The user journey states thresholds when a new feature gets unlocked
 | 
					    // The user journey states thresholds when a new feature gets unlocked
 | 
				
			||||||
    public static userJourney = {
 | 
					    public static userJourney = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								deploy.sh
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								deploy.sh
									
										
									
									
									
								
							| 
						 | 
					@ -1,13 +1,13 @@
 | 
				
			||||||
#! /bin/bash
 | 
					#! /bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir -p assets/generated
 | 
					mkdir -p assets/generated
 | 
				
			||||||
ts-node createLayouts.ts
 | 
					ts-node createLayouts.ts || { echo 'Creating layouts failed' ; exit 1; }
 | 
				
			||||||
find -name '*.png' | parallel optipng '{}'
 | 
					find -name '*.png' | parallel optipng '{}'
 | 
				
			||||||
npm run build
 | 
					npm run build || { echo 'Npm build failed' ; exit 1; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ $1 == "production" ]]
 | 
					if [[ $1 == "groen" ]]
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
    echo "DEPLOYING TO PRODUCTION!"
 | 
					    echo "DEPLOYING TO BUURTNATUUR!"
 | 
				
			||||||
    mv /home/pietervdvn/git/buurtnatuur.github.io/CNAME /home/pietervdvn/git/
 | 
					    mv /home/pietervdvn/git/buurtnatuur.github.io/CNAME /home/pietervdvn/git/
 | 
				
			||||||
    mv /home/pietervdvn/git/buurtnatuur.github.io/.git /home/pietervdvn/git/
 | 
					    mv /home/pietervdvn/git/buurtnatuur.github.io/.git /home/pietervdvn/git/
 | 
				
			||||||
    rm -rf /home/pietervdvn/git/buurtnatuur.github.io/*
 | 
					    rm -rf /home/pietervdvn/git/buurtnatuur.github.io/*
 | 
				
			||||||
| 
						 | 
					@ -15,9 +15,9 @@ then
 | 
				
			||||||
    mv /home/pietervdvn/git/CNAME /home/pietervdvn/git/buurtnatuur.github.io/
 | 
					    mv /home/pietervdvn/git/CNAME /home/pietervdvn/git/buurtnatuur.github.io/
 | 
				
			||||||
    mv /home/pietervdvn/git/.git /home/pietervdvn/git/buurtnatuur.github.io/
 | 
					    mv /home/pietervdvn/git/.git /home/pietervdvn/git/buurtnatuur.github.io/
 | 
				
			||||||
    cd /home/pietervdvn/git/buurtnatuur.github.io/
 | 
					    cd /home/pietervdvn/git/buurtnatuur.github.io/
 | 
				
			||||||
elif [[ $1 == "groen" ]]
 | 
					elif [[ $1 == "production" ]]
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
    echo "DEPLOYING TO BUURTNATUUR"
 | 
					    echo "DEPLOYING TO MAPCOMPLETE"
 | 
				
			||||||
    rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/*
 | 
					    rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/*
 | 
				
			||||||
    cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
 | 
					    cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
 | 
				
			||||||
    cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
 | 
					    cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								index.ts
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								index.ts
									
										
									
									
									
								
							| 
						 | 
					@ -7,7 +7,6 @@ import {UIEventSource} from "./Logic/UIEventSource";
 | 
				
			||||||
import * as $ from "jquery";
 | 
					import * as $ from "jquery";
 | 
				
			||||||
import {FromJSON} from "./Customizations/JSON/FromJSON";
 | 
					import {FromJSON} from "./Customizations/JSON/FromJSON";
 | 
				
			||||||
import {TagRendering} from "./UI/TagRendering";
 | 
					import {TagRendering} from "./UI/TagRendering";
 | 
				
			||||||
import {State} from "./State";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
TagRendering.injectFunction();
 | 
					TagRendering.injectFunction();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +35,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ----------------- SELECT THE RIGHT QUESTSET -----------------
 | 
					// ----------------- SELECT THE RIGHT QUESTSET -----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let defaultLayout = "buurtnatuur"
 | 
					let defaultLayout = "bookcases"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const path = window.location.pathname.split("/").slice(-1)[0];
 | 
					const path = window.location.pathname.split("/").slice(-1)[0];
 | 
				
			||||||
if (path !== "index.html" && path !== "") {
 | 
					if (path !== "index.html" && path !== "") {
 | 
				
			||||||
| 
						 | 
					@ -93,7 +92,7 @@ if (layoutFromBase64.startsWith("wiki:")) {
 | 
				
			||||||
                throw e;
 | 
					                throw e;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    }).fail(e => {
 | 
					    }).fail(() => {
 | 
				
			||||||
        new FixedUiElement(`<a href="${cleanUrl}">${themeName}</a> is invalid:<br/>Could not download - wrong URL?`)
 | 
					        new FixedUiElement(`<a href="${cleanUrl}">${themeName}</a> is invalid:<br/>Could not download - wrong URL?`)
 | 
				
			||||||
            .SetClass("clickable")
 | 
					            .SetClass("clickable")
 | 
				
			||||||
            .AttachTo("centermessage");
 | 
					            .AttachTo("centermessage");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue