From 6736a9c8261e7e9947690f4e1a86a08bab96df06 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:13:49 +0500 Subject: [PATCH] refactor: remove redundant curl command --- .../workflows/push-edx-analytics-dashboard-image.yaml | 5 +++++ dockerfiles/edx-analytics-dashboard.Dockerfile | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-edx-analytics-dashboard-image.yaml b/.github/workflows/push-edx-analytics-dashboard-image.yaml index 6bf61fa..7d256ab 100644 --- a/.github/workflows/push-edx-analytics-dashboard-image.yaml +++ b/.github/workflows/push-edx-analytics-dashboard-image.yaml @@ -9,6 +9,11 @@ on: schedule: - cron: "0 4 * * 1-5" # UTC Time +# Added for testing purposes. Will remove once the PR is finalised + pull_request: + branches: + - '**' + jobs: build-and-push-image: runs-on: ubuntu-latest diff --git a/dockerfiles/edx-analytics-dashboard.Dockerfile b/dockerfiles/edx-analytics-dashboard.Dockerfile index 357f8d9..6dd5d8c 100644 --- a/dockerfiles/edx-analytics-dashboard.Dockerfile +++ b/dockerfiles/edx-analytics-dashboard.Dockerfile @@ -51,14 +51,16 @@ ENV PYTHON_VERSION "${PYTHON_VERSION}" RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} RUN pip install virtualenv -# Create required directories for requirements -RUN mkdir -p requirements - # No need to activate insights virtualenv as it is already activated by putting in the path RUN virtualenv -p python${PYTHON_VERSION} --always-copy ${INSIGHTS_VENV_DIR} ENV PATH="${INSIGHTS_CODE_DIR}/node_modules/.bin:$PATH" +WORKDIR ${INSIGHTS_CODE_DIR}/ + +# Create required directories for requirements +RUN mkdir -p requirements + # insights service config commands below RUN curl -L -o requirements/production.txt https://raw.githubusercontent.com/edx/edx-analytics-dashboard/master/requirements/production.txt RUN pip install --no-cache-dir -r requirements/production.txt @@ -75,7 +77,6 @@ EXPOSE 18110 FROM app as dev -RUN curl -L -o requirements/local.txt https://raw.githubusercontent.com/edx/edx-analytics-dashboard/master/requirements/local.txt RUN pip install --no-cache-dir -r requirements/local.txt ENV DJANGO_SETTINGS_MODULE "analytics_dashboard.settings.devstack"