Skip to content

Commit

Permalink
Merge pull request #237 from ComputerScienceHouse/develop
Browse files Browse the repository at this point in the history
Version 3.2.0
  • Loading branch information
devinmatte authored Oct 20, 2020
2 parents fcd1a55 + 755940e commit 84f39ee
Show file tree
Hide file tree
Showing 63 changed files with 604 additions and 333 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Dockerfile
.dockerignore
.gitignore
.nvmrc
node_modules
assets/dist
assets/prod
LICENSE
README.md

5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"commonjs": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"standard"
],
Expand All @@ -16,6 +20,7 @@
},
"rules": {
"no-undef": "off",
"no-var": "warn",
"no-unused-vars": "warn",
"no-prototype-builtins": "warn",
"no-redeclare": "warn",
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ComputerScienceHouse/schedulemaker-maintainers
27 changes: 27 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Node.js Checks

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run typecheck
- run: npm run build
24 changes: 24 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PHP Checks

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs

- name: Check PHP Syntax
run: if find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error, unexpected"; then exit 1; fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package-lock.json

# Ignore built files
assets/prod/*
assets/dist/*
!assets/prod/.gitkeep

# Other files
Expand Down
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

63 changes: 52 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,71 @@
FROM php:7.1-apache
FROM node:10-buster-slim as builder
LABEL author="Devin Matte <[email protected]>"

WORKDIR /usr/src/schedule
COPY package.json ./

RUN npm install

COPY package.json tsconfig.json gulpfile.js ./
COPY assets ./assets
RUN npm run-script build


FROM php:7.3-apache as php-setup
LABEL author="Devin Matte <[email protected]>"

RUN echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list

RUN apt-get -yq update && \
apt-get -yq install gnupg libmagickwand-dev git gcc make autoconf libc-dev pkg-config --no-install-recommends
apt-get -yq install \
gnupg \
libmagickwand-dev \
git \
gcc \
make \
autoconf \
libc-dev \
pkg-config \
build-essential \
libx11-dev \
libxext-dev \
zlib1g-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libxml2-dev \
unzip \
wget \
--no-install-recommends

RUN apt-get -yq build-dep imagemagick

RUN wget https://github.com/ImageMagick/ImageMagick6/archive/6.9.11-22.tar.gz && \
tar -xzvf 6.9.11-22.tar.gz && \
cd ImageMagick6-6.9.11-22 && \
./configure && \
make && \
make install && \
ldconfig /usr/local/lib && \
make check

RUN docker-php-ext-install mysqli && \
yes '' | pecl install imagick && docker-php-ext-enable imagick

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer


FROM php-setup
LABEL author="Devin Matte <[email protected]>"

COPY apache-config.conf /etc/apache2/sites-enabled/000-default.conf

RUN a2enmod rewrite && a2enmod headers && a2enmod expires && \
sed -i '/Listen/{s/\([0-9]\+\)/8080/; :a;n; ba}' /etc/apache2/ports.conf && \
chmod og+rwx /var/lock/apache2 && chmod -R og+rwx /var/run/apache2

COPY . /var/www/html

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get -yq update \
&& apt-get -yq install nodejs --no-install-recommends \
&& npm install \
&& npm run-script build \
&& apt-get -yq remove nodejs \
&& apt-get -yq clean all \
&& rm -rf node_modules
COPY --from=builder /usr/src/schedule/assets/prod /var/www/html/assets/prod

RUN composer install

Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ Available at [schedule.csh.rit.edu](https://schedule.csh.rit.edu)
## Dev Environment

### Setup
- Fork and clone the repository
- Copy the `config.example.php` file to `config.php` in `/inc/` or set environment variables as defined in `config.env.php`
- Contact a current maintainer for server/database configs
- If you wish to see images locally, you will also need S3 credentials, either supply your own or reach out
- Fork and clone the repository.
- Copy the `config.example.php` file to `config.php` in `/inc/` or set environment variables as defined in `config.env.php`.
- Contact a current maintainer for server/database configs.
- If you wish to see images locally, you will also need S3 credentials, either supply your own or reach out.

### Run Locally
In order to run locally youre going to need [docker](https://www.docker.com/)
In order to run locally youre going to need [docker](https://www.docker.com/).

```
docker build -t schedulemaker .
docker run --rm -i -t -p 5000:8080 --name=schedulemaker schedulemaker
```

You can replace `5000` with whatever port you wish to connect locally to. Then visit `http://localhost:5000` in a browser
You can replace `5000` with whatever port you wish to connect locally to. Then visit `http://localhost:5000` in a browser.

### Development
- To build js files run `npm run-script build`
- Increment the version number in `package.json` after updating js/css files or ensure all cache cleared
- Make sure you increment at least the patch number in any PRs that touch Javascript/CSS
- To build js files run `npm run-script build`.
- Increment the version number in `package.json` after updating js/css files or ensure all cache cleared.
- Make sure you increment at least the patch number in any PRs that touch Javascript/CSS.
- If you get an error with JS/CSS not loading, check your config file.

## Maintainers

Expand All @@ -44,4 +45,4 @@ You can replace `5000` with whatever port you wish to connect locally to. Then v

#### Past Maintainers
- Ben Grawi ([@bgrawi](https://github.com/bgrawi))
- Benjamin Russell ([@benrr101](https://github.com/benrr101))
- Benjamin Russell ([@benrr101](https://github.com/benrr101))
Loading

0 comments on commit 84f39ee

Please sign in to comment.