Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
khazelton authored Apr 4, 2019
1 parent 78a371e commit 99ad4b8
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Sources/SIS/db_migrate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
#
# rake.sh, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@doit.wisc.edu>
docker exec -it tier-sis-web /myapp/bin/rake db:migrate
19 changes: 19 additions & 0 deletions Sources/SIS/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
sis-db:
image: mysql:5.6
container_name: tier-demo-mysql
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
sis-web:
build: .
image: sis-web
container_name: tier-sis-web
command: /bin/bash /usr/local/bin/run-rails.sh
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- sis-db
45 changes: 45 additions & 0 deletions Sources/SIS/gen_seed_ldap.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/perl -w
#
# gen_seed.pl, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@wisc.edu>

use vars qw/$VERSION $FILE/;
($VERSION) = q$Revision: 1.1 $ =~ /([\d.]+)/;
($FILE) = q$RCSfile: gen_seed.pl,v $ =~ /^[^:]+: ([^\$]+),v $/;

use strict;

while (<>) {
chomp;
my ($uid,$fname,$lname,$email,$pwd) = split(/,/);
my $base = "ou=people,dc=example,dc=edu";

print "dn: uid=$uid,$base\n";
print "objectclass: organizationalPerson\n";
print "objectclass: person\n";
print "objectclass: top\n";
print "objectclass: inetOrgPerson\n";
print "objectclass: eduPerson\n";
print "givenName: $fname\n";
print "uid: $uid\n";
print "sn: $lname\n";
print "cn: $fname $lname\n";
print "userPassword: $pwd\n";
print "\n";


}
19 changes: 19 additions & 0 deletions Sources/SIS/gen_skeleton.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
#
# gen_app.sh, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@doit.wisc.edu>
docker-compose run web rails new . --force --database=mysql
22 changes: 22 additions & 0 deletions Sources/SIS/restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
#
# restart.sh, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@doit.wisc.edu>
docker-compose down
rm tmp/pids/server.pid
#docker-compose build
docker-compose up
29 changes: 29 additions & 0 deletions Sources/SIS/run-rails.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
set -x

# Is MySQL available?
until nc -vz tier-demo-mysql 3306
do
echo "MySQL is unavailable - sleeping"
sleep 1
done
echo "MySQL is up!"

# Is this the containers first run?
# if so...bootstrap it.
# TODO: determine what happens if mysql container is not on its first run.
if [ -e /FIRSTRUN ]
then
rake db:create \
&& rake db:migrate \
&& rake db:seed \
&& rm -fv /FIRSTRUN
fi

# Do not start if we did not bootstrap
if [ ! -f /FIRSTRUN ]
then
bundle exec rails s -p 3000 -b '0.0.0.0'
else
echo "Bootstrap was not completed. Not starting..."
fi
21 changes: 21 additions & 0 deletions Sources/SIS/scaffold_course.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#
# scaffold_user.sh, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@wisc.edu>
docker-compose run web rails generate scaffold course \
course_name:string \
course_number:string
28 changes: 28 additions & 0 deletions Sources/SIS/scaffold_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
#
# scaffold_user.sh, DESCRIPTION
#
# Copyright (C) 2017 Tom Jordan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Id:$
# Tom Jordan <tom.jordan@wisc.edu>
docker exec -it tier-sis-web rails generate scaffold user \
uid:string \
givenname:string \
surname:string \
fullName:string \
lfname:string \
description:string \
email:string \
password:string \
--force
103 changes: 103 additions & 0 deletions Sources/SIS/users.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
tjordan,Tom,Jordan,tom.jordan@wisc.edu,12345
jjminer,Jon,Miner,jon.miner@wisc.edu,12345
jbabb,James,Babb,james.babb@wisc.edu,12345
rdavis805,Robert,Davis,rdavis805@example.edu,12345
kbrown599,Karl,Brown,kbrown599@example.edu,12345
dmorrison676,David,Morrison,dmorrison676@example.edu,12345
jwalters336,James,Walters,jwalters336@example.edu,12345
broberts,Bill,Roberts,broberts@example.edu,12345
manderson752,Michael,Anderson,manderson752@example.edu,12345
wmartinez,William,Martinez,wmartinez@example.edu,12345
escott,Eric,Scott,escott@example.edu,12345
kgonazles778,Karoline,Gonazles,kgonazles778@example.edu,12345
mprice775,Michael,Price,mprice775@example.edu,12345
hwhite640,Heather,White,hwhite640@example.edu,12345
bgrady,Betty,Grady,bgrady@example.edu,12345
jdoe,James,Doe,jdoe@example.edu,12345
dlangenberg61,Donna,Langenberg,dlangenberg61@example.edu,12345
lroberts776,Lori,Roberts,lroberts776@example.edu,12345
mlewis,Michael,Lewis,mlewis@example.edu,12345
ganderson555,Greg,Anderson,ganderson555@example.edu,12345
ldavis540,Lisa,Davis,ldavis540@example.edu,12345
cdavis900,Colin,Davis,cdavis900@example.edu,12345
bwhite551,Bill,White,bwhite551@example.edu,12345
jclark826,Jennifer,Clark,jclark826@example.edu,12345
jhenderson,John,Henderson,jhenderson@example.edu,12345
tprice,Thomas,Price,tprice@example.edu,12345
tbrown767,Thomas,Brown,tbrown767@example.edu,12345
ewalters,Erik,Walters,ewalters@example.edu,12345
bmorrison655,Betty,Morrison,bmorrison655@example.edu,12345
mgasper,Mary,Gasper,mgasper@example.edu,12345
lmartinez,Lori,Martinez,lmartinez@example.edu,12345
ethompson628,Erik,Thompson,ethompson628@example.edu,12345
mwhite227,Marie,White,mwhite227@example.edu,12345
tgasper854,Thomas,Gasper,tgasper854@example.edu,12345
lhenderson949,Lisa,Henderson,lhenderson949@example.edu,12345
rbutler,Robert,Butler,rbutler@example.edu,12345
banderson971,Betty,Anderson,banderson971@example.edu,12345
jlewis917,James,Lewis,jlewis917@example.edu,12345
lwalters703,Lori,Walters,lwalters703@example.edu,12345
mprice764,Marie,Price,mprice764@example.edu,12345
lwilliams,Lisa,Williams,lwilliams@example.edu,12345
amorrison30,Ann,Morrison,amorrison30@example.edu,12345
plee719,Paul,Lee,plee719@example.edu,12345
klopez326,Kiersten,Lopez,klopez326@example.edu,12345
nlangenberg820,Nancy,Langenberg,nlangenberg820@example.edu,12345
klewis712,Karl,Lewis,klewis712@example.edu,12345
dclark720,Donna,Clark,dclark720@example.edu,12345
jjohnson735,Jennifer,Johnson,jjohnson735@example.edu,12345
bwhite,Blake,White,bwhite@example.edu,12345
jdavis904,Jo,Davis,jdavis904@example.edu,12345
jwhite265,James,White,jwhite265@example.edu,12345
edavis809,Eric,Davis,edavis809@example.edu,12345
swalters,Sarah,Walters,swalters@example.edu,12345
svales,Sarah,Vales,svales@example.edu,12345
mgonazles,Michael,Gonazles,mgonazles@example.edu,12345
kwalters,Karl,Walters,kwalters@example.edu,12345
bwalters,Betty,Walters,bwalters@example.edu,12345
jbutler545,Jennifer,Butler,jbutler545@example.edu,12345
jdoe780,Jo,Doe,jdoe780@example.edu,12345
abrown,Ann,Brown,abrown@example.edu,12345
ggasper836,Greg,Gasper,ggasper836@example.edu,12345
emartinez,Erik,Martinez,emartinez@example.edu,12345
jprice340,John,Price,jprice340@example.edu,12345
bgrady203,Bill,Grady,bgrady203@example.edu,12345
kwhite283,Kim,White,kwhite283@example.edu,12345
blee483,Betty,Lee,blee483@example.edu,12345
wdavis,William,Davis,wdavis@example.edu,12345
egasper497,Erik,Gasper,egasper497@example.edu,12345
mwhite,Mark,White,mwhite@example.edu,12345
dbrown,David,Brown,dbrown@example.edu,12345
nlee,Nancy,Lee,nlee@example.edu,12345
sdavis,Sarah,Davis,sdavis@example.edu,12345
cwalters,Colin,Walters,cwalters@example.edu,12345
nwalters,Nancy,Walters,nwalters@example.edu,12345
kdoe490,Kim,Doe,kdoe490@example.edu,12345
wscott,William,Scott,wscott@example.edu,12345
nwilliams,Nancy,Williams,nwilliams@example.edu,12345
dbrown739,David,Brown,dbrown739@example.edu,12345
wlopez,William,Lopez,wlopez@example.edu,12345
mhenderson959,Mark,Henderson,mhenderson959@example.edu,12345
khenderson874,Karoline,Henderson,khenderson874@example.edu,12345
rdavis,Robert,Davis,rdavis@example.edu,12345
plopez,Paul,Lopez,plopez@example.edu,12345
kjohnson,Kiersten,Johnson,kjohnson@example.edu,12345
ksmith708,Karl,Smith,ksmith708@example.edu,12345
dlewis327,David,Lewis,dlewis327@example.edu,12345
mdavis897,Michael,Davis,mdavis897@example.edu,12345
mmorrison,Mark,Morrison,mmorrison@example.edu,12345
wwhite,William,White,wwhite@example.edu,12345
klopez520,Karoline,Lopez,klopez520@example.edu,12345
jlangenberg373,James,Langenberg,jlangenberg373@example.edu,12345
dpeterson613,David,Peterson,dpeterson613@example.edu,12345
mdoe270,Michael,Doe,mdoe270@example.edu,12345
wwilliams808,William,Williams,wwilliams808@example.edu,12345
mvales501,Marie,Vales,mvales501@example.edu,12345
ppeterson,Paul,Peterson,ppeterson@example.edu,12345
ldavis,Lori,Davis,ldavis@example.edu,12345
bgasper28,Bill,Gasper,bgasper28@example.edu,12345
bprice745,Betty,Price,bprice745@example.edu,12345
ddoe,Donna,Doe,ddoe@example.edu,12345
lvales817,Lisa,Vales,lvales817@example.edu,12345
wthompson675,William,Thompson,wthompson675@example.edu,12345
landerson906,Lori,Anderson,landerson906@example.edu,12345

0 comments on commit 99ad4b8

Please sign in to comment.