-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update app dockerfile * chore: update lagoon project id * chore: update app dockerfile * chore: backend test * chore: split lagoon and docker files * chore: update ci test workflow * chore: add ci deploy job * chore(lagoon): add staging workflow
- Loading branch information
Showing
10 changed files
with
320 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
BASE_URL=https://nginx.staging-backend.druxtjs-org-demo-umami.au2.amazee.io | ||
API_PROXY=1 | ||
|
||
# OAuth settings - Uncomment and set value as per backend. | ||
#OAUTH_CLIENT_ID= | ||
#GITHUB_CLIENT_ID= | ||
#GITHUB_CLIENT_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: deploy-production | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
|
||
environment: | ||
name: staging | ||
# @TODO - umami.demo.druxtjs.org | ||
url: https://demo.druxtjs.org | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
- name: Configure git | ||
run: | | ||
git config --global user.name 'Deploy workflow' | ||
git config --global user.email "ci@{$GITHUB_HEAD_REF}" | ||
- name: Deploy backend | ||
run: | | ||
git checkout -b production/backend | ||
cp .lagoon.backend.yml .lagoon.yml | ||
git commit -am "chore(ci): add backend lagoon configuration" | ||
git push origin production/backend --force | ||
- name: Sleep | ||
run: sleep 120s | ||
- name: Wait for backend | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
url: 'https://nginx.production-backend.druxtjs-org-demo-umami.au2.amazee.io/jsonapi' | ||
responseCode: 200 | ||
timeout: 600000 | ||
interval: 15000 | ||
|
||
- name: Deploy frontend | ||
run: | | ||
git checkout $GITHUB_HEAD_REF | ||
git checkout -b production/frontend | ||
cp .lagoon.frontend.yml .lagoon.yml | ||
git commit -am "chore(ci): add frontend lagoon configuration" | ||
git push origin production/frontend --force | ||
- name: Wait for frontend | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
url: 'https://demo.druxtjs.org' | ||
responseCode: 200 | ||
timeout: 600000 | ||
interval: 15000 | ||
|
||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: deploy-staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ${{ matrix.os }} | ||
|
||
environment: | ||
name: staging | ||
url: https://app.staging-frontend.druxtjs-org-demo-umami.au2.amazee.io | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [16] | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
- name: Configure git | ||
run: | | ||
git config --global user.name 'Deploy workflow' | ||
git config --global user.email "ci@{$GITHUB_HEAD_REF}" | ||
- name: Deploy backend | ||
run: | | ||
git checkout -b staging/backend | ||
cp .lagoon.backend.yml .lagoon.yml | ||
git commit -am "chore(ci): add backend lagoon configuration" | ||
git push origin staging/backend --force | ||
- name: Sleep | ||
run: sleep 120s | ||
- name: Wait for backend | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
url: 'https://nginx.staging-backend.druxtjs-org-demo-umami.au2.amazee.io/jsonapi' | ||
responseCode: 200 | ||
timeout: 600000 | ||
interval: 15000 | ||
|
||
- name: Deploy frontend | ||
run: | | ||
git checkout $GITHUB_HEAD_REF | ||
git checkout -b staging/frontend | ||
cp .lagoon.frontend.yml .lagoon.yml | ||
cp .env.staging .env | ||
git commit -am "chore(ci): add frontend lagoon configuration" | ||
git push origin staging/frontend --force | ||
- name: Wait for frontend | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
url: 'https://app.staging-frontend.druxtjs-org-demo-umami.au2.amazee.io' | ||
responseCode: 200 | ||
timeout: 600000 | ||
interval: 15000 | ||
|
||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
docker-compose-yaml: docker-compose.backend.yml | ||
|
||
project: druxtjs-org-demo-umami | ||
|
||
tasks: | ||
post-rollout: | ||
- run: | ||
name: drush si | ||
command: drush -y si demo_umami | ||
service: cli | ||
|
||
- run: | ||
name: drush en | ||
command: drush -y en druxt_umami | ||
service: cli | ||
|
||
- run: | ||
name: drush rap | ||
command: drush rap anonymous 'access druxt resources' | ||
service: cli | ||
|
||
- run: | ||
name: drush config:set | ||
command: | | ||
drush config:set druxt_node_preview.settings frontends "Production|https://demo.druxtjs.org/node/preview/[view_mode]#[jsonapi_node_preview]" -y | ||
drush config:set jsonapi.settings read_only 0 -y | ||
service: cli | ||
|
||
- run: | ||
name: drush search-api:index | ||
command: drush search-api:index | ||
service: cli | ||
|
||
- run: | ||
name: drush user:login | ||
command: drush user:login | ||
service: cli | ||
|
||
environments: | ||
main: | ||
routes: | ||
- nginx: | ||
- demo-api.druxtjs.org | ||
cronjobs: | ||
- name: drush cron | ||
schedule: "*/15 * * * *" | ||
command: drush cron | ||
service: cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
docker-compose-yaml: 'docker-compose.frontend.yml' | ||
|
||
project: druxtjs-org-demo-umami | ||
|
||
environments: | ||
main: | ||
routes: | ||
- app: | ||
- demo.druxtjs.org | ||
- storybook: | ||
- storybook.demo.druxtjs.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
version: '2.3' | ||
|
||
x-user: | ||
&default-user | ||
# The default user under which the containers should run. Change this if you are on linux and run with another user than id `1000` | ||
user: '1000' | ||
|
||
services: | ||
cli: | ||
build: | ||
context: . | ||
dockerfile: .docker/Dockerfile.cli | ||
image: &cli-image druxt-umami-cli | ||
labels: | ||
lagoon.type: cli-persistent | ||
lagoon.persistent.name: nginx | ||
lagoon.persistent: /app/web/sites/default/files/ | ||
lando.type: php-cli-drupal | ||
# << : *default-volumes | ||
user: root | ||
volumes_from: ### mount the ssh-agent from the pygmy or cachalot ssh-agent. Automatically removed in CI. | ||
- container:amazeeio-ssh-agent ### Local overrides to mount host SSH keys. Automatically removed in CI. | ||
# environment: | ||
# << : *default-environment # loads the defined environment variables from the top | ||
|
||
nginx: | ||
build: | ||
context: . | ||
dockerfile: .docker/Dockerfile.nginx | ||
args: | ||
CLI_IMAGE: *cli-image # Inject the name of the cli image | ||
labels: | ||
lagoon.type: nginx-php-persistent | ||
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too | ||
lando.type: nginx-drupal | ||
# << : *default-volumes # loads the defined volumes from the top | ||
<< : *default-user # uses the defined user from top | ||
depends_on: | ||
- cli # basically just tells docker-compose to build the cli first | ||
# environment: | ||
# << : *default-environment # loads the defined environment variables from the top | ||
# LAGOON_LOCALDEV_URL: *default-url | ||
networks: | ||
- amazeeio-network | ||
- default | ||
|
||
php: | ||
build: | ||
context: . | ||
dockerfile: .docker/Dockerfile.php | ||
args: | ||
CLI_IMAGE: *cli-image | ||
labels: | ||
lagoon.type: nginx-php-persistent | ||
lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon | ||
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too | ||
lando.type: php-fpm | ||
# << : *default-volumes # loads the defined volumes from the top | ||
# << : *default-user # uses the defined user from top | ||
depends_on: | ||
- cli # basically just tells docker-compose to build the cli first | ||
# environment: | ||
# << : *default-environment # loads the defined environment variables from the top | ||
|
||
mariadb: | ||
image: amazeeiolagoon/mariadb-drupal:pr-892 | ||
labels: | ||
lagoon.type: mariadb | ||
lando.type: mariadb-drupal | ||
ports: | ||
- "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306` | ||
# << : *default-user # uses the defined user from top | ||
# environment: | ||
# << : *default-environment | ||
|
||
networks: | ||
amazeeio-network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '2.3' | ||
|
||
services: | ||
app: | ||
networks: | ||
- amazeeio-network | ||
- default | ||
build: | ||
context: . | ||
dockerfile: .docker/Dockerfile.app | ||
args: | ||
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} | ||
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} | ||
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID} | ||
labels: | ||
lagoon.type: node | ||
lando.type: node | ||
environment: | ||
LAGOON_LOCALDEV_HTTP_PORT: 3000 | ||
LAGOON_ROUTE: http://demo-druxtjs-org.docker.amazee.io | ||
|
||
storybook: | ||
networks: | ||
- amazeeio-network | ||
- default | ||
build: | ||
context: . | ||
dockerfile: .docker/Dockerfile.storybook | ||
args: | ||
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} | ||
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} | ||
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID} | ||
labels: | ||
lagoon.type: node | ||
lando.type: node | ||
environment: | ||
LAGOON_LOCALDEV_HTTP_PORT: 3000 | ||
LAGOON_ROUTE: http://storybook-demo-druxtjs-org.docker.amazee.io | ||
|
||
networks: | ||
amazeeio-network: | ||
external: true |