-
Notifications
You must be signed in to change notification settings - Fork 23
/
buildspec_asis.yml
46 lines (41 loc) · 1.46 KB
/
buildspec_asis.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
version: 0.2
env:
parameter-store:
# env_used_in_app: "env_in_param_store"
API_SERVER_ADDRESSES: "DEPLOY_ASIS_SERVER_ADDRESS"
DEPLOYMENT_PATH: "DEPLOY_ASIS_DEPLOYMENT_PATH"
SERVER_DEPLOYMENT_USER: "DEPLOY_SERVER_DEPLOYMENT_USER"
CRON_SERVER_ADDRESSES: "DEPLOY_CRON_SERVER_ADDRESSES"
ASIS_THREADS: "ASIS_THREADS"
ASIS_WORKERS: "ASIS_WORKERS"
# shared deployment variables with subsequent stages - might not to export as this is the final stage
exported-variables:
- SERVER_ADDRESS
- DEPLOYMENT_PATH
- SERVER_DEPLOYMENT_USER
- SSH_KEY_PATH
- ASIS_THREADS
- ASIS_WORKERS
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 asis app with capistrano"
- bundle install
- cap $SEARCH_ENV puma:config puma:systemd:config puma:systemd:enable
- cap $SEARCH_ENV sidekiq:install
- cap $SEARCH_ENV deploy
artifacts:
files:
- '**/*'