First website deployment
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		
							
								
								
									
										34
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
type: docker
 | 
			
		||||
name: default
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
- name: backend_check
 | 
			
		||||
  image: rust
 | 
			
		||||
  commands:
 | 
			
		||||
  - rustup component add clippy
 | 
			
		||||
  - cd geneit_backend
 | 
			
		||||
    #- cargo clippy -- -D warnings
 | 
			
		||||
    #- cargo test
 | 
			
		||||
 | 
			
		||||
- name: app_deploy
 | 
			
		||||
  image: node:18
 | 
			
		||||
  environment:
 | 
			
		||||
    AWS_ACCESS_KEY_ID:
 | 
			
		||||
      from_secret: AWS_ACCESS_KEY_ID
 | 
			
		||||
    AWS_SECRET_ACCESS_KEY:
 | 
			
		||||
      from_secret: AWS_SECRET_ACCESS_KEY
 | 
			
		||||
    AWS_DEFAULT_REGION: us-east-1
 | 
			
		||||
  commands:
 | 
			
		||||
  # Build website
 | 
			
		||||
  - cd geneit_app
 | 
			
		||||
  - npm install 
 | 
			
		||||
  - GENERATE_SOURCEMAP=false npm run build 
 | 
			
		||||
  # Install AWS
 | 
			
		||||
  - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
 | 
			
		||||
  - unzip awscliv2.zip
 | 
			
		||||
  - ./aws/install
 | 
			
		||||
  - aws configure set default.s3.signature_version s3v4
 | 
			
		||||
  # Upload to bucket
 | 
			
		||||
  - bash upload_bucket.sh 
 | 
			
		||||
							
								
								
									
										16
									
								
								geneit_app/upload_bucket.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								geneit_app/upload_bucket.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
if [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
 | 
			
		||||
	echo Missing AWS access key. Skip deployment.
 | 
			
		||||
	exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [[ -z "${AWS_SECRET_ACCESS_KEY}" ]]; then
 | 
			
		||||
	echo Missing AWS secret key. Skip deployment.
 | 
			
		||||
	exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ ! "$DRONE_COMMIT_BRANCH" == "master"]; then
 | 
			
		||||
	echo Not on master branch. Skip deployment.
 | 
			
		||||
	exit 0
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cd build && aws --endpoint-url https://s3.communiquons.org s3 sync . s3://geneit-app
 | 
			
		||||
		Reference in New Issue
	
	Block a user