Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps/update #94

Merged
merged 13 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
node-version: '18'

- name: Install system packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- uses: isort/[email protected]
with:
requirementsFiles: requirements/dev.txt
Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements/dev.txt
Expand Down
50 changes: 31 additions & 19 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,72 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ "master" ]
schedule:
- cron: '36 20 * * 6'
- cron: '33 22 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
language: [ 'javascript-typescript', 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '18'
- name: Install dependencies
run: npm install -g openapi-to-postmanv2
- name: Create tests folder
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '18'
- name: Install dependencies
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
Expand All @@ -34,12 +34,12 @@ jobs:
- name: Generate Java client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/java -g java --additional-properties=dateLibrary=java8,java8=true,optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate .NET Core client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/netcore -g csharp-netcore --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate .NET Full Framework client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
# - name: Generate .NET Core client
# run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
# -o ./sdks/netcore -g csharp-netcore --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
# - name: Generate .NET Full Framework client
# run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
# -o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate Python client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/python -g python --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false+
2 changes: 1 addition & 1 deletion .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '18'
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1 - Compile needed python dependencies
FROM python:3.9-slim-bullseye AS build
FROM python:3.10-slim-bullseye AS build

RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
Expand All @@ -10,28 +10,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /app

COPY ./requirements /app/requirements
RUN pip install pip 'setuptools<59.0' -U
RUN pip install pip -U
RUN pip install -r requirements/production.txt


# Stage 2 - build frontend
FROM mhart/alpine-node:12 AS frontend-build
FROM node:18-alpine AS frontend-build

WORKDIR /app

COPY ./*.json /app/
RUN npm ci

COPY ./gulpfile.js ./webpack.config.js ./.babelrc /app/
COPY ./webpack.config.js ./.babelrc /app/
COPY ./build /app/build/

COPY src/objecttypes/sass/ /app/src/objecttypes/sass/
COPY src/objecttypes/scss/ /app/src/objecttypes/scss/
COPY src/objecttypes/js/ /app/src/objecttypes/js/
RUN npm run build


# Stage 3 - Build docker image suitable for execution and deployment
FROM python:3.9-slim-bullseye AS production
FROM python:3.10-slim-bullseye AS production

# Stage 3.1 - Set up the needed production dependencies
# install all the dependencies for GeoDjango
Expand All @@ -49,16 +49,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gdal-bin \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=build /usr/local/lib/python3.10 /usr/local/lib/python3.10
COPY --from=build /usr/local/bin/uwsgi /usr/local/bin/uwsgi

# Stage 3.2 - Copy source code
WORKDIR /app
COPY ./bin/docker_start.sh /start.sh
RUN mkdir /app/log /app/config

COPY --from=frontend-build /app/src/objecttypes/static/css /app/src/objecttypes/static/css
COPY --from=frontend-build /app/src/objecttypes/static/js /app/src/objecttypes/static/js
COPY --from=frontend-build /app/src/objecttypes/static /app/src/objecttypes/static
COPY ./src /app/src

RUN useradd -M -u 1000 user
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prerequisites

You need the following libraries and/or programs:

* `Python`_ 3.9 or above
* `Python`_ 3.10 or above
* Python `Virtualenv`_ and `Pip`_
* `PostgreSQL`_ 10 or above
* `Node.js`_
Expand Down
38 changes: 11 additions & 27 deletions build/paths.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
var path = require('path');
var fs = require('fs');
const fs = require('fs');


/** Parses package.json */
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));

/** Name of the sources directory */
var sourcesRoot = 'src/' + pkg.name + '/';
/** Src dir */
const sourcesRoot = 'src/' + pkg.name + '/';

/** Name of the static (source) directory */
var staticRoot = sourcesRoot + 'static/';
/** "Main" static dir */
const staticRoot = sourcesRoot + 'static/';


/**
Expand All @@ -19,32 +18,23 @@ module.exports = {
// Parsed package.json
package: pkg,

// Path to the sass (sources) directory
sassSrcDir: sourcesRoot + 'sass/',
// Path to the scss entry point
scssEntry: sourcesRoot + 'scss/screen.scss',

// Path to the sass (sources) entry point
sassSrc: sourcesRoot + 'sass/**/*.scss',

// Path to the (transpiled) css directory
cssDir: staticRoot + 'css/',

// Path to the fonts directory
fontsDir: staticRoot + 'fonts/',
// Path to the scss (sources) directory
scssSrcDir: sourcesRoot + 'scss/',

// Path to the js entry point (source)
jsEntry: sourcesRoot + 'js/index.js',

// Path to the js (sources) directory
jsSrcDir: sourcesRoot + 'js/',

// Path to js (sources)
jsSrc: sourcesRoot + 'js/**/*.js',

// Path to the js (sources) directory
jsSrcDir: sourcesRoot + 'js/',

// Path to the (transpiled) js directory
jsDir: staticRoot + 'js/',
jsDir: staticRoot + 'bundles/',

// Path to js spec (test) files
jsSpec: sourcesRoot + 'jstests/**/*.spec.js',
Expand All @@ -54,10 +44,4 @@ module.exports = {

// Path to js code coverage directory
coverageDir: 'reports/jstests/',

// Path to HTML templates directory
htmlTemplatesDir: sourcesRoot + 'templates/views',

// Path to HTML includes directory
htmlIncludesDir: sourcesRoot + 'templates/components/'
};
8 changes: 0 additions & 8 deletions build/tasks/build.js

This file was deleted.

Loading
Loading