Skip to content

Commit

Permalink
DOCKW-70 Convert to dockworker 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 10, 2024
1 parent 0ab14fc commit b2b6bf8
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 168 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore everything
*

# Allow files and folders with a pattern starting with !
!Dockerfile
!build
66 changes: 0 additions & 66 deletions .dockworker/deployment/k8s/dev/deployment.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions .dockworker/deployment/k8s/prod/deployment.yaml

This file was deleted.

70 changes: 48 additions & 22 deletions .dockworker/dockworker.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
dockworker:
version: '5'
version: '6'
application:
name: drupal.mysql.lib.unb.ca
finish_marker: 'mysqld: ready for connections'
project_prefix: IN
upstream_images:
- mysql:5.7
uuid: 3503
deployment:
environments:
name: Mysql Instance for Drupal Applications at UNB Libraries
uri: https://drupal.mysql.lib.unb.ca
description: >
A Mysql instance for use with Drupal applications at UNB Libraries.
topics:
- mysql
- drupal
identifiers:
id: drupal.mysql.lib.unb.ca
slug: drupal-mysql-lib-unb-ca
short_slug: drupmysql
uuid: 3503
framework:
name: Mysql
version: 7
startup_finished_marker: 'mysqld: ready for connections'
endpoint:
name: http
port: 3306
readiness_timeout: 15
license:
license: MIT
holder: University of New Brunswick Libraries
shell:
path: /bin/sh
endpoints:
env:
- dev
- prod
workflow:
source: dockworker
type: deployment-workflow
github:
repo: drupal.mysql.lib.unb.ca
owner: unb-libraries
image:
push_branches:
- dev
- prod
name: ghcr.io/unb-libraries/drupal.mysql.lib.unb.ca
date_tag_image: true
repository: ghcr
deployments:
drupal-mysql-lib-unb-ca:
default: true
managed: true
name: drupal-mysql-lib-unb-ca
workflows:
vcs:
type: github
owner: unb-libraries
name: drupal.mysql.lib.unb.ca
jira:
project_keys:
- IN
image:
name: ghcr.io/unb-libraries/drupal.mysql.lib.unb.ca
parent: mysql:5.7
repository: GitHub
push-branches:
- dev
- prod
31 changes: 31 additions & 0 deletions .dockworker/src/Robo/Plugin/Commands/MysqlDeployCommands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Dockworker\Robo\Plugin\Commands;

use Dockworker\DockworkerDaemonCommands;

/**
* Provides commands for building and deploying the Mysql application.
*/
class MysqlDeployCommands extends DockworkerDaemonCommands
{
/**
* Provides error log trigers and exceptions for the mysql application.
*
* @hook on-event dockworker-logs-errors-exceptions
*
* @return mixed[]
* The error log exceptions.
*/
public function provideErrorLogConfiguration(): array
{
return [
[],
array_values(
[
'Warning, not an error.' => 'as time zone. Skipping it.',
]
),
];
}
}
19 changes: 10 additions & 9 deletions .github/workflows/deployment-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: drupal.mysql.lib.unb.ca
name: Deploy drupal.mysql.lib.unb.ca

on:
pull_request:
Expand All @@ -7,15 +7,16 @@ on:

jobs:
deploy:
uses: unb-libraries/dockworker/.github/workflows/deployment-workflow.yaml@5.x
uses: unb-libraries/dockworker/.github/workflows/build-push-deploy-notify.yaml@6.x
with:
branch-env-map: '{"dev":"dev","prod":"prod"}'
build-themes: false
deploy-branches: '["dev","prod"]'
image-name: 'ghcr.io/unb-libraries/drupal.mysql.lib.unb.ca'
k8s-deployment-name: 'drupal-mysql-lib-unb-ca'
push-branches: '["dev","prod"]'
secrets:
DOCKER_CLOUD_ACCESS_TOKEN: ${{ secrets.DOCKER_CLOUD_ACCESS_TOKEN }}
DOCKER_CLOUD_USER_NAME: ${{ secrets.DOCKER_CLOUD_USER_NAME }}
GH_CONTAINER_REGISTRY_TOKEN: ${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}
GH_CONTAINER_REGISTRY_USER: ${{ secrets.GH_CONTAINER_REGISTRY_USER }}
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
NEW_RELIC_ACCOUNT_ID: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GH_CONTAINER_REGISTRY_USER: ${{ secrets.GH_CONTAINER_REGISTRY_USER }}
GH_CONTAINER_REGISTRY_TOKEN: ${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }}
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
},
"preferred-install": {
"*": "dist"
Expand All @@ -13,11 +14,16 @@
"name": "unb-libraries/drupal.mysql.lib.unb.ca",
"prefer-stable": true,
"require-dev": {
"unb-libraries/dockworker-mysql": "^5"
"unb-libraries/dockworker-daemon": "^6"
},
"autoload": {
"psr-4": {
"Dockworker\\": ".dockworker/src"
}
},
"scripts": {
"post-update-cmd": [
"vendor/bin/dockworker dockworker:git:setup-hooks"
"vendor/bin/dockworker git:setup-hooks"
]
}
}
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
services:
drupal.mysql.lib.unb.ca:
drupal-mysql-lib-unb-ca:
build:
context: .
command: mysqld --skip-name-resolve --max_allowed_packet=64M
env_file:
- ./env/mysql.env
restart: unless-stopped
container_name: drupal.mysql.lib.unb.ca
container_name: drupal-mysql-lib-unb-ca
expose:
- "3306"
ports:
- "3503:3306"
volumes:
- mysql-data:/var/lib/mysql
volumes:
Expand Down

0 comments on commit b2b6bf8

Please sign in to comment.