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

root owns pre-commit artifacts #345

Closed
apt-ma opened this Issue May 14, 2018 · 7 comments

Comments

Projects
None yet
2 participants
@apt-ma
Contributor

apt-ma commented May 14, 2018

Details are here: #340

@apt-ma apt-ma changed the title from root owns pre-commit artifacts #340 to root owns pre-commit artifacts May 14, 2018

@apt-ma

This comment has been minimized.

Contributor

apt-ma commented May 14, 2018

Since we clean cache before CI:

pyclean
# Clean everything up:
trap pyclean EXIT INT TERM
# Run the CI process:
run_ci

What if in pre-commit hook we will clean cache after CI?

@sobolevn

This comment has been minimized.

Member

sobolevn commented May 14, 2018

After ci.sh is finished it should be cleaned also: by trap pyclean EXIT INT TERM.
Could you please double check that this is executed?

@sobolevn

This comment has been minimized.

Member

sobolevn commented May 15, 2018

@apt-ma Could you please try to provide USEDID env var inside docker-compose.yml and run the tests?

@apt-ma

This comment has been minimized.

Contributor

apt-ma commented May 20, 2018

You're right, it's a feature of Linux systems. I resolved this like that.

@sobolevn

This comment has been minimized.

Member

sobolevn commented May 20, 2018

Nice! Could you please make a link from the docs to this issue?
I guess this place is the best one: http://wemake-django-template.readthedocs.io/en/latest/_pages/template/docker.html#common-issues

@sobolevn

This comment has been minimized.

Member

sobolevn commented May 24, 2018

I will copy the fix here for history reasons:

# .pre-commit-config.yaml

-      entry: docker-compose run -e INSIDE_CI=0 web sh ./docker/ci.sh
+      #entry: docker-compose run -e INSIDE_CI=0 web sh ./docker/ci.sh
+      entry: bash ./docker/precommit.sh
# .docker-compose.yml

          DJANGO_DATABASE_HOST: db
+     user: ${CURRENT_UID}
    command: python -Wd manage.py runserver 0.0.0.0:8000
# docker/precommit.sh  

+ #!/usr/bin/env bash
+ 
+ CURRENT_UID=$(id -u):$(id -g) docker-compose run -e INSIDE_CI=0 web sh ./docker/ci.sh

@sobolevn sobolevn closed this May 24, 2018

@sobolevn sobolevn reopened this May 24, 2018

@sobolevn sobolevn closed this in 295c2fc May 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment