-
Notifications
You must be signed in to change notification settings - Fork 23
/
buildspec_i14y.yml
47 lines (42 loc) · 1.48 KB
/
buildspec_i14y.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
version: 0.2
env:
parameter-store:
API_SERVER_ADDRESSES: "DEPLOY_I14Y_SERVER_ADDRESS"
DEPLOYMENT_PATH: "DEPLOY_I14Y_DEPLOYMENT_PATH"
I14Y_THREADS: "I14Y_THREADS"
I14Y_WORKERS: "I14Y_WORKERS"
SERVER_DEPLOYMENT_USER: "DEPLOY_SERVER_DEPLOYMENT_USER"
# SSH_KEY_PATH: "DEPLOY_SSH_KEY_PATH" - defined below
# shared deployment variables with subsequent stages - might not to export as this is the final stage
exported-variables:
- DEPLOYMENT_PATH
- I14Y_THREADS
- I14Y_WORKERS
- SERVER_ADDRESS
- SERVER_DEPLOYMENT_USER
- SSH_KEY_PATH
phases:
install:
runtime-versions:
python: 3.x
commands:
- export PATH="$HOME/.rbenv/bin:$PATH"
- eval "$(rbenv init -)"
pre_build:
commands:
- aws secretsmanager get-secret-value --secret-id $SEARCH_SECRETSMANAGER_KEY_SECRET_NAME --region $SEARCH_AWS_REGION --query 'SecretString' --output text > $SEARCH_ENV_EC2_KEY
build:
commands:
- CURRENT_LOCATION=$(pwd) # would look something like this - /codebuild/output/src559980389/src - a temp dir created by codebuild
- SSH_KEY_PATH="${CURRENT_LOCATION}/${SEARCH_ENV_EC2_KEY}"
- echo $SSH_KEY_PATH
- echo "deploying i14y app with capistrano"
- bundle install
- cap $SEARCH_ENV puma:config puma:systemd:config puma:systemd:enable
- cap $SEARCH_ENV deploy
- cap $SEARCH_ENV --tasks
# - cap $SEARCH_ENV resque:start
- cap $SEARCH_ENV puma:restart
artifacts:
files:
- '**/*'