Skip to content

Commit 79ad9d5

Browse files
committed
Updates for deployment
1 parent 0a905bd commit 79ad9d5

File tree

5 files changed

+13
-28
lines changed

5 files changed

+13
-28
lines changed

.controlplane/templates/daily-task.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- rake
2121
- daily
2222
inheritEnv: true
23-
image: "/org/APP_ORG/image/APP_IMAGE"
23+
image: {{APP_IMAGE_LINK}}
2424
defaultOptions:
2525
autoscaling:
2626
minScale: 1
@@ -30,4 +30,3 @@ spec:
3030
external:
3131
outboundAllowCIDR:
3232
- 0.0.0.0/0
33-
identityLink: /org/APP_ORG/gvc/APP_GVC/identity/postgres-poc-identity

.controlplane/templates/gvc.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Template setup of the GVC, roughly corresponding to a Heroku app
22
kind: gvc
3-
name: APP_GVC
3+
name: {{APP_NAME}}
44
spec:
55
# For using templates for test apps, put ENV values here, stored in git repo.
66
# Production apps will have values configured manually after app creation.
77
env:
88
- name: DATABASE_URL
9-
# Password does not matter because host postgres.APP_GVC.cpln.local can only be accessed
9+
# Password does not matter because host postgres.{{APP_NAME}}.cpln.local can only be accessed
1010
# locally within CPLN GVC, and postgres running on a CPLN workload is something only for a
1111
# test app that lacks persistence.
12-
value: 'postgres://the_user:the_password@postgres.APP_GVC.cpln.local:5432/APP_GVC'
12+
value: 'postgres://the_user:the_password@postgres.{{APP_NAME}}.cpln.local:5432/{{APP_NAME}}'
1313
- name: RAILS_ENV
1414
value: production
1515
- name: NODE_ENV
@@ -18,8 +18,8 @@ spec:
1818
value: 'true'
1919
- name: REDIS_URL
2020
# No password for GVC local Redis. See comment above for postgres.
21-
value: 'redis://redis.APP_GVC.cpln.local:6379'
21+
value: 'redis://redis.{{APP_NAME}}.cpln.local:6379'
2222
# Part of standard configuration
2323
staticPlacement:
2424
locationLinks:
25-
- /org/APP_ORG/location/APP_LOCATION
25+
- {{APP_LOCATION_LINK}}

.controlplane/templates/postgres.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bindings:
106106
# - use
107107
# - view
108108
principalLinks:
109-
- //gvc/APP_GVC/identity/postgres-poc-identity
109+
- //gvc/{{APP_NAME}}/identity/postgres-poc-identity
110110
targetKind: secret
111111
targetLinks:
112112
- //secret/postgres-poc-credentials
@@ -139,9 +139,6 @@ spec:
139139
args:
140140
- "-c"
141141
- "cat /usr/local/bin/cpln-entrypoint.sh >> ./cpln-entrypoint.sh && chmod u+x ./cpln-entrypoint.sh && ./cpln-entrypoint.sh postgres"
142-
#command: "cpln-entrypoint.sh"
143-
#args:
144-
# - "postgres"
145142
ports:
146143
- number: 5432
147144
protocol: tcp

.controlplane/templates/rails.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
value: debug
1515
# Inherit other ENV values from GVC
1616
inheritEnv: true
17-
image: '/org/APP_ORG/image/APP_IMAGE'
17+
image: {{APP_IMAGE_LINK}}
1818
# 512 corresponds to a standard 1x dyno type
1919
memory: 512Mi
2020
ports:

.github/actions/deploy-to-control-plane/action.yml

+5-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ name: Deploy-To-Control-Plane
44
description: 'Deploys both to staging and to review apps'
55

66
inputs:
7-
# The name of the app to deploy
87
app_name:
98
description: 'The name of the app to deploy'
109
required: true
@@ -27,8 +26,8 @@ runs:
2726
run: |
2827
sudo npm install -g @controlplane/cli
2928
cpln --version
30-
gem install cpl -v 1.2.0
31-
29+
gem install cpl
30+
cpl --version
3231
- name: Set Short SHA
3332
id: vars
3433
shell: bash
@@ -56,23 +55,13 @@ runs:
5655
fi
5756
# Provision all infrastructure on Control Plane.
5857
# app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml
59-
6058
- name: cpl build-image
6159
shell: bash
6260
run: |
6361
cpln image docker-login
64-
cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
65-
# --cache /tmp/.docker-cache
66-
67-
- name: Run release script
68-
shell: bash
69-
run: |
70-
# Run database migrations (or other release tasks) with the latest image,
71-
# while the app is still running on the previous image.
72-
# This is analogous to the release phase.
73-
cpl run:detached './.controlplane/release_script.sh' -a ${{ inputs.app_name }} --image latest
74-
62+
BUILDKIT_PROGRESS=plain cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
63+
# --cache /tmp/.docker-cache
7564
- name: Deploy to Control Plane
7665
shell: bash
7766
run: |
78-
cpl deploy-image -a ${{ inputs.app_name }} --org ${{inputs.org}}
67+
cpl deploy-image -a ${{ inputs.app_name }} --run-release-phase --org ${{inputs.org}}

0 commit comments

Comments
 (0)