Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD insert commit hash into web and api images #397

Open
wabscale opened this issue Sep 18, 2022 · 1 comment
Open

ADD insert commit hash into web and api images #397

wabscale opened this issue Sep 18, 2022 · 1 comment
Labels
backend feature New feature or request

Comments

@wabscale
Copy link
Collaborator

wabscale commented Sep 18, 2022

Putting commit in docker images

We can do this through the GIT_TAG environment variable from the makefile, that is passed to the docker-compose setup. We can add it as an environment variable. Pass this to the docker build by specifying it as a docker build arg in the docker-compose.yml file. The GIT_TAG environment variable will be set when building through make build, so you can reference it in the docker compose file like this: ${GIT_TAG:-latest}. This is a special way of referencing an environment variable, where if GIT_TAG is not set, it will default to latest.

You can make these environment variables available when the docker image builds by converting the build arg to an environment variable.

For example:

ARG GIT_TAG=latest       # default to latest
ENV GIT_TAG=${GIT_TAG}   # convert build arg value to environment variable

Exposing in services

api

Then expose it throught the healthcheck endpoint on the api.

web

Expose it in the footer of the website. For the react website, you can see how to use an environment variable like this here https://create-react-app.dev/docs/adding-custom-environment-variables/ (basically just add REACT_APP_ before the environment variable)

@wabscale wabscale added feature New feature or request backend labels Sep 18, 2022
@wabscale
Copy link
Collaborator Author

#413

Handles api, web+theia-proxy+theia-autosave+theia-dockerd+theia-autograde still needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend feature New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant