include: - remote: https://open.greenhost.net/openappstack/openappstack/raw/master/.gitlab/ci_templates/kaniko.yml stages: - build - test backend: stage: build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context ${CI_PROJECT_DIR}/backend/ --dockerfile ${CI_PROJECT_DIR}/backend/Dockerfile --destination $CI_REGISTRY_IMAGE/backend:${CI_COMMIT_REF_NAME} extends: .kaniko_build only: changes: - backend/**/* - .gitlab-ci.yml frontend: stage: build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context ${CI_PROJECT_DIR}/frontend/ --dockerfile ${CI_PROJECT_DIR}/frontend/Dockerfile --destination $CI_REGISTRY_IMAGE/frontend:${CI_COMMIT_REF_NAME} only: changes: - frontend/**/* - .gitlab-ci.yml backend-unittests: stage: test variables: DATABASE_USER: postgres DATABASE_PASSWORD: secret DATABASE_NAME: postgres DATABASE_HOST: postgres POSTGRES_PASSWORD: secret services: - name: postgres:11 alias: postgres image: ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_REF_NAME} script: - cd backend - python3 -m unittest discover only: changes: - login_provider/**/* - .gitlab-ci.yml