Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Improve fonts generation: enable CircleCI to build Docker image and fonts #50

Merged
merged 3 commits into from
Sep 4, 2018

Conversation

ylemkimon
Copy link
Member

@ylemkimon ylemkimon commented Jun 29, 2018

This PR is part of #12.

I think it's best to have another branch for Dockerfile and CircleCI configs to build the image. I've pushed the branch to https://github.com/KaTeX/katex-fonts/tree/docker:

version: 2
jobs:
build:
machine: true
steps:
- checkout
- run:
name: Login to Docker
command: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- run:
name: Build Docker image
command: docker build -t $DOCKER_USERNAME/katex-fonts:$(openssl sha1 Dockerfile | tail -c 9) .
- run:
name: Push Docker image
command: docker push $DOCKER_USERNAME/katex-fonts

Example CircleCI builds: docker branch, PR branch

  • Enable CircleCI on the repo
  • Set Docker username and password as DOCKER_USERNAME and DOCKER_PASSWORD, respectively, in the environment variables

jobs:
build:
docker:
- image: $DOCKER_USERNAME/katex-fonts:29d4cdbc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this docker image live on docker hub? Why do we need environment variables for the user name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinbarabash Yes. Using environment variables is for easier maintenance.


- store_artifacts:
path: fonts.tar.gz
destination: fonts.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother storing artifacts if we're using this repo as a submodule?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we moved font creation into the main repo, we could avoid checking the built fonts in and instead grab the most recent artifact so that people don't have to build fonts themselves when doing KaTeX development.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinbarabash It's like screenshots. CircleCI doesn't commit files and they have to be manually committed.

@kevinbarabash
Copy link
Member

@ylemkimon I've granted circleci access to the KaTeX organization and set up https://circleci.com/setup-project/gh/KaTeX/katex-fonts.

Copy link
Member

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinbarabash kevinbarabash merged commit abc90d6 into KaTeX:master Sep 4, 2018
@kevinbarabash
Copy link
Member

I forgot about the second item on the checklist before merging this. 😞

I also should've asked more questions about how the docker image in https://github.com/KaTeX/katex-fonts/tree/docker gets built and how $DOCKER_USERNAME and $DOCKER_PASSWORD get set.

@kevinbarabash
Copy link
Member

I totally messed that up https://circleci.com/gh/KaTeX/katex-fonts/2.

@kevinbarabash
Copy link
Member

I temporarily fixed it https://circleci.com/gh/KaTeX/katex-fonts/3.

@ylemkimon
Copy link
Member Author

ylemkimon commented Sep 4, 2018

@kevinbarabash I've put my account to environment variables temporarily.

@kevinbarabash
Copy link
Member

I see, there's a way to set environment variables in the project settings part on circleci.

@ylemkimon
Copy link
Member Author

@kevinbarabash But to test PRs, it seems we should hard-code the DOCKER_USERNAME, anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants