Compare commits
10 Commits
cicd
...
valid_set.
Author | SHA1 | Date | |
---|---|---|---|
13595b7d83 | |||
7630ff3cb9 | |||
b0e8a7e463 | |||
daffbf4def | |||
b7469e8fc5 | |||
6198e5a746 | |||
50ad227bd5 | |||
801cba845f | |||
7208719d05 | |||
|
421015ae2d |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,7 +4,4 @@
|
|||||||
|
|
||||||
# Ignore python stuff
|
# Ignore python stuff
|
||||||
**/__pycache__
|
**/__pycache__
|
||||||
**/.pytest_cache
|
**/.pytest_cache
|
||||||
|
|
||||||
# Ignore les fichiers système de MacOS
|
|
||||||
**/.DS_Store
|
|
@@ -9,7 +9,7 @@ stages:
|
|||||||
- Release
|
- Release
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
ENTRY_FOLDER: test # test directory for testing CI/CD, or assets directory for normal operations
|
ENTRY_FOLDER: $CI_PROJECT_DIR/test # test directory for testing CI/CD, or assets directory for normal operations
|
||||||
RELEASE_VERSION: v0.$CI_PIPELINE_IID
|
RELEASE_VERSION: v0.$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}"
|
||||||
|
|
||||||
@@ -18,16 +18,16 @@ variables:
|
|||||||
stage: Manifest
|
stage: Manifest
|
||||||
image: node:latest
|
image: node:latest
|
||||||
rules:
|
rules:
|
||||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- 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 +39,7 @@ variables:
|
|||||||
stage: Test
|
stage: Test
|
||||||
image: python:latest
|
image: python:latest
|
||||||
rules:
|
rules:
|
||||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
- 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}/*
|
||||||
@@ -53,17 +53,17 @@ variables:
|
|||||||
stage: Bundle
|
stage: Bundle
|
||||||
image: javieraviles/zip:latest
|
image: javieraviles/zip:latest
|
||||||
rules:
|
rules:
|
||||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- 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}/*
|
||||||
script:
|
script:
|
||||||
- zip -j ${PACKAGE_NAME}.wdd ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
- zip -j ${PACKAGE_NAME}.zip ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- ${PACKAGE_NAME}.ddw
|
- ${PACKAGE_NAME}.zip
|
||||||
when: on_success
|
when: on_success
|
||||||
expire_in: "1 hour"
|
expire_in: "1 hour"
|
||||||
|
|
||||||
@@ -71,9 +71,9 @@ variables:
|
|||||||
stage: Distribute
|
stage: Distribute
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
rules:
|
rules:
|
||||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- 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}/*
|
||||||
@@ -81,27 +81,26 @@ variables:
|
|||||||
- |
|
- |
|
||||||
curl --fail \
|
curl --fail \
|
||||||
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
|
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
|
||||||
--upload-file ${PACKAGE_NAME}.ddw "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.ddw?select=package_file"
|
--upload-file ${PACKAGE_NAME}.zip "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.zip?select=package_file"
|
||||||
|
|
||||||
.release-job:
|
.release-job:
|
||||||
stage: Release
|
stage: Release
|
||||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
rules:
|
rules:
|
||||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
|
||||||
- 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}/*
|
||||||
script:
|
script:
|
||||||
- echo "Releasing assets for $PACKAGE_NAME"
|
- echo "Releasing assets for $PACKAGE_NAME"
|
||||||
release:
|
release:
|
||||||
name: "Livrable $PACKAGE_NAME $RELEASE_VERSION"
|
name: "Release $PACKAGE_NAME $RELEASE_VERSION"
|
||||||
tag_name: "$PACKAGE_NAME.$RELEASE_VERSION"
|
tag_name: "$PACKAGE_NAME.$RELEASE_VERSION"
|
||||||
description: "Version $RELEASE_VERSION"
|
description: "Version $RELEASE_VERSION"
|
||||||
ref: "$CI_COMMIT_SHA"
|
ref: "$CI_COMMIT_SHA"
|
||||||
assets:
|
assets:
|
||||||
links:
|
links:
|
||||||
- name: ${PACKAGE_NAME}.ddw
|
- name: ${PACKAGE_NAME}
|
||||||
url: "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.ddw"
|
url: "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.zip"
|
||||||
link_type: package
|
|
||||||
|
18
.vscode/launch.json
vendored
18
.vscode/launch.json
vendored
@@ -12,8 +12,7 @@
|
|||||||
"start"
|
"start"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -31,8 +30,7 @@
|
|||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -53,8 +51,7 @@
|
|||||||
"--color=yes"
|
"--color=yes"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "valid_set"
|
"PACKAGE_NAME": "valid_set"
|
||||||
},
|
},
|
||||||
"justMyCode": true
|
"justMyCode": true
|
||||||
@@ -70,8 +67,7 @@
|
|||||||
"start"
|
"start"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -89,8 +85,7 @@
|
|||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
},
|
},
|
||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
@@ -111,8 +106,7 @@
|
|||||||
"--color=yes"
|
"--color=yes"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||||
"ENTRY_FOLDER": "test",
|
|
||||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||||
},
|
},
|
||||||
"justMyCode": true
|
"justMyCode": true
|
||||||
|
@@ -5,11 +5,10 @@ const { exit } = require("process");
|
|||||||
|
|
||||||
|
|
||||||
// Fetch envs to target the right folder
|
// Fetch envs to target the right folder
|
||||||
const workDir = process.env["CI_PROJECT_DIR"];
|
|
||||||
const root = process.env["ENTRY_FOLDER"];
|
|
||||||
const slug = process.env["PACKAGE_NAME"];
|
const slug = process.env["PACKAGE_NAME"];
|
||||||
if (!workDir || !slug || !root) exit(1);
|
const root = process.env["ENTRY_FOLDER"];
|
||||||
let workingDirectory = path.join(workDir, root, slug);
|
if (!slug || !root) exit(1);
|
||||||
|
let workingDirectory = path.join(root, slug);
|
||||||
|
|
||||||
// extract metadata from them
|
// extract metadata from them
|
||||||
fs.readdir(workingDirectory, (err, files) => {
|
fs.readdir(workingDirectory, (err, files) => {
|
||||||
|
@@ -33,13 +33,11 @@ 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(workDir, root, slug);
|
workingDirectory = path.join(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')));
|
||||||
|
@@ -40,10 +40,9 @@ 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"]
|
||||||
working_path = Path(work_directory, entry_folder, project_slug)
|
root_folder = os.environ["ENTRY_FOLDER"]
|
||||||
|
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
|
||||||
|
@@ -2,12 +2,12 @@
|
|||||||
"dayImageList": [
|
"dayImageList": [
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"imageFilename": "stray__*.jpg",
|
|
||||||
"nightImageList": [
|
"nightImageList": [
|
||||||
2
|
2
|
||||||
],
|
],
|
||||||
"imageCredits": "©Thoscellen, ©BlueTwelve",
|
"sunsetImageList": [],
|
||||||
"sunriseImageList": [],
|
"sunriseImageList": [],
|
||||||
"displayName": "Stray",
|
"imageFilename": "stray__*.jpg",
|
||||||
"sunsetImageList": []
|
"imageCredits": "©Thoscellen, ©BlueTwelve",
|
||||||
|
"displayName": "Stray"
|
||||||
}
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"imageFilename": "bl3_landscape_*.jpg",
|
"imageFilename": "bl3_landscape_*.jpg",
|
||||||
"displayName": "BL3",
|
|
||||||
"imageCredits": "© Gearbox",
|
"imageCredits": "© Gearbox",
|
||||||
|
"displayName": "BL3",
|
||||||
"dayImageList": [
|
"dayImageList": [
|
||||||
2
|
2
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user