-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.lando.yml
149 lines (145 loc) · 5.54 KB
/
.lando.yml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
name: jschol
# CAREFUL with this env file, Docker env files don't support interpolation!
env_file:
- defaults.env
- local.env
services:
appserver:
type: ruby:custom
ports:
- '18880:18880'
overrides:
image: ruby:3.0-buster
platform: linux/amd64
# Pass SSH auth.
volumes:
- type: bind
# Linux user: add 'export LANDO_SSH_AUTH_SOCK="${SSH_AUTH_SOCK}' at the end of your ~/.bashrc:
# Mac user: MacOS specific path is here as the variable default value, nothing to do.
source: "${LANDO_SSH_AUTH_SOCK:-/run/host-services/ssh-auth.sock}"
target: /run/host-services/ssh-auth.sock
environment:
SSH_AUTH_SOCK: "/run/host-services/ssh-auth.sock"
GEM_HOME: "/usr/local/bundle"
PATH: "/usr/local/bundle/bin:/usr/local/bundle/gems/bin:${PATH}"
QT_QPA_PLATFORM: offscreen
ports:
- '18880:18880'
command:
- if [ ! -L /var/www/.aws ]; then ln -s /user/.aws /var/www/.aws; fi
- /app/gulp
build_as_root:
- apt-get update -qq && apt-get install -y apt-transport-https && apt-get install glibc-source
- apt-get install -y phantomjs vim net-tools
- curl -sL https://deb.nodesource.com/setup_20.x | grep -v sleep | bash -
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update -qq
- apt-get autoclean
- apt-get install mariadb-client build-essential libpq-dev yarn nodejs -y
- gem install bundler
# - gem install foreman
- apt-get autoclean
- chown www-data:www-data /run/host-services/ssh-auth.sock
- chmod g+w /run/host-services/ssh-auth.sock
- chown www-data:www-data -R /usr/local/bundle
build:
- cd /app && /app/make-dev-symlinks.sh
- cd /app && /app/setup.sh
run:
run_as_root:
- chown www-data:www-data /run/host-services/ssh-auth.sock
- chmod g+w /run/host-services/ssh-auth.sock
- apt-get install -y less zip jq groff
- if [ ! -d /app/aws ]; then (curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip -nqq awscliv2.zip); fi
- if [ -d /app/aws ]; then /app/aws/install; fi
moreHttpPorts:
- '18880'
scanner: false
events:
pre-destroy:
- appserver: rm -Rf /app/gems/*
- appserver: rm -f /app/.mysqlpsk.3306.*
pre-stop:
- appserver: rm -f /app/.mysqlpsk.3306.*
post-start:
- appserver: test -e ~/.ssh/config || printf 'Host *\n AddKeysToAgent yes\n' > ~/.ssh/config
tooling:
npm:
service: appserver
description: Runs npm commands on the Lando Jschol appserver
yarn:
service: appserver
description: Runs yarn commands on the Lando Jschol appserver
cmd: yarn
dir: /app
ruby:
service: appserver
description: Runs ruby commands on the Lando Jschol appserver
bundle:
service: appserver
description: Runs bundle commands on the Lando Jschol appserver
gem:
service: appserver
description: Runs gem commands on the Lando Jschol appserver
just-test:
service: appserver
cmd: ruby util/maybeSocks.rb && ruby test/quick.rb
description: Runs the quicktest suite on the Lando Jschol appserver
env:
SCHEME: http
irb:
service: appserver
cmd: GEM_PATH=/app/gems/gems irb
dir: /app
description: Runs irb on the Jschol appserver (for some good REPL fun)
deploy:
service: appserver
cmd: ruby util/maybeSocks.rb && /app/deployVersion.sh
description: Runs the deployment script to deploy to Elastic Beanstalk
promote:
service: appserver
cmd: /app/promoteVersion.sh
description: Promote an Elastic Beanstalk app from one environment to another
aws:
service: appserver
cmd: aws --profile pub
dir: /app
description: Runs AWS-cli commands on the Jschol appserver
watch-stg:
service: appserver
cmd: watch -d aws --profile pub elasticbeanstalk describe-environments --environment-name eb-pub-jschol2-stg
description: Watches eb-pub-jschol2-stg aws environment details for updates.
watch-dev:
service: appserver
cmd: watch -d aws --profile pub elasticbeanstalk describe-environments --environment-name eb-pub-jschol2-dev
description: Watches eb-pub-jschol2-dev aws environment details for updates.
watch-prd:
service: appserver
cmd: watch -d aws --profile pub elasticbeanstalk describe-environments --environment-name eb-pub-jschol2-prd
description: Watches eb-pub-jschol2-prd aws environment details for updates.
test:
service: appserver
cmd: bundle exec rubocop && npx eslint . && ruby util/maybeSocks.rb && ruby test/quick.rb
description: Runs the quicktest suite on the Lando Jschol appserver
env:
SCHEME: http
test-prd:
service: appserver
cmd: ruby test/quick.rb
env:
PUMA_PORT: 443
SCHEME: https
TARGET_HOST: escholarship.org
description: Runs the quicktest suite against production Jschol
#NOTE: tooling for testing stg and dev does not belong in this file, which is publicly available, please add it to your .lando.local.yml file instead
socks:
service: appserver
cmd:
- ruby util/maybeSocks.rb && echo "==> running netstat -tunl to confirm SOCKS_PORT is open <==" && netstat -tunl | grep ${SOCKS_PORT}
description: Sets the socks proxy tunnel back up, if you have been too idle
ssh-fix:
service: appserver
description: Fix ssh auth sock permission for MacOS users. Lando rebuild fixes the problem as well.
user: root