Skip to content

Commit

Permalink
feat: make it follow the standard "release branch" workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Oct 4, 2023
1 parent 2505f0f commit a15517a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 34 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/deploy.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Release
name: Merge dev to stage
on:
workflow_dispatch:
schedule:
- cron: '15 14 * * *'
jobs:
test:
name: Test
runs-on: ubuntu-20.04
merge:
name: Merge
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'dev'

- name: Merge dev to stage
uses: devmasx/[email protected]
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ jobs:
${{ github.ref == 'refs/heads/dev' && vars.NETLIFY_STORYBOOK_ID != ''
}}

- name: [silverback-template] Merge release to prod
uses: devmasx/[email protected]
if: ${{ github.repository == 'AmazeeLabs/silverback-template' && github.ref == 'refs/heads/release'}}
with:
type: now
target_branch: prod
github_token: ${{ github.token }}

docker_build:
name: Docker Build
if: startsWith(github.ref_name, 'test-all/')
Expand Down
1 change: 1 addition & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion .lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tasks:
command: drush scr scripts/translations-import.php
service: cli
environments:
dev:
prod:
routes:
- nginx:
- example.cms.amazeelabs.dev
Expand All @@ -32,3 +32,25 @@ environments:
schedule: '*/15 * * * *'
command: drush cron
service: cli
stage:
routes:
- nginx:
- stage-example.cms.amazeelabs.dev
- build:
- stage-example.build.amazeelabs.dev
cronjobs:
- name: drush cron
schedule: '*/15 * * * *'
command: drush cron
service: cli
dev:
routes:
- nginx:
- dev-example.cms.amazeelabs.dev
- build:
- dev-example.build.amazeelabs.dev
cronjobs:
- name: drush cron
schedule: '*/15 * * * *'
command: drush cron
service: cli
15 changes: 14 additions & 1 deletion INIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Adjust project machine name in the repo.
```ts
await prompt('PROJECT_NAME_MACHINE', {
type: 'text',
message: 'Project name for machines:',
message:
'Project name for machines (usually a lowercase version of Jira project code):',
validate: (name) =>
!/^[a-z][a-z\d_]*$/.test(name)
? 'Must start with a lowercase letter and contain lowercase letters, numbers and underscores only.'
Expand All @@ -60,6 +61,18 @@ replace(
'@amazeelabs/silverback-template',
process.env.PROJECT_NAME_MACHINE,
);
// Template's prod domain is special.
replace(
'.lagoon.yml',
'- example.',
'- prod-' + process.env.PROJECT_NAME_MACHINE + '.',
);
// The rest of domains are standard.
replace(
'.lagoon.yml',
'-example.',
'-' + process.env.PROJECT_NAME_MACHINE + '.',
);
```

Update the auth key for Gatsby user.
Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@

## Release and deployment

Development happens in pull requests against the `dev` branch. There is a github
"Release" workflow that will merge the current state of `dev` into the `stage`.
This workflow can be triggered from the github UI and will run automatically
once a day.

The "Deploy" workflow has to be triggered manually from the github UI, and will
merge the current state of `stage` into `prod` and therefore trigger a
production deployment.
Default process:

- Create a new branch from `release` and commit your work in
- Create a PR against `release`
- Merge your branch to `dev` for testing
- Testing feedback is committed to the branch and merged back to `dev` for
retesting
- When the PR is approved and Jira ticket gets to the Deploy state, the branch
is merged to `release`
- Please note, this does not trigger an actual PROD deployment
- If you are asked to do the actual PROD deployment, this can be done by
merging `release` branch into `prod`

## Installation

Expand Down Expand Up @@ -238,7 +242,7 @@ In a standard project we use three fixed Lagoon environments: `dev`, `stage` and
- `prod`: The production environment. Do not touch.

Lagoon should also be configured to create automatic environments for feature
branches that are prefixed with `lagoon/`. Those will be filled with test
branches that are prefixed with `lagoon-`. Those will be filled with test
content.

## "Strangling" legacy systems
Expand Down

0 comments on commit a15517a

Please sign in to comment.