-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.example
executable file
·126 lines (116 loc) · 2.54 KB
/
install.example
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bash
#
# install-cli
#
# Copy this file into your project to enable easy, guided
# installation/bootstrapping.
#
# Don't like sh/bash/etc? Sure.
#
# Love sh/bash/etc? Yeah, but....
#
# Let's use it here, to bootstrap whatever tools/libraries/etc. we
# *really* love for our project.
#
# You can name your implementation of this script whatever you like,
# such as: install
#
# Update INSTALL_VERSION to require the version of install-cli this
# script expects
INSTALL_VERSION=0.0.7
#
# start bootstrap installation lib
#
# This is a *bit* of boilerplate to ensure we've downloaded the correct
# version of install-cli. (You probably don't need to touch this.)
#
INSTALL_FILE=.install.${INSTALL_VERSION//./-}.bash.inc
INSTALL_URL=https://raw.githubusercontent.com/dssg/install-cli/$INSTALL_VERSION/install.bash.inc
[ -f $INSTALL_FILE ] || curl -#L $INSTALL_URL -o $INSTALL_FILE
. $INSTALL_FILE
#
# end bootstrap installation lib
#
#
# start project check/install
#
# This is your time to shine!
# Invoke 'require' to ensure your project's basic requirements are met.
#
# check/install examples
#
# # pyenv
#
# exists_pyenv() {
# icli::check_command pyenv
# }
#
# install_pyenv() {
# curl -#L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
# }
#
# require pyenv \
# exists_pyenv \
# install_pyenv \
# --fail-prefix="not found"
#
# # python
#
# PY_VERSION=3.6.3
#
# exists_python() {
# pyenv versions 2> /dev/null | grep -E "^ *${PY_VERSION}$" > /dev/null
# }
#
# install_python() {
# pyenv install -s $PY_VERSION
# }
#
# require "python-${PY_VERSION}" \
# exists_python \
# install_python \
# --fail-prefix="v${PY_VERSION} not found"
#
# # virtualenv
#
# PROJECT=install-cli
#
# exists_virtualenv() {
# test "$(pyenv version-name 2> /dev/null)" == "$PROJECT"
# }
#
# install_virtualenv() {
# pyenv virtualenv 3.6.3 $PROJECT
# }
#
# require $PROJECT \
# exists_virtualenv \
# install_virtualenv \
# --fail-prefix="project virtual environment not found"
#
# # python libs
#
# install_lib() {
# pip install -r requirements.txt
# }
#
# # no great way to check that python libs installed;
# # rather, always fail check and let pip figure it out
# require lib \
# icli::always_install \
# install_lib
#
# # environment variables
#
# EXPECTED_ENVVARS="PGHOST PGPORT PGUSER PGDATABASE"
#
# check_envvars() {
# icli::check_envvars $EXPECTED_ENVVARS
# }
#
# require envvars \
# check_envvars \
# --fail-prefix="one or more of these environment variables missing ($EXPECTED_ENVVARS)"
#
# end project check/install
#