jrjohnson
jrjohnson-ucsf
jon.johnson@ucsf.edu
https://www.jrjohnson.dev
-Stefan Topfstedt, 2014
/** * Written because slice() is dysfunctional with associative arrays. * * @return a deep copy of the associative array (the returned array is its own unique * Array instance, and the objects in the array have clone() called on them - * so they must implement that). If originalArray is null, null is returned. */ilios.utilities.deepCloneAssociativeArray = function (originalArray) { var rhett = null; if (originalArray != null) { rhett = new Array(); for (var key in originalArray) { rhett[key] = originalArray[key].clone(); rhett.length++; } } return rhett;};
Ilios is a curriculum management platform for the Health Professions educational community. It is a user-friendly, flexible, and robust web application. Ilios collects, manages, analyzes, and delivers curricular information.
Built by and for the health professions, Ilios supports the sharing of curriculum outcomes and materials among programs, departments, schools and institutions, while maintaining the flexibility to accommodate the unique practices within our diverse health professions community.
https://blog.codinghorror.com/the-best-code-is-no-code-at-all/
FROM php:8.4-fpm AS php-baseCOPY --from=composer:latest /usr/bin/composer /usr/bin/composerCOPY --from=src /src/app /srv/app/# configure PHP extensions required for Ilios and delete the source files after installRUN set -eux; \ mkdir -p var/cache var/log; \ composer install --prefer-dist --no-dev --no-progress --no-scripts --no-interaction; \ composer dump-autoload --classmap-authoritative --no-dev; \ composer symfony:dump-env prod; \ composer run-script --no-dev post-install-cmd; \ syncCOPY docker/fpm/symfony.prod.ini $PHP_INI_DIR/conf.d/symfony.iniCOPY docker/fpm/ilios.ini $PHP_INI_DIR/conf.d/ilios.iniENTRYPOINT ["docker-entrypoint"]CMD ["php-fpm"]
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/Dockerfile
build_containers: strategy: matrix: arch: - amd64 - arm64 image: - php-apache - nginx - fpm steps: - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v6 with: target: ${{ matrix.image }} push: false outputs: type=docker,dest=/tmp/${{ matrix.image }}-${{ matrix.arch }}.tar,compression=gzip tags: ${{ matrix.image }}:${{ matrix.arch }}-testing platforms: linux/${{ matrix.arch }}
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/ci.yml#L145-L340
run_containers: matrix: arch: - amd64 - arm64 steps: - uses: actions/checkout@v4 - name: FPM if: ${{ always() }} run: | docker image load --input /tmp/fpm-${{ matrix.arch }}.tar docker run -d --name ilios-fpm fpm:${{ matrix.arch }}-testing docker ps docker ps | grep -q ilios-fpm docker exec ilios-fpm php bin/console monitor:health docker stop ilios-fpm docker rm --volumes ilios-fpm docker image rm fpm:${{ matrix.arch }}-testing
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/ci.yml#L145-L340
jobs: deploy-docker-containers: runs-on: ubuntu-latest strategy: matrix: image: - php-apache - ... steps: - name: ${{ matrix.image }} to Docker Registry uses: docker/build-push-action@v6 with: tags: ilios/${{ matrix.image }}:${{needs.tags.outputs.major}},ilios/${{ matrix.image }}:${{needs.tags.outputs.minor}},ilios/${{ matrix.image }}:${{needs.tags.outputs.patch}} target: ${{ matrix.image }} push: true provenance: false #https://github.com/gabrieldemarmiesse/python-on-whales/issues/407 platforms: linux/amd64,linux/arm64
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/deploy-tag.yml
jobs: tags: steps: - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.ZORGBORT_TOKEN }} - id: tag run: | LATEST_TAG=$(git describe --tags --abbrev=0) echo ${LATEST_TAG} deploy-docker-containers: runs-on: ubuntu-latest strategy: matrix: image: - php-apache - ...
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/deploy-nightly.yml
code_style:runs-on: ubuntu-lateststeps:- run: composer validate --no-check-all --no-check-version --strict- run: vendor/bin/phpcs- name: lint markdown uses: DavidAnson/markdownlint-cli2-action@v19 with: globs: | CHANGELOG.md README.md docs/*.md- name: lint yaml run: | vendor/bin/yaml-lint .github vendor/bin/yaml-lint docs vendor/bin/yaml-lint compose.yaml- name: phpstan run: | vendor/bin/phpstan analyse --no-progress
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/ci.yml#L25-L64
tests:strategy: matrix: php-version: [8.4, 8.3]steps:- name: Use PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: coverage: pcov php-version: ${{ matrix.php-version }}- name: Run Tests run: vendor/bin/phpunit --coverage-clover build/coverage.xml- name: Archive Coverage Report uses: actions/upload-artifact@v4 with: name: coverage-output path: build/coverage.xml overwrite: true retention-days: 1
https://github.com/ilios/ilios/blob/dc8174b62c9fb5e5e9ea77b76207754408eaeefe/.github/workflows/ci.yml#L65-L93
const API_VERSION = require('ilios-common/config/api-version.js');module.exports = function (deployTarget) { var ENV = { 's3-index': { region: 'us-west-2', filePattern(context) { return context.archiveName; }, distDir(context) { return context.archivePath; }, }, brotli: { filePattern: '**/*.{js,css,json,ico,map,xml,txt,svg,eot,ttf,webmanifest}', ignorePattern: 'index.json', keep: true, }, };};
https://github.com/ilios/frontend/blob/2f241c90bc7a737ad01898c05c08f6190337910a/packages/frontend/config/deploy.js
{ "meta": [ { "charset": "utf-8" }, { "name": "description", "content": "" }, { "name": "viewport", "content": "width=device-width, initial-scale=1" }, { "name": "theme-color", "content": "#cc6600" }, { "name": "apple-mobile-web-app-capable", "content": "yes" }, { "name": "apple-mobile-web-app-status-bar-style", "content": "black" }, ], "script": [ {}, { "src": "/ilios-loading/display-loader.d911ede498a82bcd652f366f4cd0fd8a.js" }, {}, { "src": "/assets/vendor.9c86d0ff26b2efa7b46bf1fc458df517.js" }, { "src": "/assets/chunk.cd5e4b4b99b2dfbe70c3.js" }, { "src": "/assets/chunk.8cfb67599df1b87bece5.js" }, {} ]}
jobs: deploy-frontend: name: Deploy Frontend and Create Sentry Release steps: - name: Ember CLI Deploy run: pnpm --filter frontend run deploy:production env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
https://github.com/ilios/frontend/blob/2f241c90bc7a737ad01898c05c08f6190337910a/.github/workflows/deploy-production.yml
jobs: deploy-frontend: name: Deploy Frontend and Create Sentry Release steps: - name: Create a Sentry.io release run: | # Create new Sentry release sentry-cli releases new ${{github.ref_name}} sentry-cli releases set-commits --auto ${{github.ref_name}} sentry-cli releases files ${{github.ref_name}} upload-sourcemaps packages/frontend/tmp/deploy-dist/ sentry-cli releases finalize ${{github.ref_name}}
https://github.com/ilios/frontend/blob/2f241c90bc7a737ad01898c05c08f6190337910a/.github/workflows/deploy-production.yml
{ "scripts": { "preinstall": "npx only-allow pnpm", "format": "pnpm run --parallel format", "lint": "pnpm run --parallel \"/^lint:(hbs|js|css|format)$/\"", "lint:js": "pnpm run --parallel lint:js", "lint:hbs": "pnpm run --parallel lint:hbs", "lint:css": "pnpm run --parallel lint:css", "lint:fix": "pnpm run --parallel lint:fix", "lint:deps": "pnpm run --parallel lint:deps", "lint:format": "pnpm run --parallel lint:format", "start": "pnpm --filter frontend exec ember serve", "test:frontend": "pnpm --filter frontend exec ember exam --parallel=8 --load-balance", "test:test-app": "pnpm --filter test-app exec ember exam --parallel=8 --load-balance", "prepare": "husky" }}
jobs: lint: name: Lint runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Lint run: pnpm run lint - name: Test Dependency Installation run: pnpm install --resolution-only --no-frozen-lockfile
https://github.com/ilios/frontend/blob/2f241c90bc7a737ad01898c05c08f6190337910a/.github/workflows/ci.yml
jobs: test: strategy: matrix: node-version: [20] workspace: - frontend - test-app - lti-course-manager - lti-dashboard steps: - name: Run Tests run: pnpm --filter ${{matrix.workspace}} exec ember exam --parallel=3 --load-balance --write-execution-file env: COVERAGE: true
https://github.com/ilios/frontend/blob/2f241c90bc7a737ad01898c05c08f6190337910a/.github/workflows/ci.yml
jrjohnson
jrjohnson-ucsf
jon.johnson@ucsf.edu
https://www.jrjohnson.dev
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |