Compare commits

...

8 Commits

Author SHA1 Message Date
Simon
aae97ec78a Merge branch 'BL2_frozen_wastelands' into 'main'
feat(#5): Publie le set "Frozen Wastelands"

See merge request Thoscellen/Wallset!10
2023-05-18 22:09:47 +00:00
Simon
f1845c7101 feat(#5): Publie le set "Frozen Wastelands" 2023-05-18 22:09:46 +00:00
Simon
f56b7877dc Merge branch 'BL2_frozen_wasteland' into 'main'
See merge request Thoscellen/Wallset!8
2023-05-18 21:40:52 +00:00
Simon
181caf6092 Publie le set "Frozen Wastelands" 2023-05-18 21:40:52 +00:00
Simon
e31f02cd38 Merge branch 'cicd' into 'main'
Tente un fixe pour la pipeline.

See merge request Thoscellen/Wallset!9
2023-05-18 21:17:34 +00:00
Simon
123733def0 Tente un fixe pour la pipeline. 2023-05-18 21:17:34 +00:00
Simon
226a3a3856 Merge branch 'cicd' into 'main'
Règle la CI pour se déclencher après une demande de fusion

See merge request Thoscellen/Wallset!7
2023-05-18 13:15:09 +00:00
Simon
6ec4d836cc Règle la CI pour se déclencher après une demande de fusion 2023-05-18 13:15:09 +00:00
35 changed files with 66 additions and 152 deletions

5
.gitignore vendored
View File

@@ -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

View File

@@ -9,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.
@@ -20,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:
@@ -39,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}/*
@@ -55,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}/*

View 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

View File

@@ -1,32 +0,0 @@
manifest-job/existing_valid_theme_set:
variables:
PACKAGE_NAME: "existing_valid_theme_set"
extends: .manifest-job
test-images-job/existing_valid_theme_set:
needs:
- manifest-job/existing_valid_theme_set
variables:
PACKAGE_NAME: "existing_valid_theme_set"
extends: .test-job
bundle-job/existing_valid_theme_set:
needs:
- manifest-job/existing_valid_theme_set
variables:
PACKAGE_NAME: "existing_valid_theme_set"
extends: .bundle-job
upload-job/existing_valid_theme_set:
needs:
- bundle-job/existing_valid_theme_set
variables:
PACKAGE_NAME: "existing_valid_theme_set"
extends: .upload-job
release-job/existing_valid_theme_set:
needs:
- upload-job/existing_valid_theme_set
variables:
PACKAGE_NAME: "existing_valid_theme_set"
extends: .release-job

View File

@@ -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

View File

@@ -1,32 +0,0 @@
manifest-job/unbalanced_set:
variables:
PACKAGE_NAME: "unbalanced_set"
extends: .manifest-job
test-images-job/unbalanced_set:
needs:
- manifest-job/unbalanced_set
variables:
PACKAGE_NAME: "unbalanced_set"
extends: .test-job
bundle-job/unbalanced_set:
needs:
- manifest-job/unbalanced_set
variables:
PACKAGE_NAME: "unbalanced_set"
extends: .bundle-job
upload-job/unbalanced_set:
needs:
- bundle-job/unbalanced_set
variables:
PACKAGE_NAME: "unbalanced_set"
extends: .upload-job
release-job/unbalanced_set:
needs:
- upload-job/unbalanced_set
variables:
PACKAGE_NAME: "unbalanced_set"
extends: .release-job

View File

@@ -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

18
.vscode/launch.json vendored
View File

@@ -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,7 +53,8 @@
"--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
@@ -67,7 +70,8 @@
"start" "start"
], ],
"env": { "env": {
"ENTRY_FOLDER": "${workspaceFolder}/test", "CI_PROJECT_DIR": "${workspaceFolder}",
"ENTRY_FOLDER": "test",
"PACKAGE_NAME": "existing_valid_theme_set" "PACKAGE_NAME": "existing_valid_theme_set"
}, },
"skipFiles": [ "skipFiles": [
@@ -85,7 +89,8 @@
"test" "test"
], ],
"env": { "env": {
"ENTRY_FOLDER": "${workspaceFolder}/test", "CI_PROJECT_DIR": "${workspaceFolder}",
"ENTRY_FOLDER": "test",
"PACKAGE_NAME": "existing_valid_theme_set" "PACKAGE_NAME": "existing_valid_theme_set"
}, },
"skipFiles": [ "skipFiles": [
@@ -106,7 +111,8 @@
"--color=yes" "--color=yes"
], ],
"env": { "env": {
"ENTRY_FOLDER": "${workspaceFolder}/test", "CI_PROJECT_DIR": "${workspaceFolder}",
"ENTRY_FOLDER": "test",
"PACKAGE_NAME": "existing_valid_theme_set" "PACKAGE_NAME": "existing_valid_theme_set"
}, },
"justMyCode": true "justMyCode": true

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -5,10 +5,11 @@ const { exit } = require("process");
// Fetch envs to target the right folder // 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"];
if (!slug || !root) exit(1); const slug = process.env["PACKAGE_NAME"];
let workingDirectory = path.join(root, slug); 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) => {

View File

@@ -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')));

View File

@@ -40,9 +40,10 @@ def _validate_brightness_image(working_path, theme_config, high_light, image_lis
@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

View File

@@ -2,12 +2,12 @@
"dayImageList": [ "dayImageList": [
1 1
], ],
"imageFilename": "stray__*.jpg",
"nightImageList": [ "nightImageList": [
2 2
], ],
"sunsetImageList": [],
"sunriseImageList": [],
"imageFilename": "stray__*.jpg",
"imageCredits": "©Thoscellen, ©BlueTwelve", "imageCredits": "©Thoscellen, ©BlueTwelve",
"displayName": "Stray" "sunriseImageList": [],
"displayName": "Stray",
"sunsetImageList": []
} }

View File

@@ -1,7 +1,7 @@
{ {
"imageFilename": "bl3_landscape_*.jpg", "imageFilename": "bl3_landscape_*.jpg",
"displayName": "BL3",
"imageCredits": "© Gearbox", "imageCredits": "© Gearbox",
"displayName": "",
"dayImageList": [ "dayImageList": [
2 2
], ],