You've already forked pgbackrest
							
							
				mirror of
				https://github.com/pgbackrest/pgbackrest.git
				synced 2025-10-30 23:37:45 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			81 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| Vagrant.configure(2) do |config|
 | |
|     config.vm.provider :virtualbox do |vb|
 | |
|         vb.memory = 2048
 | |
|         vb.cpus = 8
 | |
|     end
 | |
| 
 | |
|     config.vm.box = "ubuntu/xenial64"
 | |
|     config.vm.box_version = "20170311.0.0"
 | |
| 
 | |
|     config.vm.provider :virtualbox do |vb|
 | |
|         vb.name = "pgbackrest-test"
 | |
|     end
 | |
| 
 | |
|     # Provision the VM
 | |
|     config.vm.provision "shell", inline: <<-SHELL
 | |
|         echo 'Build Begin' && date
 | |
| 
 | |
|         # Suppress "dpkg-reconfigure: unable to re-open stdin: No file or directory" warning
 | |
|         export DEBIAN_FRONTEND=noninteractive
 | |
| 
 | |
|         # Assign a host name
 | |
|         sed -i 's/^127\.0\.0\.1\t.*/127\.0\.0\.1\tlocalhost pgbackrest-test/' /etc/hosts
 | |
|         hostnamectl set-hostname pgbackrest-test
 | |
| 
 | |
|         # Update Apt
 | |
|         echo 'Update Apt' && date
 | |
|         apt-get update
 | |
| 
 | |
|         # Install build tools
 | |
|         apt-get install -y devscripts build-essential lintian git txt2man debhelper
 | |
| 
 | |
|         # Synchronize date
 | |
|         apt-get install -y ntpdate
 | |
|         ntpdate pool.ntp.org
 | |
| 
 | |
|         # Install Docker
 | |
|         echo 'Install Docker' && date
 | |
|         apt-get install -y apt-transport-https ca-certificates
 | |
|         apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
 | |
|         echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' > /etc/apt/sources.list.d/docker.list
 | |
|         apt-get update
 | |
|         apt-get install -y linux-image-extra-$(uname -r)
 | |
|         apt-get install -y docker-engine
 | |
|         service docker start
 | |
|         sudo usermod -aG docker ubuntu
 | |
| 
 | |
|         # Install Perl modules
 | |
|         echo 'Install Perl Modules' && date
 | |
|         apt-get install -y libdbd-pg-perl libxml-checker-perl libperl-critic-perl libdevel-nytprof-perl libdevel-cover-perl
 | |
| 
 | |
|         # Install utilities
 | |
|         echo 'Install Utilities' && date
 | |
|         apt-get install -y vim htop
 | |
| 
 | |
|         # Install TeX Live
 | |
|         echo 'Install TeX Live' && date
 | |
|         apt-get install -y --no-install-recommends texlive-latex-base texlive-latex-extra texlive-fonts-recommended
 | |
|         apt-get install -y texlive-font-utils
 | |
| 
 | |
|         # Create backrest user and postgres group
 | |
|         echo 'Create Postgres Group & pgBackRest User' && date
 | |
|         groupadd -g5000 postgres
 | |
|         adduser --uid=5001 --ingroup=ubuntu --disabled-password --gecos "" backrest
 | |
| 
 | |
|         # Build VM images
 | |
|         echo 'Build VM Images' && date
 | |
|         rm -rf /backrest/test/.vagrant/docker/*
 | |
|         rm -rf /backrest/test/.vagrant/libc/*
 | |
|         rm -rf /backrest/test/.vagrant/package/*
 | |
|         sudo su - ubuntu -c '/backrest/test/test.pl --vm-build'
 | |
| 
 | |
|         echo 'Build End' && date
 | |
|     SHELL
 | |
| 
 | |
|   # Don't share the default vagrant folder
 | |
|   config.vm.synced_folder ".", "/vagrant", disabled: true
 | |
| 
 | |
|   # Mount backrest path for testing
 | |
|   config.vm.synced_folder "..", "/backrest"
 | |
| end
 |