Skip to content

Commit 4e1d301

Browse files
committed
WIP
1 parent c2f22a1 commit 4e1d301

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.controlplane/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz
1717
rm -rf /tmp/node-build-master
1818

1919
# Rails app lives here
20+
# Entry point and commands will be run from this directory
2021
WORKDIR /app
2122

2223
# Set production environment
@@ -62,8 +63,8 @@ RUN yarn res:build
6263
RUN bin/rails react_on_rails:locale
6364
RUN bin/rails assets:precompile
6465

65-
# add entrypoint
66-
COPY .controlplane/entrypoint.sh ./
67-
ENTRYPOINT ["/app/entrypoint.sh"]
66+
# add entrypoint and release script to docker image at top level
67+
COPY .controlplane/entrypoint.sh .controlplane/release_script.sh ./
68+
ENTRYPOINT ["./entrypoint.sh"]
6869

6970
CMD ["./bin/rails", "server"]

.controlplane/release_script.sh

100644100755
File mode changed.

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ yarn-debug.log*
4949
spec/
5050
scripts/
5151

52+
# No need for controlplane config in docker file. These are used locally and by CI
53+
/.controlplane

.github/workflows/deploy-to-control-plane.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ jobs:
5858
cpln image docker-login
5959
cpl build-image -a ${{ secrets.APP_NAME_STAGING }} --commit ${{steps.vars.outputs.sha_short}} --org ${{secrets.CPLN_ORG_STAGING}}
6060
61+
- name: Run release script
62+
run: |
63+
# Run database migrations (or other release tasks) with the latest image,
64+
# while the app is still running on the previous image.
65+
# This is analogous to the release phase.
66+
cpl run:detached './release_script.sh' -a ${{ secrets.APP_NAME_STAGING }} --image latest
67+
6168
- name: Deploy to Control Plane
6269
run: |
6370
cpl deploy-image -a ${{ secrets.APP_NAME_STAGING }} --org ${{secrets.CPLN_ORG_STAGING}}

0 commit comments

Comments
 (0)