akester/new-chef

Fork Project

047097bd6570da54ca52fb795ce6679c49bd1699

Authored By: Andrew Kester Date: January 1, 2018 11:29 am

Fix issues with yarn install

cookbooks/sthse/recipes/nodejs.rb
29 29
 	action :periodic
30 30
 end
31 31
 
32
-# Install Yarn
33
-execute "yarn_apt_key" do
34
-	command "curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -"
35
-	action :nothing
32
+execute "yarn_install" do
33
+	command "npm i -g yarn"
34
+	not_if { ::File.exist?('/usr/bin/yarn') }
35 36
 end
36 37
 
38
-apt_repository 'yarn' do
39
-	uri 'https://dl.yarnpkg.com/debian/'
40
-	components ['main']
41
-	distribution 'main/stable'
42
-	notifies :run, 'execute[yarn_apt_key]', :before
37
+file '/etc/apt/sources.list.d/yarn.list' do
38
+	action :delete
39 43
 end
40 44
 
45
-package 'yarn'
46
-
41 47
 # We use execute rather than package, since package doesn't respect the
42 48
 # flag that we want a backported version.
43 49
 #package 'nodejs'
cookbooks/sthse_application/recipes/default.rb
103 103
 package 'subversion'
104 104
 package 'mercurial'
105 105
 
106
+# Install libpng12, so we can run webpack
107
+bash 'libpng12_setup' do
108
+	cwd '/tmp'
109
+	code <<-EOH
110
+		wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
111
+		sudo dpkg -i /tmp/libpng12.deb
112
+		rm /tmp/libpng12.deb
113
+	EOH
114
+	not_if { ::File.exist?('/lib/x86_64-linux-gnu/libpng12.so.0') }
115
+end
116
+
117 106
 # Setup application directory
118 107
 directory '/var/storehouse' do
119 108
 	owner 'sthse'
120 109