Skip to content

Commit

Permalink
Initial commit from boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 4, 2023
0 parents commit b9816b8
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .dockworker/deployment/k8s/testing/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mongodb
appMajor: "5"
instance: unbgeology.mongodb.lib.unb.ca
tier: database
uri: unbgeology.mongodb.lib.unb.ca
vcsOwner: unb-libraries
vcsRepository: unbgeology.mongodb.lib.unb.ca
vcsRef: testing
name: unbgeology-mongodb-lib-unb-ca
namespace: testing
spec:
selector:
matchLabels:
uri: unbgeology.mongodb.lib.unb.ca
replicas: 1
revisionHistoryLimit: 0
strategy:
type: Recreate
template:
metadata:
labels:
app: mongodb
appMajor: "5"
instance: unbgeology.mongodb.lib.unb.ca
tier: database
uri: unbgeology.mongodb.lib.unb.ca
vcsOwner: unb-libraries
vcsRepository: unbgeology.mongodb.lib.unb.ca
vcsRef: testing
spec:
nodeSelector:
deployenv: prod
containers:
-
env:
-
name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongodb
key: root-username
-
name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongodb
key: root-password
image: "||DEPLOYMENTIMAGE||"
imagePullPolicy: Always
name: unbgeology-mongodb-lib-unb-ca
ports:
-
containerPort: 27017
name: mongodb
volumeMounts:
-
mountPath: /data/db
name: mongodb-persistent-storage
priorityClassName: vip-support
imagePullSecrets:
-
name: github-container-registry-auth
restartPolicy: Always
volumes:
-
name: mongodb-persistent-storage
persistentVolumeClaim:
claimName: unbgeology-mongodb-lib-unb-ca
24 changes: 24 additions & 0 deletions .dockworker/dockworker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dockworker:
version: '5'
application:
name: unbgeology.mongodb.lib.unb.ca
finish_marker: 'Waiting for connections'
project_prefix: IN
upstream_images:
- mongo:5.0
uuid: 3512
deployment:
environments:
- testing
workflow:
source: dockworker
type: deployment-workflow
github:
repo: unbgeology.mongodb.lib.unb.ca
owner: unb-libraries
image:
push_branches:
- testing
name: ghcr.io/unb-libraries/unbgeology.mongodb.lib.unb.ca
date_tag_image: true
repository: ghcr
21 changes: 21 additions & 0 deletions .github/workflows/deployment-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: unbgeology.mongodb.lib.unb.ca

on:
pull_request:
push:
workflow_dispatch:

jobs:
deploy:
uses: unb-libraries/dockworker/.github/workflows/deployment-workflow.yaml@5.x
with:
deploy-branches: '["testing"]'
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 }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitkeep
vendor
composer.lock
config-yml/.htaccess
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mongo:6.0
MAINTAINER UNB Libraries <libsupport@unb.ca>

ENV TZ America/Moncton

COPY ./build /build

# CMD ["--config", "/build/conf/mongod.custom.conf"]

LABEL ca.unb.lib.generator="mongodb" \
com.microscaling.docker.dockerfile="/Dockerfile" \
com.microscaling.license="MIT" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="unbgeology.mongodb.lib.unb.ca is the mongodb application serving drupal instances at UNB Libraries." \
org.label-schema.name="unbgeology.mongodb.lib.unb.ca" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/unb-libraries/unbgeology.mongodb.lib.unb.ca" \
org.label-schema.vendor="University of New Brunswick Libraries" \
org.label-schema.version=$VERSION \
org.opencontainers.image.source="https://github.com/unb-libraries/unbgeology.mongodb.lib.unb.ca"
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2018 University of New Brunswick Libraries

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# [unbgeology.mongodb.lib.unb.ca](https://unbgeology.mongodb.lib.unb.ca/) : Lean Instance Repository
[![Build Status](https://github.com/unb-libraries/unbgeology.mongodb.lib.unb.ca/actions/workflows/deployment-workflow.yaml/badge.svg?branch=prod)](https://github.com/unb-libraries/unbgeology.mongodb.lib.unb.ca/actions/workflows/deployment-workflow.yaml)
[![GitHub license](https://img.shields.io/github/license/unb-libraries/unbgeology.mongodb.lib.unb.ca)](https://github.com/unb-libraries/unbgeology.mongodb.lib.unb.ca/blob/prod/LICENSE)
![GitHub repo size](https://img.shields.io/github/repo-size/unb-libraries/unbgeology.mongodb.lib.unb.ca?label=lean%20repo%20size)

This repository contains the assets used to test, build, and deploy the unbgeology.mongodb.lib.unb.ca application.

## Deploy this Application Yourself!
Local deployment, development and testing of unbgeology.mongodb.lib.unb.ca is easy, as we leverage [dockworker](https://github.com/unb-libraries/dockworker), our unified framework of [Robo](https://robo.li/) commands that streamline local development of our application on Linux or OSX.

### Step 1: Install Dockworker's Dependencies
In your local development environment, a minimal number of 'one time' dependencies are required to deploy applications with dockworker. Some or all of these may already be installed in your environment; see the list of dependencies and installation instructions [here](https://github.com/unb-libraries/dockworker/blob/4.x/docs/prerequisites.md).

### Step 2: Deploy
With all dependencies installed, you are ready to deploy any of our applications locally and and begin development:

```
composer install
vendor/bin/dockworker deploy
```

And that's it! The application will build and deploy in your local environment.

If you work with unb-libraries applications often, you may also consider [installing a dockworker alias](https://gist.github.com/JacobSanford/1448fece856be371060d0f16ccb1b194), which avoids referencing vendor/bin for each dockworker command.

## Other useful commands
Run ```vendor/bin/dockworker``` to list available dockworker commands for this application.

## Author / Contributors
This application was created at [![UNB Libraries](https://github.com/unb-libraries/assets/raw/master/unblibbadge.png "UNB Libraries")](https://lib.unb.ca) by the following humans:

<a href="https://github.com/JacobSanford"><img src="https://github.com/avatars/u/244894?v=3" title="Jacob Sanford" width="128" height="128"></a>

## License
- As part of our 'open' ethos, UNB Libraries licenses its applications and workflows to be freely available to all whenever possible.
- Consequently, the contents of this repository [unb-libraries/unbgeology.mongodb.lib.unb.ca] are licensed under the [MIT License](http://opensource.org/licenses/mit-license.html). This license explicitly excludes:
- Any website content, which remains the exclusive property of its author(s).
- The UNB logo and any of the associated suite of visual identity assets, which remains the exclusive property of the University of New Brunswick.
4 changes: 4 additions & 0 deletions build/conf/mongod.custom.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"preferred-install": {
"*": "dist"
}
},
"description": "Scaffold and provision local development for unbgeology.mongodb.lib.unb.ca",
"license": "MIT",
"minimum-stability": "dev",
"name": "unb-libraries/unbgeology.mongodb.lib.unb.ca",
"prefer-stable": true,
"require-dev": {
"unb-libraries/dockworker-mongodb": "^5"
},
"scripts": {
"post-update-cmd": [
"vendor/bin/dockworker dockworker:git:setup-hooks"
]
}
}
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
unbgeology.mongodb.lib.unb.ca:
build:
context: .
env_file:
- ./env/mongodb.env
restart: unless-stopped
container_name: unbgeology.mongodb.lib.unb.ca
expose:
- "27017"
volumes:
- mongodb-data:/var/lib/mongodb
volumes:
mongodb-data:
4 changes: 4 additions & 0 deletions env/mongodb.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Local-only development mongodb environment settings. These are not applied
# to production.
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=root

0 comments on commit b9816b8

Please sign in to comment.