-
Notifications
You must be signed in to change notification settings - Fork 39
/
buildspec_searchgov.yml
50 lines (44 loc) · 1.65 KB
/
buildspec_searchgov.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
version: 0.2
env:
parameter-store:
APP_SERVER_ADDRESSES: "DEPLOY_SEARCHGOV_SERVER_ADDRESS"
CRON_SERVER_ADDRESSES: "DEPLOY_CRON_SERVER_ADDRESSES"
DEPLOYMENT_PATH: "DEPLOY_SEARCHGOV_DEPLOYMENT_PATH"
RESQUE_SERVER_ADDRESSES: "DEPLOY_RESQUE_SERVER_ADDRESSES"
RESQUE_WORKERS_COUNT: "DEPLOY_RESQUE_WORKERS_COUNT"
SEARCHGOV_THREADS: "SEARCHGOV_THREADS"
SEARCHGOV_WORKERS: "SEARCHGOV_WORKERS"
SERVER_DEPLOYMENT_USER: "DEPLOY_SERVER_DEPLOYMENT_USER"
# shared deployment variables with subsequent stages - might not to export as this is the final stage
exported-variables:
- APP_SERVER_ADDRESSES
- DEPLOYMENT_PATH
- RESQUE_SERVER_ADDRESSES
- SEARCHGOV_THREADS
- SEARCHGOV_WORKERS
- 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 searchgov app with capistrano"
- bundle install
- cap $SEARCH_ENV puma:config puma:systemd:config puma:systemd:enable
- cap $SEARCH_ENV deploy
- cap $SEARCH_ENV resque:restart
- cap $SEARCH_ENV puma:restart
artifacts:
files:
- '**/*'