forked from heroku/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
47 lines (43 loc) · 1.35 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: heroku
version: git
summary: Heroku CLI
description: Heroku CLI
grade: stable
confinement: classic
apps:
heroku:
command: bin/run
parts:
heroku:
plugin: nil
override-build: |
set -ex
# install yarn
apt-get update
apt-get install -y curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y nodejs yarn
cd packages/cli
yarn
yarn pack --filename heroku.tar.gz
mv heroku.tar.gz ../..
cd ../..
tar xvzf heroku.tar.gz
rmdir ../install
mv package ../install
OS=linux ./scripts/fetch_node_binary ../install/bin
cd ../install && yarn --prod
cd ../install && bin/run -v
sed -i 's/#!\/usr\/bin\/env node/#!\/snap\/heroku\/current\/bin\/node/' ../install/bin/run
sed -i "s/^process\.env\.HEROKU_UPDATE_INSTRUCTIONS.*$/process.env.HEROKU_UPDATE_INSTRUCTIONS = 'update with: snap refresh heroku'/" ../install/bin/run
mkdir -p snap/hooks
cat << EOF > snap/hooks/configure
#!/bin/sh
set -e
export PATH="$SNAP_DATA/bin:$PATH"
heroku update
EOF
chmod +x snap/hooks/configure