Commit 775e867e authored by Recteur LP's avatar Recteur LP

Buildah build

parent dc2a2674
......@@ -3,52 +3,6 @@ stages:
- test
- build
Python 3 Unit Tests:
stage: test
script:
- python3 -m venv env
- source env/bin/activate
- env/bin/pip --quiet install -r requirements.txt
- env/bin/pip --quiet install -r requirements-tests.txt
- env/bin/python setup.py install
- cp conf/pyrmin.yml.default conf/pyrmin.yml
- cd pyrmin && ../env/bin/python -m pytest -svl --color yes -s tests.py
tags:
- python
except:
- tags
PEP 8 Compliance:
stage: test
script:
- python3 -m venv env
- source env/bin/activate
- env/bin/pip --quiet install -r requirements-tests.txt
- env/bin/pep8 --max-line-length=120 --first --show-source --show-pep8 pyrmin
tags:
- python
except:
- tags
JS & CSS Lint:
stage: test
script:
- npm install
- grunt lint
tags:
- python
except:
- tags
codeclimate:
stage: test
tags:
- codeclimate
script:
- make codeclimate
except:
- tags
Documentation:
stage: test
script:
......@@ -65,33 +19,21 @@ Documentation:
Docker Tests:
stage: test
tags:
- docker
- podman
- buildah
script:
- make tests
only:
- master
- tags
Docker Goss Tests:
stage: test
tags:
- goss
script:
- make goss
only:
- master
- tags
Fedora Docker Build & Release:
Fedora Build & Release:
stage: build
tags:
- docker
- buildah
script:
- make build CI_COMMIT_TAG=${CI_COMMIT_TAG:-latest}
- /usr/bin/docker push pyrmin.io/pyrmin/pyrmin:${CI_COMMIT_TAG:-latest}
- /usr/bin/docker tag pyrmin.io/pyrmin/pyrmin:${CI_COMMIT_TAG:-latest} pyrmin/pyrmin:${CI_COMMIT_TAG:-latest}
- /usr/bin/docker push pyrmin/pyrmin:${CI_COMMIT_TAG:-latest}
- docker-clean
- buildah push docker.io/pyrmin/pyrmin:${CI_COMMIT_TAG:-latest}
only:
- master
- tags
......@@ -99,11 +41,10 @@ Fedora Docker Build & Release:
CentOS 7 Docker Build & Release:
stage: build
tags:
- docker
- buildah
script:
- make build27 CI_COMMIT_TAG=${CI_COMMIT_TAG:-latest}
- /usr/bin/docker push pyrmin.io/pyrmin/pyrmin:27-${CI_COMMIT_TAG:-latest}
- docker-clean
- buildah push docker.io/pyrmin/pyrmin:27-${CI_COMMIT_TAG:-latest}
only:
- master
- tags
......@@ -111,11 +52,10 @@ CentOS 7 Docker Build & Release:
CentOS 8 Docker Build & Release:
stage: build
tags:
- docker
- buildah
script:
- make build-el8 CI_COMMIT_TAG=${CI_COMMIT_TAG:-latest}
- /usr/bin/docker push pyrmin.io/pyrmin/pyrmin-el8:${CI_COMMIT_TAG:-latest}
- docker-clean
- buildah push docker.io/pyrmin/pyrmin-el8:${CI_COMMIT_TAG:-latest}
only:
- master
- tags
......@@ -11,49 +11,44 @@ endif
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo "If you are behind a proxy set your HTTP_PROXY env variable"
@echo " build build Docker Images for Python 3"
@echo " build27 build Docker Images for Python 2"
@echo " test-build build Docker Testing Images"
@echo " goss Run Docker Goss Test"
@echo " tests Run Unit tests in Docker"
@echo " build build container Images for Fedora 32"
@echo " build27 build container Images for CentOS 7"
@echo " build-el8 build container Images for CentOS 8"
@echo " test-build build container Testing Images"
@echo " goss Run Podman Goss Test"
@echo " tests Run Unit tests in Podman"
@echo " docenv Create Documentation Build Env"
@echo " docs build Documentation"
test-build: auto-proxy
@docker build --build-arg http_proxy=$(HTTP_PROXY) --build-arg https_proxy=$(HTTP_PROXY) -f docker/tests.docker -t pyrmin:tests .
@buildah bud --pull -f docker/tests.container -t localhost/pyrmin:tests .
vendor:
@npm install
@grunt copy
build: vendor auto-proxy
@docker-compose -f docker/docker-compose.yml -p pyrmin build --pull pyrmin
@docker tag pyrmin.io/pyrmin/pyrmin pyrmin.io/pyrmin/pyrmin:$(CI_COMMIT_TAG)
@buildah bud -f docker/pyrmin.container -t docker.io/pyrmin/pyrmin
@buildah tag docker.io/pyrmin/pyrmin docker.io/pyrmin/pyrmin:$(CI_COMMIT_TAG)
build27: vendor auto-proxy
@docker-compose -f docker/python2/docker-compose.yml -p pyrmin build --pull pyrmin
@docker tag pyrmin.io/pyrmin/pyrmin:27-latest pyrmin.io/pyrmin/pyrmin:27-$(CI_COMMIT_TAG)
@buildah bud -f docker/python2/pyrmin.container -t docker.io/pyrmin/pyrmin:27-latest
@buildah tag docker.io/pyrmin/pyrmin:27-latest docker.io/pyrmin/pyrmin:27-$(CI_COMMIT_TAG)
build-el8: vendor auto-proxy
@docker-compose -f docker/el8/docker-compose.yml -p pyrmin build --pull pyrmin
@docker tag pyrmin.io/pyrmin/pyrmin-el8:latest pyrmin.io/pyrmin/pyrmin-el8:$(CI_COMMIT_TAG)
@buildah bud -f docker/el8/pyrmin.container -t docker.io/pyrmin/pyrmin:el8-latest
@buildah tag docker.io/pyrmin/pyrmin:el8-latest docker.io/pyrmin/pyrmin:el8-$(CI_COMMIT_TAG)
start:
@docker-compose -f docker/docker-compose.yml -p pyrmin up
@podman run --rm docker.io/pyrmin/pyrmin
goss: test-build
@dgoss run pyrmin:tests
@pgoss run localhost/pyrmin
tests: test-build
@docker run --rm -e http_proxy=$(HTTP_PROXY) -e https_proxy=$(HTTP_PROXY) -t pyrmin:tests python3
@docker run --rm -t pyrmin:tests pep8
@docker run --rm -t pyrmin:tests grunt
codeclimate:
@for img in $(shell docker images | grep codeclimate | awk '{print $$1":"$$2}'); do docker pull $${img}; done
@docker run --rm --env CODE_PATH="$(shell pwd)" --volume "$(shell pwd)":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate validate-config
@docker run --rm --env CODE_PATH="$(shell pwd)" --volume "$(shell pwd)":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze
@docker run --rm --env CODE_PATH="$(shell pwd)" --volume "$(shell pwd)":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f html > codeclimate.html
@podman run --rm -t localhost/pyrmin:tests python3
@podman run --rm -t localhost/pyrmin:tests pep8
@podman run --rm -t localhost/pyrmin:tests grunt
csscomb:
@csscomb -v src/css
......@@ -68,7 +63,7 @@ docs:
@$(ENV)/sphinx-build docs html
clean:
@docker rmi pyrmin:tests
@buildah rmi localhost/pyrmin:tests
auto-proxy:
@if test -n "$(HTTP_PROXY)"; then \
......
apiVersion: v1
kind: Pod
metadata:
name: pyrmin
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
volumes:
- name: config
hostPath:
path: /etc/pyrmin
type: Directory
- name: plugins
hostPath:
path: /usr/share/pyrmin/plugins
type: Directory
- name: static
hostPath:
path: /var/www/html/public
type: Directory
containers:
- name: pyrmin
image: docker.io/pyrmin/pyrmin-el8:latest
volumeMounts:
- name: config
mountPath: /etc/pyrmin
- name: plugins
mountPath: /usr/share/pyrmin/plugins
- name: static
mountPath: /static
ports:
- containerPort: 8000
hostPort: 8000
protocol: TCP
env:
- name: UPGRADE
value: true
- name: DEBUG
value: true
apiVersion: v1
kind: Pod
metadata:
name: pyrmin
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
volumes:
- name: config
hostPath:
path: /etc/pyrmin
type: Directory
- name: plugins
hostPath:
path: /usr/share/pyrmin/plugins
type: Directory
- name: static
hostPath:
path: /var/www/html/public
type: Directory
containers:
- name: pyrmin
image: docker.io/pyrmin/pyrmin:latest
volumeMounts:
- name: config
mountPath: /etc/pyrmin
- name: plugins
mountPath: /usr/share/pyrmin/plugins
- name: static
mountPath: /static
ports:
- containerPort: 8000
hostPort: 8000
protocol: TCP
env:
- name: UPGRADE
value: true
- name: DEBUG
value: true
\ No newline at end of file
apiVersion: v1
kind: Pod
metadata:
name: pyrmin
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
volumes:
- name: config
hostPath:
path: /etc/pyrmin
type: Directory
- name: plugins
hostPath:
path: /usr/share/pyrmin/plugins
type: Directory
- name: static
hostPath:
path: /var/www/html/public
type: Directory
containers:
- name: pyrmin
image: docker.io/pyrmin/pyrmin:27-latest
volumeMounts:
- name: config
mountPath: /etc/pyrmin
- name: plugins
mountPath: /usr/share/pyrmin/plugins
- name: static
mountPath: /static
ports:
- containerPort: 8000
hostPort: 8000
protocol: TCP
env:
- name: UPGRADE
value: true
- name: DEBUG
value: true
\ No newline at end of file
version: '2'
services:
pyrmin:
#restart: always
image: "pyrmin.io/pyrmin/pyrmin"
build:
context: ..
dockerfile: docker/pyrmin.docker
args:
- http_proxy
- https_proxy
ports:
- 8080:8080
environment:
DEBUG: "false"
UPGRADE: "true"
http_proxy: $http_proxy
https_proxy: $http_proxy
volumes:
- /etc/pyrmin:/etc/pyrmin
- /usr/share/pyrmin/plugins:/usr/share/pyrmin/plugins
- /var/www/html:/static
version: '2'
services:
pyrmin:
image: pyrmin.io/pyrmin/pyrmin-el8:latest
build:
context: ../..
dockerfile: docker/el8/pyrmin.docker
args:
- http_proxy
- https_proxy
ports:
- 8080:8080
environment:
DEBUG: "true"
UPGRADE: "true"
http_proxy: $http_proxy
https_proxy: $http_proxy
#restart: always
volumes:
- /etc/pyrmin:/etc/pyrmin
- /usr/share/pyrmin/plugins:/usr/share/pyrmin/plugins
- /var/www/html:/static
version: '2'
services:
pyrmin:
image: pyrmin.io/pyrmin/pyrmin:27-latest
build:
context: ../..
dockerfile: docker/python2/pyrmin.docker
args:
- http_proxy
- https_proxy
ports:
- 8080:8080
environment:
DEBUG: "true"
UPGRADE: "true"
http_proxy: $http_proxy
https_proxy: $http_proxy
#restart: always
volumes:
- /etc/pyrmin:/etc/pyrmin
- /usr/share/pyrmin/plugins:/usr/share/pyrmin/plugins
- /var/www/html:/static
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment