Fix rosti.sh
* Check if symlink exists before it's created
This commit is contained in:
		
							parent
							
								
									63d5507a91
								
							
						
					
					
						commit
						5e446efd24
					
				
					 2 changed files with 6 additions and 5 deletions
				
			
		
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
DOCKER=docker
 | 
					DOCKER=docker
 | 
				
			||||||
VERSION=2021.02-1
 | 
					VERSION=2021.03-1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: build
 | 
					all: build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,4 +16,4 @@ squashed:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
push: squashed
 | 
					push: squashed
 | 
				
			||||||
	$(DOCKER) tag rosti/runtime:dev-squashed rosti/runtime:$(VERSION)
 | 
						$(DOCKER) tag rosti/runtime:dev-squashed rosti/runtime:$(VERSION)
 | 
				
			||||||
	$(DOCKER) push rosti/runtime:$(VERSION)
 | 
						$(DOCKER) push rosti/runtime:$(VERSION) 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,8 @@ function setTech() {
 | 
				
			||||||
    tech=$1
 | 
					    tech=$1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Activation of primary tech bin directory
 | 
					    # Activation of primary tech bin directory
 | 
				
			||||||
    test ! -e $PRIMARYDIR || $TECHDIR/$tech/bin
 | 
					    # test ! -e $PRIMARYDIR || $TECHDIR/$tech/bin
 | 
				
			||||||
 | 
					    test -L $PRIMARYDIR && unlink $PRIMARYDIR
 | 
				
			||||||
    ln -s $TECHDIR/$tech/bin $PRIMARYDIR
 | 
					    ln -s $TECHDIR/$tech/bin $PRIMARYDIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Parse name of the tech - like python or node
 | 
					    # Parse name of the tech - like python or node
 | 
				
			||||||
| 
						 | 
					@ -51,7 +52,7 @@ function setTech() {
 | 
				
			||||||
            echo "IMPORTANT: /srv/venv exists, if you have changed python version, make sure to create or update the virtualenv:"
 | 
					            echo "IMPORTANT: /srv/venv exists, if you have changed python version, make sure to create or update the virtualenv:"
 | 
				
			||||||
            echo 
 | 
					            echo 
 | 
				
			||||||
            echo "    rm -rf /srv/venv"
 | 
					            echo "    rm -rf /srv/venv"
 | 
				
			||||||
            echo "    python3 -m venv /srv/venv)"
 | 
					            echo "    python3 -m venv /srv/venv"
 | 
				
			||||||
            echo
 | 
					            echo
 | 
				
			||||||
            echo "Don't forget to backup the old venv if necessary."
 | 
					            echo "Don't forget to backup the old venv if necessary."
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
| 
						 | 
					@ -71,7 +72,7 @@ function setTech() {
 | 
				
			||||||
        test -e /srv/conf/php-fpm/pool.d/app.conf || mv /srv/app/pool_app.conf /srv/conf/php-fpm/pool.d/app.conf
 | 
					        test -e /srv/conf/php-fpm/pool.d/app.conf || mv /srv/app/pool_app.conf /srv/conf/php-fpm/pool.d/app.conf
 | 
				
			||||||
        test -e /srv/conf/php-fpm/php.ini || mv /srv/app/php.ini /srv/conf/php-fpm/php.ini
 | 
					        test -e /srv/conf/php-fpm/php.ini || mv /srv/app/php.ini /srv/conf/php-fpm/php.ini
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini
 | 
					        test ! -e /srv/conf/php-fpm/php.ini && ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # And remove unneeded ones
 | 
					        # And remove unneeded ones
 | 
				
			||||||
        # TODO: not sure how good idea this is
 | 
					        # TODO: not sure how good idea this is
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue