Skip to content

Bump django from 3.2.13 to 4.2.7 #115

Bump django from 3.2.13 to 4.2.7

Bump django from 3.2.13 to 4.2.7 #115

Workflow file for this run

name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- '*'
# Run tests for any PRs.
pull_request:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: image
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
cp .env.dist .env
sed -i.bak 's/^\(POSTGRES_PASSWORD=\).*/\1test/' .env
docker-compose build django
docker-compose run --rm django ./manage.py test
test_e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Before tests
run: |
git submodule init
git submodule update
- name: Run tests
run: |
cp .env.dist .env
sed -i 's,TERRA_TILES_HOSTNAMES=http://127.0.0.1:3000,TERRA_TILES_HOSTNAMES=http://front:3000,' .env
sed -i.bak 's/^\(POSTGRES_PASSWORD=\).*/\1test/' .env
sed -i 's,DOMAIN_NAME=127.0.0.1,DOMAIN_NAME=front,' .env
docker-compose down -v
docker-compose run --rm django ./manage.py migrate
docker-compose build
docker-compose up -d
docker-compose run --rm django ./manage.py loaddata /app/public/data/fixtures/e2e.json
docker-compose run --rm django ./manage.py loaddata /app/public/data/fixtures/demo.json
docker-compose -f docker-compose.yml -f cypress/compose.yml run cypress cypress run
# Push image to registry.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: [test, test_e2e]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image
run: |
docker pull terralego/geocrud-back
docker pull terralego/geocrud-front
docker pull nginx:stable
git submodule init
git submodule update
cp .env.dist .env
sed -i.bak 's/^\(POSTGRES_PASSWORD=\).*/\1test/' .env
docker-compose build
- name: Push image
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo VERSION=$VERSION
docker tag terralego/geocrud-back terralego/geocrud-back:$VERSION
docker push terralego/geocrud-back:$VERSION
docker tag terralego/geocrud-front terralego/geocrud-front:$VERSION
docker push terralego/geocrud-front:$VERSION