Skip to content

Commit

Permalink
Merge pull request #70 from uw-it-aca/char/testing
Browse files Browse the repository at this point in the history
Char/testing
  • Loading branch information
charlon authored Jan 24, 2025
2 parents 5521882 + b639026 commit 93d3f85
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
name: Build, Test and Deploy

env:
RELEASE_NAME: app_name
RELEASE_NAME: django-vue
DJANGO_APP: app_name

# Be sure that branches defined here have corresponding steps
Expand Down Expand Up @@ -67,32 +67,32 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

- name: Run Python Linters
uses: uw-it-aca/actions/python-linters@main
with:
app_name: ${DJANGO_APP}
exclude_paths: 'migrations'
exclude_paths: "migrations"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-$(echo ${{ hashFiles('Dockerfile') }} | head -c 16)
restore-keys: |
${{ runner.os }}-buildx-
- name: Build App Image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
target: app-container
Expand All @@ -103,7 +103,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Build Test Image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
target: app-test-container
tags: app-test-container
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
ARG DJANGO_CONTAINER_VERSION=2.0.1
ARG DJANGO_CONTAINER_VERSION=2.0.6

FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} as app-prebundler-container

USER root

RUN apt-get update && apt-get install -y libpq-dev
RUN apt-get update && apt-get install libpq-dev -y

USER acait

ADD --chown=acait:acait . /app/
ADD --chown=acait:acait docker/ /app/project/

# ADD --chown=acait:acait docker/app_start.sh /scripts
# RUN chmod u+x /scripts/app_start.sh
ADD --chown=acait:acait docker/app_start.sh /scripts
RUN chmod u+x /scripts/app_start.sh

RUN /app/bin/pip install -r requirements.txt
RUN /app/bin/pip install psycopg2
Expand All @@ -38,7 +38,7 @@ COPY --chown=acait:acait --from=node-bundler /app/app_name/static /app/app_name/

RUN /app/bin/python manage.py collectstatic --noinput

FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} as app-test-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-test-container:${DJANGO_CONTAINER_VERSION} AS app-test-container

ENV NODE_PATH=/app/lib/node_modules
COPY --from=app-container /app/ /app/
Expand Down
2 changes: 1 addition & 1 deletion docker/app_start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if [ "$ENV" = "localdev" ]
then

. /scripts/app_deploy.sh
python manage.py migrate

fi
2 changes: 1 addition & 1 deletion docker/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function run_test {
}

# Moving to github action - remove this when successful
#run_test "pycodestyle ${DJANGO_APP}/ --exclude=migrations,static"
# run_test "pycodestyle ${DJANGO_APP}/ --exclude=migrations,static"
#
#if [ -d ${DJANGO_APP}/static/${DJANGO_APP}/js ]; then
# run_test "jshint ${DJANGO_APP}/static/${DJANGO_APP}/js --verbose"
Expand Down

0 comments on commit 93d3f85

Please # to comment.