Merge branch 'update-python' into 'develop'
Update python to 3.12 See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!99
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
members/static/js/lib
|
|
||||||
infoscreen/static/js/lib
|
|
||||||
webapp/static/js/lib
|
|
||||||
static/js/lib
|
|
||||||
collected_static
|
|
||||||
venv
|
|
||||||
-251
@@ -1,251 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"jquery": true
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"angular": true,
|
|
||||||
"noty": true,
|
|
||||||
"_": true,
|
|
||||||
"moment": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended",
|
|
||||||
"rules": {
|
|
||||||
"no-unused-vars": "warn",
|
|
||||||
"accessor-pairs": "error",
|
|
||||||
"array-bracket-spacing": "off",
|
|
||||||
"array-callback-return": "error",
|
|
||||||
"arrow-body-style": "error",
|
|
||||||
"arrow-parens": "error",
|
|
||||||
"arrow-spacing": "error",
|
|
||||||
"block-scoped-var": "off",
|
|
||||||
"block-spacing": "off",
|
|
||||||
"brace-style": "off",
|
|
||||||
"callback-return": "off",
|
|
||||||
"camelcase": "off",
|
|
||||||
"capitalized-comments": "off",
|
|
||||||
"class-methods-use-this": "error",
|
|
||||||
"comma-dangle": "off",
|
|
||||||
"comma-spacing": "off",
|
|
||||||
"comma-style": "off",
|
|
||||||
"complexity": "off",
|
|
||||||
"computed-property-spacing": "off",
|
|
||||||
"consistent-return": "off",
|
|
||||||
"consistent-this": "off",
|
|
||||||
"curly": "off",
|
|
||||||
"default-case": "off",
|
|
||||||
"dot-location": [
|
|
||||||
"error",
|
|
||||||
"property"
|
|
||||||
],
|
|
||||||
"dot-notation": "off",
|
|
||||||
"eol-last": "off",
|
|
||||||
"eqeqeq": "off",
|
|
||||||
"func-call-spacing": "error",
|
|
||||||
"func-name-matching": "error",
|
|
||||||
"func-names": "off",
|
|
||||||
"func-style": "off",
|
|
||||||
"generator-star-spacing": "error",
|
|
||||||
"global-require": "off",
|
|
||||||
"guard-for-in": "off",
|
|
||||||
"handle-callback-err": "off",
|
|
||||||
"id-blacklist": "error",
|
|
||||||
"id-length": "off",
|
|
||||||
"id-match": "error",
|
|
||||||
"indent": "off",
|
|
||||||
"init-declarations": "off",
|
|
||||||
"jsx-quotes": "error",
|
|
||||||
"key-spacing": "off",
|
|
||||||
"keyword-spacing": "off",
|
|
||||||
"line-comment-position": "off",
|
|
||||||
"linebreak-style": "off",
|
|
||||||
"lines-around-comment": "off",
|
|
||||||
"lines-around-directive": "off",
|
|
||||||
"max-depth": "off",
|
|
||||||
"max-len": "off",
|
|
||||||
"max-lines": "off",
|
|
||||||
"max-nested-callbacks": "error",
|
|
||||||
"max-params": "off",
|
|
||||||
"max-statements": "off",
|
|
||||||
"max-statements-per-line": "off",
|
|
||||||
"multiline-ternary": "off",
|
|
||||||
"new-parens": "off",
|
|
||||||
"newline-after-var": "off",
|
|
||||||
"newline-before-return": "off",
|
|
||||||
"newline-per-chained-call": "off",
|
|
||||||
"no-alert": "error",
|
|
||||||
"no-array-constructor": "off",
|
|
||||||
"no-await-in-loop": "error",
|
|
||||||
"no-bitwise": "off",
|
|
||||||
"no-caller": "error",
|
|
||||||
"no-catch-shadow": "off",
|
|
||||||
"no-confusing-arrow": "error",
|
|
||||||
"no-constant-condition": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"checkLoops": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-continue": "off",
|
|
||||||
"no-div-regex": "error",
|
|
||||||
"no-duplicate-imports": "error",
|
|
||||||
"no-else-return": "off",
|
|
||||||
"no-empty-function": "off",
|
|
||||||
"no-eq-null": "off",
|
|
||||||
"no-eval": "error",
|
|
||||||
"no-extend-native": "error",
|
|
||||||
"no-extra-bind": "error",
|
|
||||||
"no-extra-label": "error",
|
|
||||||
"no-extra-parens": "off",
|
|
||||||
"no-floating-decimal": "off",
|
|
||||||
"no-implicit-coercion": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"boolean": false,
|
|
||||||
"number": false,
|
|
||||||
"string": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-implicit-globals": "off",
|
|
||||||
"no-implied-eval": "error",
|
|
||||||
"no-inline-comments": "off",
|
|
||||||
"no-inner-declarations": [
|
|
||||||
"error",
|
|
||||||
"functions"
|
|
||||||
],
|
|
||||||
"no-invalid-this": "off",
|
|
||||||
"no-iterator": "error",
|
|
||||||
"no-label-var": "error",
|
|
||||||
"no-labels": "error",
|
|
||||||
"no-lone-blocks": "error",
|
|
||||||
"no-lonely-if": "off",
|
|
||||||
"no-loop-func": "error",
|
|
||||||
"no-magic-numbers": "off",
|
|
||||||
"no-mixed-operators": "off",
|
|
||||||
"no-mixed-requires": "error",
|
|
||||||
"no-multi-assign": "off",
|
|
||||||
"no-multi-spaces": "off",
|
|
||||||
"no-multi-str": "error",
|
|
||||||
"no-multiple-empty-lines": "off",
|
|
||||||
"no-native-reassign": "off",
|
|
||||||
"no-negated-condition": "off",
|
|
||||||
"no-negated-in-lhs": "error",
|
|
||||||
"no-nested-ternary": "off",
|
|
||||||
"no-new": "error",
|
|
||||||
"no-new-func": "off",
|
|
||||||
"no-new-object": "error",
|
|
||||||
"no-new-require": "error",
|
|
||||||
"no-new-wrappers": "error",
|
|
||||||
"no-octal-escape": "error",
|
|
||||||
"no-param-reassign": "off",
|
|
||||||
"no-path-concat": "error",
|
|
||||||
"no-plusplus": "off",
|
|
||||||
"no-process-env": "error",
|
|
||||||
"no-process-exit": "error",
|
|
||||||
"no-proto": "error",
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"no-restricted-globals": "error",
|
|
||||||
"no-restricted-imports": "error",
|
|
||||||
"no-restricted-modules": "error",
|
|
||||||
"no-restricted-properties": "error",
|
|
||||||
"no-restricted-syntax": "error",
|
|
||||||
"no-return-assign": "off",
|
|
||||||
"no-return-await": "error",
|
|
||||||
"no-script-url": "error",
|
|
||||||
"no-self-compare": "error",
|
|
||||||
"no-sequences": "off",
|
|
||||||
"no-shadow": "off",
|
|
||||||
"no-shadow-restricted-names": "error",
|
|
||||||
"no-spaced-func": "error",
|
|
||||||
"no-sync": "error",
|
|
||||||
"no-tabs": "off",
|
|
||||||
"no-template-curly-in-string": "error",
|
|
||||||
"no-ternary": "off",
|
|
||||||
"no-throw-literal": "off",
|
|
||||||
"no-trailing-spaces": "off",
|
|
||||||
"no-undef-init": "error",
|
|
||||||
"no-undefined": "off",
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"no-unmodified-loop-condition": "error",
|
|
||||||
"no-unneeded-ternary": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"defaultAssignment": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-unused-expressions": "off",
|
|
||||||
"no-use-before-define": "off",
|
|
||||||
"no-useless-call": "off",
|
|
||||||
"no-useless-computed-key": "error",
|
|
||||||
"no-useless-concat": "error",
|
|
||||||
"no-useless-constructor": "error",
|
|
||||||
"no-useless-escape": "off",
|
|
||||||
"no-useless-rename": "error",
|
|
||||||
"no-useless-return": "error",
|
|
||||||
"no-var": "off",
|
|
||||||
"no-void": "off",
|
|
||||||
"no-warning-comments": "off",
|
|
||||||
"no-whitespace-before-property": "error",
|
|
||||||
"no-with": "error",
|
|
||||||
"object-curly-newline": "off",
|
|
||||||
"object-curly-spacing": "off",
|
|
||||||
"object-property-newline": "off",
|
|
||||||
"object-shorthand": "off",
|
|
||||||
"one-var": "off",
|
|
||||||
"one-var-declaration-per-line": "off",
|
|
||||||
"operator-assignment": "off",
|
|
||||||
"operator-linebreak": "off",
|
|
||||||
"padded-blocks": "off",
|
|
||||||
"prefer-arrow-callback": "off",
|
|
||||||
"prefer-const": "error",
|
|
||||||
"prefer-destructuring": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"array": false,
|
|
||||||
"object": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"prefer-numeric-literals": "error",
|
|
||||||
"prefer-promise-reject-errors": "error",
|
|
||||||
"prefer-reflect": "off",
|
|
||||||
"prefer-rest-params": "off",
|
|
||||||
"prefer-spread": "off",
|
|
||||||
"prefer-template": "off",
|
|
||||||
"quote-props": "off",
|
|
||||||
"quotes": "off",
|
|
||||||
"radix": "off",
|
|
||||||
"require-await": "error",
|
|
||||||
"require-jsdoc": "off",
|
|
||||||
"rest-spread-spacing": "error",
|
|
||||||
"semi": "off",
|
|
||||||
"semi-spacing": "off",
|
|
||||||
"sort-imports": "error",
|
|
||||||
"sort-keys": "off",
|
|
||||||
"sort-vars": "off",
|
|
||||||
"space-before-blocks": "off",
|
|
||||||
"space-before-function-paren": "off",
|
|
||||||
"space-in-parens": "off",
|
|
||||||
"space-infix-ops": "off",
|
|
||||||
"space-unary-ops": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"nonwords": false,
|
|
||||||
"words": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"spaced-comment": "off",
|
|
||||||
"strict": "off",
|
|
||||||
"symbol-description": "error",
|
|
||||||
"template-curly-spacing": "error",
|
|
||||||
"unicode-bom": [
|
|
||||||
"error",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"valid-jsdoc": "off",
|
|
||||||
"vars-on-top": "off",
|
|
||||||
"wrap-iife": "off",
|
|
||||||
"wrap-regex": "off",
|
|
||||||
"yield-star-spacing": "error",
|
|
||||||
"yoda": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+166
-165
@@ -1,188 +1,189 @@
|
|||||||
stages:
|
stages:
|
||||||
- setup
|
- setup
|
||||||
- audit
|
- audit
|
||||||
- lint
|
- lint
|
||||||
- test
|
- test
|
||||||
- publish
|
- publish
|
||||||
- deploy
|
- deploy
|
||||||
- cleanup
|
- cleanup
|
||||||
|
|
||||||
install:
|
install:
|
||||||
image: node:14
|
image: node:22
|
||||||
stage: setup
|
stage: setup
|
||||||
only:
|
only:
|
||||||
- pushes
|
- pushes
|
||||||
script:
|
script:
|
||||||
- npm ci
|
- npm ci
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
image: python:3.9
|
image: python:3.12.9
|
||||||
stage: audit
|
stage: audit
|
||||||
only:
|
allow_failure: true
|
||||||
- pushes
|
only:
|
||||||
needs: []
|
- pushes
|
||||||
before_script:
|
needs: []
|
||||||
- pip install poetry==1.3.1
|
before_script:
|
||||||
- poetry config virtualenvs.create false
|
- pip install poetry==2.0.1
|
||||||
- poetry install --no-interaction --no-ansi
|
- poetry config virtualenvs.create false
|
||||||
script:
|
- poetry install --no-interaction --no-ansi
|
||||||
- safety check
|
script:
|
||||||
|
- safety check
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: python:3.9
|
image: python:3.12.9
|
||||||
stage: test
|
stage: test
|
||||||
only:
|
only:
|
||||||
- pushes
|
- pushes
|
||||||
needs: []
|
needs: []
|
||||||
services:
|
services:
|
||||||
- postgres:12
|
- postgres:12
|
||||||
variables:
|
variables:
|
||||||
POSTGRES_DB: ci
|
POSTGRES_DB: ci
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
|
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
|
||||||
DB_HOST: postgres
|
DB_HOST: postgres
|
||||||
before_script:
|
before_script:
|
||||||
- pip install poetry==1.3.1
|
- pip install poetry==2.0.1
|
||||||
- poetry config virtualenvs.create false
|
- poetry config virtualenvs.create false
|
||||||
- poetry install --no-interaction --no-ansi
|
- poetry install --no-interaction --no-ansi
|
||||||
script:
|
script:
|
||||||
- python manage.py migrate --noinput
|
- python manage.py migrate --noinput
|
||||||
- python manage.py createdefaultadmin
|
- python manage.py createdefaultadmin
|
||||||
- python manage.py test
|
- python manage.py test
|
||||||
|
|
||||||
lint:py:
|
lint:py:
|
||||||
image: python:3.9
|
image: python:3.12.9
|
||||||
stage: lint
|
stage: lint
|
||||||
only:
|
only:
|
||||||
- pushes
|
- pushes
|
||||||
needs: []
|
needs: []
|
||||||
script:
|
script:
|
||||||
- pip install black==22.3.0
|
- pip install black==22.3.0
|
||||||
- black --check .
|
- black --check .
|
||||||
|
|
||||||
lint:js:
|
lint:js:
|
||||||
image: node:14
|
image: node:22
|
||||||
stage: lint
|
stage: lint
|
||||||
only:
|
only:
|
||||||
- pushes
|
- pushes
|
||||||
needs: ["install"]
|
needs: ["install"]
|
||||||
script:
|
script:
|
||||||
- npm run lint:js
|
- npm run lint:js
|
||||||
|
|
||||||
lint:md:
|
lint:md:
|
||||||
image: node:14
|
image: node:22
|
||||||
stage: lint
|
stage: lint
|
||||||
only:
|
only:
|
||||||
- pushes
|
- pushes
|
||||||
needs: ["install"]
|
needs: ["install"]
|
||||||
script:
|
script:
|
||||||
- npm run lint:md
|
- npm run lint:md
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
image: docker:25-cli
|
image: docker:25-cli
|
||||||
stage: publish
|
stage: publish
|
||||||
needs: ["test", "lint:py", "lint:js", "lint:md"]
|
needs: ["test", "lint:py", "lint:js", "lint:md"]
|
||||||
services:
|
services:
|
||||||
- docker:25-dind
|
- docker:25-dind
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
script:
|
script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
- docker build . -t "$IMAGE_NAME"
|
- docker build . -t "$IMAGE_NAME"
|
||||||
- docker push "$IMAGE_NAME"
|
- docker push "$IMAGE_NAME"
|
||||||
|
|
||||||
deploy:dev:
|
deploy:dev:
|
||||||
image: docker:25-cli
|
image: docker:25-cli
|
||||||
stage: deploy
|
stage: deploy
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
environment:
|
environment:
|
||||||
name: dev
|
name: dev
|
||||||
url: http://api.dev.sahkoinsinoorikilta.fi
|
url: http://api.dev.sahkoinsinoorikilta.fi
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: $DEV_CI_DOCKER_HOST
|
DOCKER_HOST: $DEV_CI_DOCKER_HOST
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p ~/.docker
|
- mkdir -p ~/.docker
|
||||||
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
|
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
|
||||||
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
|
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
|
||||||
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
|
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker stack deploy --with-registry-auth -c stack-compose-dev.yml "$SERVICE_NAME"
|
- docker stack deploy --with-registry-auth -c stack-compose-dev.yml "$SERVICE_NAME"
|
||||||
after_script:
|
after_script:
|
||||||
- docker logout "$CI_REGISTRY"
|
- docker logout "$CI_REGISTRY"
|
||||||
|
|
||||||
deploy:production:
|
deploy:production:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: docker:25-cli
|
image: docker:25-cli
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
environment:
|
environment:
|
||||||
name: production
|
name: production
|
||||||
url: https://api.sahkoinsinoorikilta.fi
|
url: https://api.sahkoinsinoorikilta.fi
|
||||||
when: manual
|
when: manual
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: $CI_DOCKER_HOST
|
DOCKER_HOST: $CI_DOCKER_HOST
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p ~/.docker
|
- mkdir -p ~/.docker
|
||||||
- echo "$TLSCACERT" > ~/.docker/ca.pem
|
- echo "$TLSCACERT" > ~/.docker/ca.pem
|
||||||
- echo "$TLSCERT" > ~/.docker/cert.pem
|
- echo "$TLSCERT" > ~/.docker/cert.pem
|
||||||
- echo "$TLSKEY" > ~/.docker/key.pem
|
- echo "$TLSKEY" > ~/.docker/key.pem
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker stack deploy --with-registry-auth -c stack-compose.yml "$SERVICE_NAME"
|
- docker stack deploy --with-registry-auth -c stack-compose.yml "$SERVICE_NAME"
|
||||||
after_script:
|
after_script:
|
||||||
- docker logout "$CI_REGISTRY"
|
- docker logout "$CI_REGISTRY"
|
||||||
|
|
||||||
docker_prune:dev:
|
docker_prune:dev:
|
||||||
image: docker:stable
|
image: docker:stable
|
||||||
stage: cleanup
|
stage: cleanup
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
environment:
|
environment:
|
||||||
name: dev
|
name: dev
|
||||||
url: http://api.dev.sahkoinsinoorikilta.fi
|
url: http://api.dev.sahkoinsinoorikilta.fi
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: $DEV_CI_DOCKER_HOST
|
DOCKER_HOST: $DEV_CI_DOCKER_HOST
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p ~/.docker
|
- mkdir -p ~/.docker
|
||||||
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
|
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
|
||||||
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
|
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
|
||||||
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
|
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker system prune
|
- docker system prune
|
||||||
after_script:
|
after_script:
|
||||||
- docker logout "$CI_REGISTRY"
|
- docker logout "$CI_REGISTRY"
|
||||||
|
|
||||||
docker_prune:prod:
|
docker_prune:prod:
|
||||||
image: docker:stable
|
image: docker:stable
|
||||||
stage: cleanup
|
stage: cleanup
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
environment:
|
environment:
|
||||||
name: production
|
name: production
|
||||||
url: https://api.sahkoinsinoorikilta.fi
|
url: https://api.sahkoinsinoorikilta.fi
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: $CI_DOCKER_HOST
|
DOCKER_HOST: $CI_DOCKER_HOST
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p ~/.docker
|
- mkdir -p ~/.docker
|
||||||
- echo "$TLSCACERT" > ~/.docker/ca.pem
|
- echo "$TLSCACERT" > ~/.docker/ca.pem
|
||||||
- echo "$TLSCERT" > ~/.docker/cert.pem
|
- echo "$TLSCERT" > ~/.docker/cert.pem
|
||||||
- echo "$TLSKEY" > ~/.docker/key.pem
|
- echo "$TLSKEY" > ~/.docker/key.pem
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker system prune
|
- docker system prune
|
||||||
after_script:
|
after_script:
|
||||||
- docker logout "$CI_REGISTRY"
|
- docker logout "$CI_REGISTRY"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
_
|
|
||||||
Executable → Regular
-3
@@ -1,6 +1,3 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
PURPLE='\033[0;35m'
|
PURPLE='\033[0;35m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
PURPLE='\033[0;35m'
|
PURPLE='\033[0;35m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
3.9
|
3.12.9
|
||||||
|
|||||||
+4
-3
@@ -1,13 +1,14 @@
|
|||||||
FROM python:3.9-slim-buster as builder
|
FROM python:3.12.9-slim-bullseye AS builder
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
ENV POETRY_VERSION=1.3.1
|
ENV POETRY_VERSION=2.0.1
|
||||||
|
|
||||||
RUN pip install "poetry==$POETRY_VERSION"
|
RUN pip install "poetry==$POETRY_VERSION"
|
||||||
|
RUN poetry self add poetry-plugin-export
|
||||||
RUN poetry export --without-hashes > requirements.txt
|
RUN poetry export --without-hashes > requirements.txt
|
||||||
|
|
||||||
FROM python:3.9-slim-buster as server
|
FROM python:3.12.9-slim-bullseye AS server
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
[Django](https://www.djangoproject.com/) backend containing multiple small applications and api for Next.js frontend.
|
[Django](https://www.djangoproject.com/) backend containing multiple small applications and api for Next.js frontend.
|
||||||
|
|
||||||
* **Web app:** Backend for the main website.
|
* **Web app:** Backend for the main website.
|
||||||
* **Member register:** Data table app for viewing and modifying the member register, member applications and membership payments.
|
* **Member register:** Data table app for viewing and modifying the member register, member applications and membership payments.
|
||||||
* **Kaehmy:** Form for creating and listing kaehmys
|
* **Kaehmy:** Form for creating and listing kaehmys
|
||||||
* **Ohlhafv:** Form for creating and listing ohlhafv challenges.
|
* **Ohlhafv:** Form for creating and listing ohlhafv challenges.
|
||||||
* **Infoscreen:** Angular-based slideshow app for the guild room's screens.
|
* **Infoscreen:** Angular-based slideshow app for the guild room's screens.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the development branch:
|
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the development branch:
|
||||||
@@ -18,6 +19,7 @@ git checkout develop
|
|||||||
```
|
```
|
||||||
|
|
||||||
Copy env file for local use:
|
Copy env file for local use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp .env.dev .env
|
cp .env.dev .env
|
||||||
```
|
```
|
||||||
@@ -29,20 +31,20 @@ For depedencies and virtual environment, we use [poetry](https://python-poetry.o
|
|||||||
First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry:
|
First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m pip install poetry==1.3.1
|
python -m pip install poetry==2.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD
|
The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m poetry config virtualenvs.in-project true
|
python -m poetry config virtualenvs.in-project true
|
||||||
```
|
```
|
||||||
|
|
||||||
### Node
|
### Node
|
||||||
|
|
||||||
We use Node.js for few development tasks, like linting. Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm). After installing install dependencies:
|
We use Node.js for few development tasks, like linting. Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm). After installing install dependencies:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -53,6 +55,7 @@ TODO: List scripts
|
|||||||
To run a local development database **[docker](https://docs.docker.com/engine/install/)** is recommended. If you want to additianally use a db management tool **[pgAdmin](https://www.pgadmin.org/download/)** is nice.
|
To run a local development database **[docker](https://docs.docker.com/engine/install/)** is recommended. If you want to additianally use a db management tool **[pgAdmin](https://www.pgadmin.org/download/)** is nice.
|
||||||
|
|
||||||
After installing docker use the following to create a database:
|
After installing docker use the following to create a database:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:12
|
docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:12
|
||||||
```
|
```
|
||||||
@@ -62,7 +65,7 @@ docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postg
|
|||||||
Activate virtual environment in shell
|
Activate virtual environment in shell
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m poetry shell
|
eval $(python -m poetry env activate)
|
||||||
```
|
```
|
||||||
|
|
||||||
Install dependencies
|
Install dependencies
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:12
|
image: postgres:12
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import globals from "globals";
|
||||||
|
import js from "@eslint/js";
|
||||||
|
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ["**/.venv/", "**/collected_static/", "**/static/js/lib/**"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.jquery,
|
||||||
|
angular: true,
|
||||||
|
moment: true,
|
||||||
|
_: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...js.configs.recommended
|
||||||
|
}
|
||||||
|
];
|
||||||
Generated
+4756
-3742
File diff suppressed because it is too large
Load Diff
+9
-7
@@ -9,7 +9,7 @@
|
|||||||
"lint:py": "black --diff --check .",
|
"lint:py": "black --diff --check .",
|
||||||
"lint:py:fix": "black .",
|
"lint:py:fix": "black .",
|
||||||
"lint:py-type": "pyright",
|
"lint:py-type": "pyright",
|
||||||
"prepare": "husky install"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -17,13 +17,15 @@
|
|||||||
},
|
},
|
||||||
"author": "SIK ry",
|
"author": "SIK ry",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.28.0",
|
"@eslint/js": "^9.20.0",
|
||||||
"husky": "^6.0.0",
|
"eslint": "^9.20.0",
|
||||||
|
"globals": "^15.14.0",
|
||||||
|
"husky": "^9.1.7",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"pyright": "^1.1.149",
|
"pyright": "^1.1.393",
|
||||||
"remark-cli": "^9.0.0",
|
"remark-cli": "^12.0.1",
|
||||||
"remark-preset-lint-recommended": "^5.0.0"
|
"remark-preset-lint-recommended": "^7.0.1"
|
||||||
},
|
},
|
||||||
"remarkConfig": {
|
"remarkConfig": {
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
Generated
+985
-784
File diff suppressed because it is too large
Load Diff
+53
-43
@@ -1,50 +1,60 @@
|
|||||||
[tool.poetry]
|
[project]
|
||||||
name = "web2.0-backend"
|
authors = [
|
||||||
version = "0.1.0"
|
{name = "Aarni Halinen", email = "aarni.halinen@sahkoinsinoorikilta.fi"},
|
||||||
|
]
|
||||||
description = "Backend for sahkoinsinoorikilta.fi"
|
description = "Backend for sahkoinsinoorikilta.fi"
|
||||||
authors = ["Aarni Halinen aarni.halinen@sahkoinsinoorikilta.fi"]
|
name = "web2.0-backend"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.12"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
dependencies = [
|
||||||
python = "^3.9"
|
"decorator (>=4.4.2,<5.0.0)",
|
||||||
decorator = "^4.0.9"
|
"Django (>=4.2.19,<5.0.0)",
|
||||||
Django = "^4.1"
|
"django-app-namespace-template-loader (>=0.4.1,<1.0.0)",
|
||||||
requests = "^2.28.1"
|
"django-auditlog (>=2.1.1,<3.0.0)",
|
||||||
django-cors-headers = "^3.13.0"
|
"django-autocomplete-light (>=3.4.1,<4.0.0)",
|
||||||
djangorestframework = "^3.12.4"
|
"django-bootstrap3 (>=21.2.0,<22.0.0)",
|
||||||
psycopg2-binary = "^2.9.3"
|
"django-cors-headers (>=3.13.0,<4.0.0)",
|
||||||
django-bootstrap3 = "^21.2"
|
"django-filter (>=22.1.0,<23.0.0)",
|
||||||
django-tables2 = "^2.4.1"
|
"django-import-export (>=2.8.0,<3.0.0)",
|
||||||
django-modeltranslation = "^0.18.4"
|
"django-modeltranslation (>=0.18.4,<1.0.0)",
|
||||||
django-auditlog = "^2.1.1"
|
"django-phonenumber-field[phonenumbers] (>=6.4.0,<7.0.0)",
|
||||||
django-phonenumber-field = {version = "^6.3.0", extras = ["phonenumbers"]}
|
"django-polymorphic (>=3.1.0,<4.0.0)",
|
||||||
django-autocomplete-light = "^3.4.1"
|
"django-tables2 (>=2.4.1,<3.0.0)",
|
||||||
six = "^1.12.0"
|
"djangorestframework (>=3.12.4,<4.0.0)",
|
||||||
pyexcel = "^0.7.0"
|
"djangorestframework-simplejwt (>=5.2.0,<6.0.0)",
|
||||||
pyexcel-xlsx = "^0.6.0"
|
"google-auth (>=2.9.1,<3.0.0)",
|
||||||
django-import-export = "^2.8.0"
|
"google-api-python-client (>=2.54.0,<3.0.0)",
|
||||||
openpyxl = "^2.6.4"
|
"gunicorn (>=20.1.0,<21.0.0)",
|
||||||
django-app-namespace-template-loader = "^0.4.1"
|
"jsonschema (>=4.9.0,<5.0.0)",
|
||||||
django-filter = "^22.1"
|
"Markdown (>=3.2.2,<4.0.0)",
|
||||||
whitenoise = "^6.2.0"
|
"openpyxl (>=2.6.4,<3.0.0)",
|
||||||
jsonschema = "^4.9.0"
|
"Pillow (>=10.0.0,<11.0.0)",
|
||||||
Markdown = "^3.2.2"
|
"psycopg2-binary (>=2.9.3,<3.0.0)",
|
||||||
uWSGI = "^2.0.18"
|
"pyexcel (>=0.7.0,<1.0.0)",
|
||||||
gunicorn = "^20.1.0"
|
"pyexcel-io (>=0.6.0,<1.0.0)",
|
||||||
Pillow = "^10.0.0"
|
"pyexcel-xlsx (>=0.6.0,<1.0.0)",
|
||||||
sendgrid = "^6.7.0"
|
"python-dotenv (>=0.20.0,<1.0.0)",
|
||||||
sentry-sdk = "^1.4.3"
|
"requests (>=2.28.1,<3.0.0)",
|
||||||
django-polymorphic = "^3.1.0"
|
"sendgrid (>=6.7.0,<7.0.0)",
|
||||||
python-dotenv = "^0.20.0"
|
"sentry-sdk (>=1.4.3,<2.0.0)",
|
||||||
djangorestframework-simplejwt = "^5.2.0"
|
"six (>=1.12.0,<2.0.0)",
|
||||||
google-auth = "^2.9.1"
|
"uWSGI (>=2.0.28,<3.0.0)",
|
||||||
google-api-python-client = "^2.54.0"
|
"whitenoise (>=6.2.0,<7.0.0)",
|
||||||
pyexcel-io = "^0.6.6"
|
]
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
black = "^25.1.0"
|
||||||
coverage = "^6.4.2"
|
coverage = "^6.4.2"
|
||||||
safety = "^2.1.1"
|
safety = "^2.3.4"
|
||||||
black = "^22.6.0"
|
|
||||||
|
[tool.poetry]
|
||||||
|
package-mode = false
|
||||||
|
|
||||||
|
[tool.poetry.requires-plugins]
|
||||||
|
poetry-plugin-export = "^1.9"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|||||||
+1
-1
@@ -12,5 +12,5 @@
|
|||||||
"reportMissingImports": true,
|
"reportMissingImports": true,
|
||||||
"reportMissingTypeStubs": false,
|
"reportMissingTypeStubs": false,
|
||||||
|
|
||||||
"pythonVersion": "3.9"
|
"pythonVersion": "3.12.9"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user