Commit e3a2e62b authored by Zack Wong's avatar Zack Wong
Browse files

Merge branch 'devops/21-use-test-ad' into 'master'

Devops/21 use test ad

See merge request frekk/uccportal!11
parents 2da3dade 191b59a8
......@@ -18,31 +18,40 @@ run_tests:
- echo "Running tests"
- envsubst < src/gms/settings_local.example.py > src/gms/settings_local.py
- python src/manage.py check
only:
- /^.*-test(ing)?$/
- /^(test|devops)\/.*$/
- master
deploy_testing:
stage: deploy
tags:
- test
variables:
DB_NAME : /var/www/test/$CI_COMMIT_REF_NAME/.db/members.db
DEPLOY_HOST : $CI_COMMIT_REF_NAME.test.ucc.asn.au
AD_DOMAIN : ad.v.ucc.asn.au
AD_BASEDN : DC=AD,DC=v,DC=ucc,DC=asn,DC=AU
DB_NAME : /var/www/test/$CI_COMMIT_REF_SLUG/.db/members.db
DEPLOY_HOST : $CI_COMMIT_REF_SLUG.test.ucc.asn.au
SHORT_ENV_NAME : TEST
script:
- echo "Deploy to test"
- rm -f /var/www/test/$CI_COMMIT_REF_NAME
- rm -f /etc/uwsgi/vassals/$CI_COMMIT_REF_NAME.ini
- rm -f /var/www/test/$CI_COMMIT_REF_SLUG
- rm -f /etc/uwsgi/vassals/$CI_COMMIT_REF_SLUG.ini
- mkdir .db
- envsubst < src/gms/settings_local.example.py > src/gms/settings_local.py
- chmod 600 src/gms/settings_local.py
- ln -srT ./ /var/www/test/$CI_COMMIT_REF_NAME
- ln -srT ./ /var/www/test/$CI_COMMIT_REF_SLUG
- python src/manage.py collectstatic
- python src/manage.py makemigrations
- python src/manage.py migrate --run-syncdb
- ln -s /etc/uwsgi/vassals/test.skel /etc/uwsgi/vassals/$CI_COMMIT_REF_NAME.ini
- ln -s /etc/uwsgi/vassals/test.skel /etc/uwsgi/vassals/$CI_COMMIT_REF_SLUG.ini
environment:
name: test/$CI_COMMIT_REF_NAME
url: https://$CI_COMMIT_REF_NAME.test.ucc.asn.au
name: test/$CI_COMMIT_REF_SLUG
url: https://$CI_COMMIT_REF_SLUG.test.ucc.asn.au
on_stop: stop_testing
only:
- /^.*-test(ing)?$/
- /^(test|devops)\/.*$/
except:
- master
- merge_requests
......@@ -52,6 +61,8 @@ deploy_staging:
tags:
- stage
variables:
AD_DOMAIN : ad.v.ucc.asn.au
AD_BASEDN : DC=AD,DC=v,DC=ucc,DC=asn,DC=AU
DB_NAME : /var/www/stage/.db/members.db
DEPLOY_HOST : stage.test.ucc.asn.au
SHORT_ENV_NAME : STAGE
......@@ -78,10 +89,13 @@ stop_testing:
GIT_STRATEGY: none
when: manual
environment:
name: test/$CI_COMMIT_REF_NAME
name: test/$CI_COMMIT_REF_SLUG
action: stop
only:
- /^.*-test(ing)?$/
- /^(test|devops)\/.*$/
except:
- master
script:
- rm -f /var/www/test/$CI_COMMIT_REF_NAME
- rm -f /etc/uwsgi/vassals/$CI_COMMIT_REF_NAME.ini
- rm -f /var/www/test/$CI_COMMIT_REF_SLUG
- rm -f /etc/uwsgi/vassals/$CI_COMMIT_REF_SLUG.ini
uccportal - the UCC Computer Controlled Proletarian Organisational Roster That Accesses LDAP [was GMS - Gumby Management System]
================================================================================================================================
[![pipeline status](https://gitlab.ucc.asn.au/frekk/uccportal/badges/master/pipeline.svg)](https://gitlab.ucc.asn.au/frekk/uccportal/commits/master)
This is designed to be the ultimate membership management suite for UCC. Signups are electronic and automatic, data is able to be conveniently stored in the member database and some of it is even automatically validated.
......@@ -185,4 +186,4 @@ from the Actions menu.
Credits
-------
- Adapted from `Gumby Management System` written by David Adam <[email protected]>
- Derived from MemberDB by Danni Madeley
\ No newline at end of file
- Derived from MemberDB by Danni Madeley
......@@ -49,7 +49,7 @@ from django_auth_ldap.config import LDAPSearch, ActiveDirectoryGroupType, LDAPGr
# this could be ad.ucc.gu.uwa.edu.au but that doesn't resolve externally -
# useful for testing, but should be changed in production so failover works
AUTH_LDAP_SERVER_URI = 'ldaps://ad.ucc.gu.uwa.edu.au'
AUTH_LDAP_SERVER_URI = 'ldaps://${AD_DOMAIN}'
# This is also a bad idea, should be changed in production
AUTH_LDAP_GLOBAL_OPTIONS = {
......@@ -57,7 +57,7 @@ AUTH_LDAP_GLOBAL_OPTIONS = {
}
# LDAP admin settings - NOT for django_auth_ldap
LDAP_BASE_DN = "DC=ad,DC=ucc,DC=gu,DC=uwa,DC=edu,DC=au"
LDAP_BASE_DN = '${AD_BASEDN}'
LDAP_USER_SEARCH_DN = 'CN=Users,' + LDAP_BASE_DN
# settings used by memberdb LDAP backend and django_auth_ldap
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment