Compare commits
13 Commits
existing_v
...
BL3_Sanctu
Author | SHA1 | Date | |
---|---|---|---|
2aa87bae00 | |||
|
4599ca2ccd | ||
125cb732ee | |||
|
aae97ec78a | ||
|
f1845c7101 | ||
|
f56b7877dc | ||
|
181caf6092 | ||
|
e31f02cd38 | ||
|
123733def0 | ||
|
226a3a3856 | ||
|
6ec4d836cc | ||
|
4d394dc080 | ||
|
d541628920 |
5
.gitignore
vendored
@@ -4,4 +4,7 @@
|
|||||||
|
|
||||||
# Ignore python stuff
|
# Ignore python stuff
|
||||||
**/__pycache__
|
**/__pycache__
|
||||||
**/.pytest_cache
|
**/.pytest_cache
|
||||||
|
|
||||||
|
# Ignore les fichiers système de MacOS
|
||||||
|
**/.DS_Store
|
@@ -1,6 +1,5 @@
|
|||||||
include:
|
include:
|
||||||
- .gitlab/valid_set.yml
|
- .gitlab/*.yml
|
||||||
- .gitlab/missing_tag_set.yml
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- Manifest
|
- Manifest
|
||||||
@@ -10,8 +9,8 @@ stages:
|
|||||||
- Release
|
- Release
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
ENTRY_FOLDER: $CI_PROJECT_DIR/test # test directory for testing CI/CD, or assets directory for normal operations
|
ENTRY_FOLDER: assets
|
||||||
RELEASE_VERSION: v0.$CI_PIPELINE_IID
|
RELEASE_VERSION: v$CI_PIPELINE_IID
|
||||||
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${RELEASE_VERSION}"
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${RELEASE_VERSION}"
|
||||||
|
|
||||||
# Jobs from here run on Merge Requests as prerequisite for merging.
|
# Jobs from here run on Merge Requests as prerequisite for merging.
|
||||||
@@ -21,14 +20,13 @@ variables:
|
|||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: never
|
when: never
|
||||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- changes:
|
- changes:
|
||||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||||
script:
|
script:
|
||||||
- cd src/
|
- cd src/
|
||||||
- npm install
|
- npm install
|
||||||
- npm run start
|
- npm run start
|
||||||
- cat ${ENTRY_FOLDER}/${PACKAGE_NAME}/theme.json
|
- cat ../${ENTRY_FOLDER}/${PACKAGE_NAME}/theme.json
|
||||||
- npm run test
|
- npm run test
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
@@ -40,7 +38,6 @@ variables:
|
|||||||
stage: Test
|
stage: Test
|
||||||
image: python:latest
|
image: python:latest
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||||
changes:
|
changes:
|
||||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||||
@@ -56,7 +53,6 @@ variables:
|
|||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: never
|
when: never
|
||||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
changes:
|
changes:
|
||||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
32
.gitlab/BL2_frozen_wastelands.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
manifest-job/BL2_frozen_wastelands:
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL2_frozen_wastelands"
|
||||||
|
extends: .manifest-job
|
||||||
|
|
||||||
|
test-images-job/BL2_frozen_wastelands:
|
||||||
|
needs:
|
||||||
|
- manifest-job/BL2_frozen_wastelands
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL2_frozen_wastelands"
|
||||||
|
extends: .test-job
|
||||||
|
|
||||||
|
bundle-job/BL2_frozen_wastelands:
|
||||||
|
needs:
|
||||||
|
- manifest-job/BL2_frozen_wastelands
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL2_frozen_wastelands"
|
||||||
|
extends: .bundle-job
|
||||||
|
|
||||||
|
upload-job/BL2_frozen_wastelands:
|
||||||
|
needs:
|
||||||
|
- bundle-job/BL2_frozen_wastelands
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL2_frozen_wastelands"
|
||||||
|
extends: .upload-job
|
||||||
|
|
||||||
|
release-job/BL2_frozen_wastelands:
|
||||||
|
needs:
|
||||||
|
- upload-job/BL2_frozen_wastelands
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL2_frozen_wastelands"
|
||||||
|
extends: .release-job
|
32
.gitlab/BL3_Sanctuary_Bay.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
manifest-job/BL3_Sanctuary_Bay:
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL3_Sanctuary_Bay"
|
||||||
|
extends: .manifest-job
|
||||||
|
|
||||||
|
test-images-job/BL3_Sanctuary_Bay:
|
||||||
|
needs:
|
||||||
|
- manifest-job/BL3_Sanctuary_Bay
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL3_Sanctuary_Bay"
|
||||||
|
extends: .test-job
|
||||||
|
|
||||||
|
bundle-job/BL3_Sanctuary_Bay:
|
||||||
|
needs:
|
||||||
|
- manifest-job/BL3_Sanctuary_Bay
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL3_Sanctuary_Bay"
|
||||||
|
extends: .bundle-job
|
||||||
|
|
||||||
|
upload-job/BL3_Sanctuary_Bay:
|
||||||
|
needs:
|
||||||
|
- bundle-job/BL3_Sanctuary_Bay
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL3_Sanctuary_Bay"
|
||||||
|
extends: .upload-job
|
||||||
|
|
||||||
|
release-job/BL3_Sanctuary_Bay:
|
||||||
|
needs:
|
||||||
|
- upload-job/BL3_Sanctuary_Bay
|
||||||
|
variables:
|
||||||
|
PACKAGE_NAME: "BL3_Sanctuary_Bay"
|
||||||
|
extends: .release-job
|
@@ -1,32 +0,0 @@
|
|||||||
manifest-job/missing_tag_set:
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "missing_tag_set"
|
|
||||||
extends: .manifest-job
|
|
||||||
|
|
||||||
test-images-job/missing_tag_set:
|
|
||||||
needs:
|
|
||||||
- manifest-job/missing_tag_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "missing_tag_set"
|
|
||||||
extends: .test-job
|
|
||||||
|
|
||||||
bundle-job/missing_tag_set:
|
|
||||||
needs:
|
|
||||||
- manifest-job/missing_tag_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "missing_tag_set"
|
|
||||||
extends: .bundle-job
|
|
||||||
|
|
||||||
upload-job/missing_tag_set:
|
|
||||||
needs:
|
|
||||||
- bundle-job/missing_tag_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "missing_tag_set"
|
|
||||||
extends: .upload-job
|
|
||||||
|
|
||||||
release-job/missing_tag_set:
|
|
||||||
needs:
|
|
||||||
- upload-job/missing_tag_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "missing_tag_set"
|
|
||||||
extends: .release-job
|
|
@@ -1,32 +0,0 @@
|
|||||||
manifest-job/valid_set:
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "valid_set"
|
|
||||||
extends: .manifest-job
|
|
||||||
|
|
||||||
test-images-job/valid_set:
|
|
||||||
needs:
|
|
||||||
- manifest-job/valid_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "valid_set"
|
|
||||||
extends: .test-job
|
|
||||||
|
|
||||||
bundle-job/valid_set:
|
|
||||||
needs:
|
|
||||||
- manifest-job/valid_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "valid_set"
|
|
||||||
extends: .bundle-job
|
|
||||||
|
|
||||||
upload-job/valid_set:
|
|
||||||
needs:
|
|
||||||
- bundle-job/valid_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "valid_set"
|
|
||||||
extends: .upload-job
|
|
||||||
|
|
||||||
release-job/valid_set:
|
|
||||||
needs:
|
|
||||||
- upload-job/valid_set
|
|
||||||
variables:
|
|
||||||
PACKAGE_NAME: "valid_set"
|
|
||||||
extends: .release-job
|
|
67
.vscode/launch.json
vendored
@@ -12,7 +12,8 @@
|
|||||||
"start"
|
"start"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -51,10 +53,69 @@
|
|||||||
"--color=yes"
|
"--color=yes"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"justMyCode": true
|
"justMyCode": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Gen-Manifest existing_valid_theme_set",
|
||||||
|
"cwd": "${workspaceFolder}/src",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"start"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
|
},
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Test-Manifest existing_valid_theme_set",
|
||||||
|
"cwd": "${workspaceFolder}/src",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"run",
|
||||||
|
"test"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
|
},
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Test-Images existing_valid_theme_set",
|
||||||
|
"cwd": "${workspaceFolder}/src",
|
||||||
|
"console": "internalConsole",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"module": "pytest",
|
||||||
|
"args": [
|
||||||
|
"test_images.py",
|
||||||
|
"-rA",
|
||||||
|
"--tb=line",
|
||||||
|
"--color=yes"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||||
|
"ENTRY_FOLDER": "test",
|
||||||
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
|
},
|
||||||
|
"justMyCode": true
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_1.jpg
Normal file
After Width: | Height: | Size: 909 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_10.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_11.jpg
Normal file
After Width: | Height: | Size: 977 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_12.jpg
Normal file
After Width: | Height: | Size: 968 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_13.jpg
Normal file
After Width: | Height: | Size: 928 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_14.jpg
Normal file
After Width: | Height: | Size: 944 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_15.jpg
Normal file
After Width: | Height: | Size: 952 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_16.jpg
Normal file
After Width: | Height: | Size: 1002 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_17.jpg
Normal file
After Width: | Height: | Size: 892 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_18.jpg
Normal file
After Width: | Height: | Size: 876 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_19.jpg
Normal file
After Width: | Height: | Size: 935 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_2.jpg
Normal file
After Width: | Height: | Size: 942 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_20.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_21.jpg
Normal file
After Width: | Height: | Size: 996 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_22.jpg
Normal file
After Width: | Height: | Size: 878 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_23.jpg
Normal file
After Width: | Height: | Size: 947 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_3.jpg
Normal file
After Width: | Height: | Size: 980 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_4.jpg
Normal file
After Width: | Height: | Size: 954 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_5.jpg
Normal file
After Width: | Height: | Size: 1009 KiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_6.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_7.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/BL2_frozen_wastelands/BL2_frozen_wastelands_9.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_1.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_10.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_11.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_12.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_13.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_14.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_15.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_16.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_17.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_18.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_19.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_2.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_20.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_21.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_22.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_23.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_3.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_4.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_5.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_6.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_7.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_8.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
assets/BL3_Sanctuary_Bay/BL3_Sanctuary_Bay_9.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
@@ -1,18 +1,24 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const iptc = require("node-iptc");
|
const iptc = require("node-iptc");
|
||||||
|
const { exit } = require("process");
|
||||||
|
|
||||||
|
|
||||||
// find all images
|
// Fetch envs to target the right folder
|
||||||
const slug = process.env["PACKAGE_NAME"];
|
const workDir = process.env["CI_PROJECT_DIR"];
|
||||||
const root = process.env["ENTRY_FOLDER"];
|
const root = process.env["ENTRY_FOLDER"];
|
||||||
let workingDirectory = path.join(root, slug);
|
const slug = process.env["PACKAGE_NAME"];
|
||||||
|
if (!workDir || !slug || !root) exit(1);
|
||||||
|
let workingDirectory = path.join(workDir, root, slug);
|
||||||
|
|
||||||
// extract metadata from them
|
// extract metadata from them
|
||||||
fs.readdir(workingDirectory, (err, files) => {
|
fs.readdir(workingDirectory, (err, files) => {
|
||||||
if (err) { throw err };
|
if (err) { throw err }; // If IO error, exit with an error message
|
||||||
|
|
||||||
// construct a JSON file
|
// If there is already a theme.json silentely exit and let mocha running afterwards
|
||||||
|
if (files.find(file => path.extname(file) == '.json')) exit(0);
|
||||||
|
|
||||||
|
// construct a JSON object
|
||||||
let theme = new Object();
|
let theme = new Object();
|
||||||
theme.dayImageList = [];
|
theme.dayImageList = [];
|
||||||
theme.nightImageList = [];
|
theme.nightImageList = [];
|
||||||
@@ -63,7 +69,7 @@ fs.readdir(workingDirectory, (err, files) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// make it the theme.json
|
||||||
fs.writeFileSync(path.join(workingDirectory, 'theme.json'), JSON.stringify(theme));
|
fs.writeFileSync(path.join(workingDirectory, 'theme.json'), JSON.stringify(theme));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -33,11 +33,13 @@ function flatReferences(manifest) {
|
|||||||
|
|
||||||
describe('Mandatory Checks', function () {
|
describe('Mandatory Checks', function () {
|
||||||
before(function () {
|
before(function () {
|
||||||
|
const workDir = process.env["CI_PROJECT_DIR"];
|
||||||
|
expect(workDir).to.be.a("string").that.is.not.empty;
|
||||||
const slug = process.env["PACKAGE_NAME"];
|
const slug = process.env["PACKAGE_NAME"];
|
||||||
expect(slug).to.be.a("string").that.is.not.empty;
|
expect(slug).to.be.a("string").that.is.not.empty;
|
||||||
const root = process.env["ENTRY_FOLDER"];
|
const root = process.env["ENTRY_FOLDER"];
|
||||||
expect(root).to.be.a("string").that.is.not.empty;
|
expect(root).to.be.a("string").that.is.not.empty;
|
||||||
workingDirectory = path.join(root, slug);
|
workingDirectory = path.join(workDir, root, slug);
|
||||||
files = fs.readdirSync(workingDirectory);
|
files = fs.readdirSync(workingDirectory);
|
||||||
expect(files).to.be.an('array').that.is.not.empty;
|
expect(files).to.be.an('array').that.is.not.empty;
|
||||||
validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8')));
|
validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8')));
|
||||||
|
@@ -7,7 +7,7 @@ import os
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
def validate_brightness_image(working_path, theme_config, high_light, image_list, brightness_way):
|
def _validate_brightness_image(working_path, theme_config, high_light, image_list, brightness_way):
|
||||||
image_pattern = theme_config.get("imageFilename")
|
image_pattern = theme_config.get("imageFilename")
|
||||||
image_filenames = {}.fromkeys(glob.glob(str(Path(working_path, image_pattern))))
|
image_filenames = {}.fromkeys(glob.glob(str(Path(working_path, image_pattern))))
|
||||||
# generate an image statistics for each images
|
# generate an image statistics for each images
|
||||||
@@ -15,6 +15,7 @@ def validate_brightness_image(working_path, theme_config, high_light, image_list
|
|||||||
this_image = Image.open(an_imagefile).convert("L")
|
this_image = Image.open(an_imagefile).convert("L")
|
||||||
this_image_stats = ImageStat.Stat(this_image)
|
this_image_stats = ImageStat.Stat(this_image)
|
||||||
image_filenames[an_imagefile] = this_image_stats.mean[0]
|
image_filenames[an_imagefile] = this_image_stats.mean[0]
|
||||||
|
#print(f'{an_imagefile} : {image_filenames[an_imagefile]}')
|
||||||
|
|
||||||
# get the brightest observed image from the list
|
# get the brightest observed image from the list
|
||||||
if high_light == "dayHighlight":
|
if high_light == "dayHighlight":
|
||||||
@@ -39,9 +40,10 @@ def validate_brightness_image(working_path, theme_config, high_light, image_list
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def working_path():
|
def working_path():
|
||||||
# get the global variables containing gitlab-given project slug.
|
# get the global variables containing gitlab-given project slug.
|
||||||
|
work_directory = os.environ["CI_PROJECT_DIR"]
|
||||||
|
entry_folder = os.environ["ENTRY_FOLDER"]
|
||||||
project_slug = os.environ["PACKAGE_NAME"]
|
project_slug = os.environ["PACKAGE_NAME"]
|
||||||
root_folder = os.environ["ENTRY_FOLDER"]
|
working_path = Path(work_directory, entry_folder, project_slug)
|
||||||
working_path = Path(root_folder, project_slug)
|
|
||||||
if not working_path.is_dir():
|
if not working_path.is_dir():
|
||||||
raise FileNotFoundError(f"No project found for the given {working_path}.")
|
raise FileNotFoundError(f"No project found for the given {working_path}.")
|
||||||
return working_path
|
return working_path
|
||||||
@@ -54,11 +56,11 @@ def manifest(working_path):
|
|||||||
|
|
||||||
|
|
||||||
def test_brightest_image(working_path, manifest):
|
def test_brightest_image(working_path, manifest):
|
||||||
validate_brightness_image(working_path, manifest, "dayHighlight", "dayImageList", "Brightest")
|
_validate_brightness_image(working_path, manifest, "dayHighlight", "dayImageList", "Brightest")
|
||||||
|
|
||||||
|
|
||||||
def test_darkest_image(working_path, manifest):
|
def test_darkest_image(working_path, manifest):
|
||||||
validate_brightness_image(working_path, manifest, "nightHighlight", "nightImageList", "Darkest")
|
_validate_brightness_image(working_path, manifest, "nightHighlight", "nightImageList", "Darkest")
|
||||||
|
|
||||||
|
|
||||||
def test_image_size(working_path, manifest):
|
def test_image_size(working_path, manifest):
|
||||||
|
BIN
test/existing_valid_theme_set/stray__1.jpg
Normal file
After Width: | Height: | Size: 346 KiB |
BIN
test/existing_valid_theme_set/stray__2.jpg
Normal file
After Width: | Height: | Size: 422 KiB |
13
test/existing_valid_theme_set/theme.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"dayImageList": [
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"imageFilename": "stray__*.jpg",
|
||||||
|
"nightImageList": [
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"imageCredits": "©Thoscellen, ©BlueTwelve",
|
||||||
|
"sunriseImageList": [],
|
||||||
|
"displayName": "Stray",
|
||||||
|
"sunsetImageList": []
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"imageFilename": "bl3_landscape_*.jpg",
|
"imageFilename": "bl3_landscape_*.jpg",
|
||||||
|
"displayName": "BL3",
|
||||||
"imageCredits": "© Gearbox",
|
"imageCredits": "© Gearbox",
|
||||||
"displayName": "",
|
|
||||||
"dayImageList": [
|
"dayImageList": [
|
||||||
2
|
2
|
||||||
],
|
],
|
||||||
|
BIN
test/unbalanced_set/unbalanced_set_1.jpg
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
test/unbalanced_set/unbalanced_set_2.jpg
Normal file
After Width: | Height: | Size: 191 KiB |
BIN
test/unbalanced_set/unbalanced_set_3.jpg
Normal file
After Width: | Height: | Size: 158 KiB |