jrjohnson
jrjohnson_
jrjohnson-ucsf
It's Friday the 13th in 2020, I double dog dare you to deploy to production!
— Molly Struve 🦄 (@molly_struve) November 13, 2020
The first rule of magic: have a clear intent.
— Beth (@bethcodes) August 10, 2022
This is why TDD works. You express your intent by writing a test. That way the fae running around the CPU can’t twist your spell into a curse.
1!=2
visit(url) get 200 code
Output name of favorite dog
I know it seems counterintuitive but just hear me out: It gets faster to do things correctly if you keep doing them correctly. It might be slow at first if you’ve just been chucking things in the bin- change can be hard but don’t give up!! You deserve good code too.
— Melanie Sumner 💥 🐹 (@melaniersumner) August 7, 2018
--everyone here today
on: push: branches: - master pull_request: schedule: - cron: '33 2 * * 1' # weekly, on Monday morning
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
...jobs: code_style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: coverage: none php-version: 8.1 extensions: apcu - run: vendor/bin/phpunit
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
...code_style: steps: - run: composer install --no-interaction --prefer-dist - run: vendor/bin/phpcs - run: bin/console lint:twig templates custom - run: | bin/console cache:warmup --env=dev vendor/bin/phpstan analyse --no-progress - run: | bin/console cache:warmup --env=test vendor/bin/phpstan analyse -c tests/phpstan.neon.dist tests --no-progress
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
tests: strategy: matrix: php-version: [8.1,8.2] steps: ... - name: Use PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - name: install dependencies run: composer install --no-interaction --prefer-dist - name: Run Tests run: vendor/bin/phpunit
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
test_migrations_against_mysql: name: Test Migrations Against MySQL steps: ... - name: Drop, Create, Migrate, and Validate DB env: ILIOS_DATABASE_URL: mysql://root:root@127.0.0.1:3306/ilios?serverVersion=8.0 run: | sudo systemctl start mysql.service bin/console doctrine:database:drop --if-exists --force bin/console doctrine:database:create bin/console doctrine:migrations:migrate --no-interaction bin/console doctrine:schema:validate
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
...build_containers: steps: ... - name: Build fpm uses: docker/build-push-action@v3 with: target: fpmrun_containers: steps: ... - run: docker load --input /tmp/fpm-image/fpm.tar - run: | docker run -d --name ilios-fpm fpm:testing docker exec ilios-fpm php bin/console monitor:health - if: failure() run: docker logs ilios-fpm
https://github.com/ilios/ilios/blob/master/.github/workflows/ci.yml
on:workflow_dispatch: inputs: releaseType: description: 'Semver Release Type (major,minor,patch)'jobs: tag: steps: - uses: actions/checkout@v3 with: token: ${{ secrets.ZORGBORT_TOKEN }} - name: Increment Version run: npm version ${{ github.event.inputs.releaseType }} - name: Push Changes run: git push --follow-tags
https://github.com/ilios/common/blob/master/.github/workflows/tag_version.yaml
on: push: tags: - '*'jobs: notes: steps: - name: Generate Release Notes id: notes run: | NOTES=$(npx generate-github-release-notes ilios common ${{ steps.previousTag.outputs.tag }} ${{steps.nextTag.outputs.tag}}) echo ${NOTES} # remove line breaks from notes so they can be passed around NOTES="${NOTES//$'\n'/'%0A'}" echo "::set-output name=releaseNotes::$NOTES" - uses: ncipollo/release-action@v1 with: body: ${{steps.notes.outputs.releaseNotes}} token: ${{ secrets.ZORGBORT_TOKEN }}
https://github.com/ilios/common/blob/master/.github/workflows/create_release.yaml
name: Publish NPM Packageon:release: types: [published]jobs: publish-npm: needs: build runs-on: ubuntu-latest steps: - name: install dependencies run: npm ci --ignore-scripts - name: publish run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}}
https://github.com/ilios/common/blob/master/.github/workflows/release.yaml
on: push: tags: - '*'jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - name: install dependencies run: npm ci - name: Ember CLI Deploy run: npm 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/master/.github/workflows/deploy-production.yml
deploy: steps: ... - name: Install Sentry CLI run: npm install -g @sentry/cli - name: Create a Sentry.io release run: | # Create new Sentry release export SENTRY_RELEASE=$(sentry-cli releases propose-version) sentry-cli releases new $SENTRY_RELEASE sentry-cli releases set-commits --auto $SENTRY_RELEASE sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps tmp/deploy-dist/ sentry-cli releases finalize $SENTRY_RELEASE env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
https://github.com/ilios/frontend/blob/master/.github/workflows/deploy-production.yml
FROM php:8.1-fpmRUN 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; \ chmod +x bin/console; \ bin/console cache:warmup;VOLUME /srv/app/varCOPY docker/fpm/ilios.ini $PHP_INI_DIR/conf.d/ilios.iniCOPY docker/fpm/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.confCOPY docker/fpm/docker-entrypoint.sh /usr/local/bin/docker-entrypointRUN chmod +x /usr/local/bin/docker-entrypointENTRYPOINT ["docker-entrypoint"]CMD ["php-fpm"]
Our Dockerfile: https://github.com/ilios/ilios/blob/master/Dockerfile
FROM php:8.1-fpm
FROM php:8.1-fpm
FROM php:8.1-fpm
FROM php:8.1-fpm
FROM php:8.1-fpm
FROM php:8.2-fpm
RUN composer install --prefer-dist;
composer dump-autoload --classmap-authoritative;
composer symfony:dump-env prod;
...steps:- uses: docker/setup-qemu-action@v2 with: image: tonistiigi/binfmt:latest platforms: linux/amd64,linux/arm64- uses: docker/build-push-action@v3 with: platforms: linux/amd64,linux/arm64
https://github.com/ilios/ilios/blob/master/.github/workflows/deploy-tag.yml
jobs: tags: steps: - id: tag run: | MAJOR_VERSION=$(echo $GITHUB_REF | sed -rn 's#^refs/tags/(v3)\.([0-9]+)\.([0-9]+)$#\1#p') MINOR_VERSION=$(echo $GITHUB_REF | sed -rn 's#^refs/tags/(v3)\.([0-9]+)\.([0-9]+)$#\1.\2#p') PATCH_VERSION=$(echo $GITHUB_REF | sed -rn 's#^refs/tags/(v3)\.([0-9]+)\.([0-9]+)$#\1.\2.\3#p') deploy-docker-containers: needs: tags runs-on: ubuntu-latest - uses: docker/build-push-action@v3 with: tags: ilios/fpm:${{major}},ilios/fpm:${{minor}},ilios/fpm:${{patch}} push: true
on: workflow_dispatch: schedule: - cron: '21 10 * * *' # daily, in the morning (UTC)jobs: tags: steps: - run: | LATEST_TAG=$(git describe --tags --abbrev=0) MAJOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1#p') ... deploy-docker-containers: steps: - uses: actions/checkout@v3 with: ref: ${{needs.tags.outputs.latestTag}} ... - uses: docker/build-push-action@v3 with: tags: ilios/${{ matrix.image }}:${{major}},ilios/${{ matrix.image }}:${{minor}}... platforms: linux/amd64,linux/arm64
https://github.com/ilios/ilios/blob/master/.github/workflows/deploy-nightly.yml
Tag Code
jrjohnson
jrjohnson_
jrjohnson-ucsf
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 |