forked from PIH/docker-openmrs-server
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI/CD Pipeline and iSantePlus Version Bump (#14)
* Updated CI/CD * Fix * Port fix * Port fix * Fix * Cache added * Cache added * Cache added * fix * fix * fix * Db fix * fixed isanteplus wait * fixed isanteplus wait * fixed isanteplus wait * fixed isanteplus wait * fixed isanteplus wait * Fixed isanteplus wait * Fixed isanteplus wait * Fix * Fix * Update docker-compose.yaml * Fixes * Fixes * Fixes * Fix * Bumped iSantePlus Distro Version * Fix * DB update * Updated README.md
- Loading branch information
Showing
11 changed files
with
232 additions
and
229 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,96 @@ | ||
# For every commit or tag that is pushed, but image from it and push this to docker hub | ||
|
||
name: CI/CD | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: [published] | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
deploy: | ||
name: CI/CD | ||
runs-on: ubuntu-latest | ||
env: | ||
USERNAME: ${{ secrets.RELEASE_USERNAME }} | ||
TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
steps: | ||
- | ||
name: Checkout code | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false | ||
tags: ghcr.io/isanteplus/docker-isanteplus-server:ci | ||
load: true | ||
build-args: | | ||
USERNAME=${{ github.actor }} | ||
TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
cache-from: type=inline,ref=user/app:buildcache | ||
cache-to: type=inline,ref=user/app:buildcache,mode=max | ||
|
||
- name: Pull containers | ||
run: docker-compose pull qa chrome mysql | ||
|
||
- name: Cache containers | ||
uses: satackey/action-docker-layer-caching@v0.0.11 | ||
continue-on-error: true | ||
|
||
- name: Start core containers | ||
run: docker-compose up -d isanteplus mysql chrome | ||
|
||
- name: Wait For OpenMRS | ||
run: docker-compose up --exit-code-from wait wait | ||
|
||
- name: Show iSantePlus Logs | ||
run: docker-compose logs isanteplus | ||
|
||
- name: Run Basic API Tests (https://www.postman.com/itechuw/workspace/haiti-sedish/collection/1525496-192e3c9f-caea-4056-8077-b67af442f01c) | ||
env: | ||
POSTMAN_COLLECTION: https://www.getpostman.com/collections/22647ce67595a103f9c1 | ||
|
||
run: docker-compose up --exit-code-from newman newman | ||
|
||
- name: Run iSantePlus QA Framework (https://github.com/IsantePlus/isanteplus-qaframework) | ||
run: docker-compose up --exit-code-from qa qa | ||
continue-on-error: true | ||
|
||
- name: Publish Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
build-args: | | ||
USERNAME=${{ github.actor }} | ||
TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=inline,ref=user/app:buildcache | ||
cache-to: type=inline,ref=user/app:buildcache,mode=max |
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 @@ | ||
{ | ||
"name": "ci", | ||
"values": [ | ||
{ | ||
"key": "isanteplus-url", | ||
"value": "http://isanteplus:8080", | ||
"enabled": true | ||
} | ||
], | ||
"_postman_variable_scope": "environment" | ||
} |
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
This file was deleted.
Oops, something went wrong.
Empty file.
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,62 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This is a pre-configuration for Docker MySQL to allow BinLog and replication necessary configurations for Debezium to work | ||
# see ./openmrs-compose.yaml | ||
# REF: https://github.com/debezium/debezium/blob/master/debezium-connector-mysql/src/test/docker/server-gtids/my.cnf | ||
|
||
# For advice on how to change settings please see | ||
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html | ||
|
||
[mysqld] | ||
# | ||
# Remove leading # and set to the amount of RAM for the most important data | ||
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. | ||
# innodb_buffer_pool_size = 128M | ||
# | ||
# Remove leading # to turn on a very important data integrity option: logging | ||
# changes to the binary log between backups. | ||
# log_bin | ||
# | ||
# Remove leading # to set options mainly useful for reporting servers. | ||
# The server defaults are faster for transactions and fast SELECTs. | ||
# Adjust sizes as needed, experiment to find the optimal values. | ||
# join_buffer_size = 128M | ||
# sort_buffer_size = 2M | ||
# read_rnd_buffer_size = 2M | ||
skip-host-cache | ||
skip-name-resolve | ||
datadir=/var/lib/mysql-no-volume | ||
#socket=/var/lib/mysql/mysql.sock | ||
#secure-file-priv=/var/lib/mysql-files | ||
user=mysql | ||
|
||
# Disabling symbolic-links is recommended to prevent assorted security risks | ||
symbolic-links=0 | ||
|
||
#log-error=/var/log/mysqld.log | ||
#pid-file=/var/run/mysqld/mysqld.pid | ||
|
||
# ---------------------------------------------- | ||
# Enable the binlog for replication & CDC | ||
# ---------------------------------------------- | ||
|
||
# Enable binary replication log and set the prefix, expiration, and log format. | ||
# The prefix is arbitrary, expiration can be short for integration tests but would | ||
# be longer on a production system. Row-level info is required for ingest to work. | ||
# Server ID is required, but this will vary on production systems | ||
server-id = 223344 | ||
log_bin = mysql-bin | ||
expire_logs_days = 1 | ||
binlog_format = row |
Oops, something went wrong.