Merge remote-tracking branch 'origin/master'

This commit is contained in:
Marco Zeisler 2021-05-11 20:03:45 +02:00
commit 3ec3516865
6 changed files with 106 additions and 50 deletions

View File

@ -1,20 +1,18 @@
variables:
DOCKER_USER: pfingstfrosch
ASSIGNMENT: waecm-2021-group-04-bsp-3
stages: stages:
- build - build
- lint - lint
- test - test
- compose-build - docker-build
- compose-push - docker-push
.lint: .python-image:
stage: lint image: python:3.8-slim
.build: .angular-image:
stage: build image: johnpapa/angular-cli
.test:
stage: test
.compose-build:
stage: compose-build
.compose-push:
stage: compose-push
######## ########
# BUILD # BUILD
@ -26,9 +24,10 @@ stages:
# - echo '' # - echo ''
# extends: # extends:
# - .build # - .build
.build:
stage: build
build_be: build_be:
image: python:3.8-slim
before_script: before_script:
- apt-get update - apt-get update
- apt-get install -y build-essential gcc - apt-get install -y build-essential gcc
@ -41,19 +40,24 @@ build_be:
untracked: true untracked: true
extends: extends:
- .build - .build
- .python-image
######## ########
# LINT # LINT
################################################################# #################################################################
.lint:
stage: lint
lint_fe: lint_fe:
image: johnpapa/angular-cli
script: script:
- cd ./frontend - cd ./frontend
- npm update - npm update
- npm run -- ng lint - ng lint
extends: extends:
- .lint - .lint
- .angular-image
artifacts:
untracked: true
# needs: # needs:
# - build_fe # - build_fe
@ -68,45 +72,88 @@ lint_fe:
######## ########
# TEST # TEST
################################################################# #################################################################
.test:
stage: test
test_fe: test_fe:
script: script:
- echo '' - cd ./frontend
- npm update
- ng test
extends: extends:
- .test - .test
- .angular-image
needs: needs:
- lint_fe - lint_fe
test_be: #test_be:
# script:
# - cd ./backend
# - ls -l
# extends:
# - .test
# needs:
# - build_be
########
# DOCKER-BUILD
#################################################################
.docker-build:
stage: docker-build
.docker-setup:
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u $DOCKER_USER -p $DOCKER_PW
artifacts:
untracked: true
tags:
- docker
docker-build-fe:
script: script:
- cd ./backend - docker-compose build waecm_g4_fe
- ls -l - docker save -o waecm_g4_fe ${DOCKER_USER}/${ASSIGNMENT}-fe
extends: extends:
- .test - .docker-build
- .docker-setup
needs:
- test_fe
docker-build-be:
script:
- docker-compose build waecm_g4_be
- docker save -o waecm_g4_be ${DOCKER_USER}/${ASSIGNMENT}-be
extends:
- .docker-build
- .docker-setup
needs: needs:
- build_be - build_be
######## ########
# COMPOSE-BUILD # DOCKER-PUSH
################################################################# #################################################################
.docker-push:
stage: docker-push
compose-build: docker-push-fe:
script: script:
- echo '' - docker image load --input waecm_g4_fe
- docker-compose push waecm_g4_fe
extends: extends:
- .compose-build - .docker-push
- .docker-setup
needs: needs:
- test_be - docker-build-fe
- test_fe
######## docker-push-be:
# COMPOSE-PUSH
#################################################################
compose-push:
script: script:
- echo '' - docker image load --input waecm_g4_be
- docker-compose push waecm_g4_be
extends: extends:
- .compose-push - .docker-push
- .docker-setup
needs: needs:
- compose-build - docker-build-be

View File

@ -42,3 +42,7 @@ The docker images are available at:
* sha256 digest: 2d6526c871285f81dee714f41c41750e6e9c4e124cdc78f69ecd17036f620399 * sha256 digest: 2d6526c871285f81dee714f41c41750e6e9c4e124cdc78f69ecd17036f620399
* [waecm-2021-group-04-bsp2-be](https://hub.docker.com/r/pfingstfrosch/waecm-2021-group-04-bsp-2-be) * [waecm-2021-group-04-bsp2-be](https://hub.docker.com/r/pfingstfrosch/waecm-2021-group-04-bsp-2-be)
* sha256 digest: fe0b490a7ad5546371a8a709c9e4f80985326c9a27dddfeef6179f89affc9105 * sha256 digest: fe0b490a7ad5546371a8a709c9e4f80985326c9a27dddfeef6179f89affc9105
## CI
Look at git-lab project https://gitlab.com/Pfingstfrosch/waecm-g4-CI for CI execution.
This repository is mirrored to the CI repo, where the pipeline is executed.

1
backend/.gitignore vendored
View File

@ -7,3 +7,4 @@ media/feed-icons
*.sqlite3 *.sqlite3
waecm-2021-group-04.egg-info waecm-2021-group-04.egg-info
app_be/migrations app_be/migrations
/dist

View File

@ -2,20 +2,24 @@ FROM python:3.8-slim
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV PATH="/opt/venv/bin:$PATH" ENV PATH="/opt/venv/bin:$PATH"
RUN apt-get update; \ # will be build in a different stage in CI
apt-get install -y build-essential gcc; \ #RUN apt-get update; \
python -m venv /opt/venv; \ # apt-get install -y build-essential gcc; \
python -m pip install --upgrade pip; \ # python -m venv /opt/venv; \
mkdir /code; # python -m pip install --upgrade pip; \
# mkdir /code;
WORKDIR /code #
#WORKDIR /code
COPY setup.py /code/ #
COPY requirements.txt /code/ #COPY setup.py /code/
#COPY requirements.txt /code/
RUN pip install -r requirements.txt #
#RUN pip install -r requirements.txt
# install and use built artifact
COPY . /code/ COPY . /code/
WORKDIR /code
RUN pip install ./dist/waecm*
RUN chmod 777 scripts/entrypoint.sh RUN chmod 777 ./scripts/entrypoint.sh
ENTRYPOINT ["scripts/entrypoint.sh"] ENTRYPOINT ["./scripts/entrypoint.sh"]

View File

@ -5,7 +5,7 @@ from setuptools import find_packages, setup
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(name='waecm-2021-group-04', setup(name='waecm-2021-group-04',
version='0.0.0', version='3',
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[

View File

@ -1,6 +1,6 @@
# Stage 1 # Stage 1
FROM node:alpine FROM johnpapa/angular-cli
WORKDIR /app WORKDIR /app