Dockerfile always pip install from master branch #7

Closed
opened 2020-06-21 13:20:23 +00:00 by mattia · 4 comments
Owner

Review-stats is not working since few days. The cause is the dockerfile always install from the master branch instead of from the appropriate branch (prod or stg).

I tried to fix it with 5b59075 but it doesn't work. Is there any way to use the prod/stg environment value while building the image?

Review-stats is not working since few days. The cause is the dockerfile always install from the master branch instead of from the appropriate branch (prod or stg). I tried to fix it with 5b59075 but it doesn't work. Is there any way to use the prod/stg environment value while building the image?
Owner

Huh, it should use the branch for the Dockerfile too...

Thats in ansible:

https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openshift-apps/review-stats/templates/buildconfig.yml#_14

We define 'env_short' as 'prod' in production and 'stg' in stg.

Huh, it should use the branch for the Dockerfile too... Thats in ansible: https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openshift-apps/review-stats/templates/buildconfig.yml#_14 We define 'env_short' as 'prod' in production and 'stg' in stg.
Author
Owner

Huh, it should use the branch for the Dockerfile too...
Thats in ansible:
https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openshift-apps/review-stats/templates/buildconfig.yml#_14
We define 'env_short' as 'prod' in production and 'stg' in stg.

Yes, it uses the Dockerfile from the appropriate branch. But in the dockerfile there's the command:
pip install git+https://pagure.io/Fedora-Infra/review_stats.git
which means it installs review-stats from the master branch, both for prod and stg.

I could hardcode the command and have two different dockerfiles for the two branches:
pip install git+https://pagure.io/Fedora-Infra/review_stats.git@prod
and
pip install git+https://pagure.io/Fedora-Infra/review_stats.git@stg
but I would like to know if an env variable exists so that I can avoid having two separate dockerfiles, like I tried in my previous commit.

> Huh, it should use the branch for the Dockerfile too... > Thats in ansible: > https://pagure.io/fedora-infra/ansible/blob/master/f/roles/openshift-apps/review-stats/templates/buildconfig.yml#_14 > We define 'env_short' as 'prod' in production and 'stg' in stg. Yes, it uses the Dockerfile from the appropriate branch. But in the dockerfile there's the command: `pip install git+https://pagure.io/Fedora-Infra/review_stats.git` which means it installs review-stats from the master branch, both for prod and stg. I could hardcode the command and have two different dockerfiles for the two branches: `pip install git+https://pagure.io/Fedora-Infra/review_stats.git@prod` and `pip install git+https://pagure.io/Fedora-Infra/review_stats.git@stg` but I would like to know if an env variable exists so that I can avoid having two separate dockerfiles, like I tried in my previous commit.
Author
Owner

Never mind, I was trying to do stupid things.
I only had to make the command in the dockerfile to install the already downloaded git source... hopefully the script should start running again with the next run.

Never mind, I was trying to do stupid things. I only had to make the command in the dockerfile to install the already downloaded git source... hopefully the script should start running again with the next run.
Author
Owner

Metadata Update from @mattia:

  • Issue status updated to: Closed (was: Open)
**Metadata Update from @mattia**: - Issue status updated to: Closed (was: Open)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
apps/review_stats#7
No description provided.