Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#38): bug fixes #58

Merged
merged 33 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b88ca2b
#38: running ci checks
tholulomo Jan 8, 2022
cee067f
#38: running ci checks
tholulomo Jan 8, 2022
afc299e
#38: running ci checks
tholulomo Jan 8, 2022
9d6e9e0
#38: running ci checks
tholulomo Jan 8, 2022
c023408
#38: running ci checks
tholulomo Jan 8, 2022
63ebd3e
#38: running ci checks
tholulomo Jan 9, 2022
85529b9
#38: running ci checks
tholulomo Jan 9, 2022
cb4c27d
#38: running ci checks
tholulomo Jan 9, 2022
3c94248
#38: running ci checks
tholulomo Jan 9, 2022
01908f6
#38: running ci checks
tholulomo Jan 9, 2022
34fb682
#38: running ci checks
tholulomo Jan 9, 2022
96dc17c
#38: running ci checks
tholulomo Jan 9, 2022
5413fef
#38: running ci checks
tholulomo Jan 9, 2022
be541e3
#38: running ci checks
tholulomo Jan 9, 2022
310c2d1
#38: running ci checks
tholulomo Jan 9, 2022
bb43b1b
#38: running ci checks
tholulomo Jan 9, 2022
bd0522f
#38: running ci checks
tholulomo Jan 9, 2022
29dbd31
#38: running ci checks
tholulomo Jan 9, 2022
e6e8c7f
#38: running ci checks
tholulomo Jan 9, 2022
c6800da
#38: running ci checks
tholulomo Jan 9, 2022
557325a
#38: running ci checks
tholulomo Jan 9, 2022
755268f
#38: running ci checks
tholulomo Jan 9, 2022
576250a
#38: running ci checks
tholulomo Jan 9, 2022
6848448
#38: running ci checks
tholulomo Jan 9, 2022
88e10e4
#38: running ci checks
tholulomo Jan 9, 2022
ee47f93
#38: running ci checks
tholulomo Jan 9, 2022
b2ad7ae
#38: running ci checks
tholulomo Jan 9, 2022
cbbce31
#38: running ci checks
tholulomo Jan 9, 2022
0f7b149
#38: running ci checks
tholulomo Jan 9, 2022
fe26d6a
#38: running ci checks
tholulomo Jan 9, 2022
bcf25e9
#38: running ci checks
tholulomo Jan 9, 2022
fd54902
#38: running ci checks
tholulomo Jan 9, 2022
600255b
#38: running ci checks
tholulomo Jan 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Builder

on:
workflow_call:
inputs:
myid:
required: true
type: string
context:
required: true
type: string
tags:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:
Build:
name: ${{ inputs.myid }}
runs-on: ubuntu-latest
# if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Build ${{ inputs.myid }}
uses: docker/build-push-action@v2
with:
context: ${{ inputs.context }}
push: true
tags: ${{ inputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
134 changes: 0 additions & 134 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
branches: [develop]
push:
branches: [develop]
env:
DCK_USER: ${{ secrets.DOCKERHUB_USERNAME }}
DCK_PWD: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,134 +45,3 @@ jobs:
- run: npm run test
env:
CI: true
# BuildFrontend:
# needs: [test]
# uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@v1
# with:
# id: app
# context: ./app
# tags: dukematsci/dev-app:latest
# secrets:
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
# BuildRESTFUL:
# needs: [test]
# uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@v1
# with:
# id: restful
# context: ./restfulservice
# tags: dukematsci/dev-restful:latest
# secrets:
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
# BuildProxy:
# needs: [test]
# uses: Duke-MatSci/materialsmine/.github/workflows/builder.yml@v1
# with:
# id: proxy
# context: ./nginx
# tags: dukematsci/dev-proxy:latest
# secrets:
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
# TestBuild:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# needs: [BuildFrontend,BuildRESTFUL,BuildProxy]
# steps:
# - name: Status
# run : pwd
# Build:
# runs-on: ubuntu-latest
# outputs:
# initfile: ${{ steps.passinit.output.content }}
# needs: [test]
# # if: github.event_name == 'push'
# steps:
# - uses: actions/checkout@v2
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Cache Docker layers
# uses: actions/cache@v2
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-single-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-single-buildx
# - name: Build Frontend
# id: app-docker_build
# uses: docker/build-push-action@v2
# with:
# context: ./app
# push: true
# tags: dukematsci/dev-app:latest
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new
# - name: Build Restful Service
# needs: [steps.app-docker_build]
# id: restuful-docker_build
# uses: docker/build-push-action@v2
# with:
# context: ./restfulservice
# push: true
# tags: dukematsci/dev-restful:latest
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new
# - name: Build Proxy
# id: proxy-docker_build
# uses: docker/build-push-action@v2
# with:
# context: ./nginx
# push: true
# tags: dukematsci/dev-proxy:latest
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new
# - name: Move cache
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
# - name: Copy Init Shell
# id: passinit
# run: |
# cd mockDB
# echo ::set-output name=content::$(cat mongo-init.sh)
# testBuild:
# runs-on: ubuntu-latest
# env:
# MONGO_INITDB_ROOT_USERNAME: ${{secrets.MM_MONGO_USER}}
# MONGO_INITDB_ROOT_PASSWORD: ${{secrets.MM_MONGO_PWD}}
# MONGO_DEVS: ${{secrets.MONGO_TEST}}
# MONGO_DEV_PWD: ${{secrets.MONGO_TEST_PWD}}
# MM_DB: ${{secrets.MM_DB}}
# needs: [build]
# if: github.event_name == 'push'
# steps:
# - name: Get Init
# run: |
# cd /
# echo ${{ needs.build.output.initfile }} >> mongo-init.sh
# chmod +x mongo-init.sh
# services:
# mongo:
# image: mongo:4.4
# ports:
# - '27017:27017'
# volumes:
# - ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
# proxy:
# image: dukematsci/dev-proxy:latest
# ports:
# - '80:80'
# api:
# image: dukematsci/dev-restful:latest
# env:
# DB_USERNAME: ${MONGO_DEVS}
# DB_PASSWORD: ${MONGO_DEV_PWD}
# client:
# image: dukematsci/dev-app:latest
37 changes: 37 additions & 0 deletions docker-compose.git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3'
services:
mongo:
image: 'mongo:4.4'
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MM_MONGO_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MM_MONGO_PWD}
- MONGO_DEVS=${MONGO_TEST}
- MONGO_DEV_PWD=${MONGO_TEST_PWD}
- MM_DB=${MM_DB}
ports:
- '27017:27017'
volumes:
- ./mockDB/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
proxy:
image: 'dukematsci/dev-proxy:latest'
depends_on:
- api
- client
restart: always
ports:
- '80:80'
api:
image: 'dukematsci/dev-restful:latest'
depends_on:
- mongo
environment:
- DB_USERNAME=${MONGO_TEST}
- DB_PASSWORD=${MONGO_TEST_PWD}
- MM_DB=${MM_DB}
client:
image: 'dukematsci/dev-app:latest'
depends_on:
- api
volumes:
mockDB: