Compare commits
16 Commits
existing_v
...
cicd
Author | SHA1 | Date | |
---|---|---|---|
|
26c51d409f | ||
|
2c1137b590 | ||
797caf0678 | |||
ea9a4a6618 | |||
1d3c968ad9 | |||
fdaff717b0 | |||
bbdf05f4ce | |||
845f52ae33 | |||
4bab4c1b8a | |||
fba937b0d9 | |||
|
a28fea0cc7 | ||
|
e31f02cd38 | ||
|
123733def0 | ||
b24aa4bb54 | |||
|
226a3a3856 | ||
|
6ec4d836cc |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,3 +5,6 @@
|
||||
# Ignore python stuff
|
||||
**/__pycache__
|
||||
**/.pytest_cache
|
||||
|
||||
# Ignore les fichiers système de MacOS
|
||||
**/.DS_Store
|
@@ -9,7 +9,7 @@ stages:
|
||||
- Release
|
||||
|
||||
variables:
|
||||
ENTRY_FOLDER: $CI_PROJECT_DIR/test # test directory for testing CI/CD, or assets directory for normal operations
|
||||
ENTRY_FOLDER: test # test directory for testing CI/CD, or assets directory for normal operations
|
||||
RELEASE_VERSION: v0.$CI_PIPELINE_IID
|
||||
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${RELEASE_VERSION}"
|
||||
|
||||
@@ -18,16 +18,16 @@ variables:
|
||||
stage: Manifest
|
||||
image: node:latest
|
||||
rules:
|
||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
script:
|
||||
- cd src/
|
||||
- npm install
|
||||
- npm run start
|
||||
- cat ${ENTRY_FOLDER}/${PACKAGE_NAME}/theme.json
|
||||
- cat ../${ENTRY_FOLDER}/${PACKAGE_NAME}/theme.json
|
||||
- npm run test
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -39,7 +39,7 @@ variables:
|
||||
stage: Test
|
||||
image: python:latest
|
||||
rules:
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
@@ -53,17 +53,17 @@ variables:
|
||||
stage: Bundle
|
||||
image: javieraviles/zip:latest
|
||||
rules:
|
||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
script:
|
||||
- zip -j ${PACKAGE_NAME}.zip ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
- zip -j ${PACKAGE_NAME}.wdd ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
artifacts:
|
||||
paths:
|
||||
- ${PACKAGE_NAME}.zip
|
||||
- ${PACKAGE_NAME}.ddw
|
||||
when: on_success
|
||||
expire_in: "1 hour"
|
||||
|
||||
@@ -71,9 +71,9 @@ variables:
|
||||
stage: Distribute
|
||||
image: curlimages/curl:latest
|
||||
rules:
|
||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
@@ -81,26 +81,27 @@ variables:
|
||||
- |
|
||||
curl --fail \
|
||||
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
|
||||
--upload-file ${PACKAGE_NAME}.zip "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.zip?select=package_file"
|
||||
--upload-file ${PACKAGE_NAME}.ddw "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.ddw?select=package_file"
|
||||
|
||||
.release-job:
|
||||
stage: Release
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
#- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
script:
|
||||
- echo "Releasing assets for $PACKAGE_NAME"
|
||||
release:
|
||||
name: "Release $PACKAGE_NAME $RELEASE_VERSION"
|
||||
name: "Livrable $PACKAGE_NAME $RELEASE_VERSION"
|
||||
tag_name: "$PACKAGE_NAME.$RELEASE_VERSION"
|
||||
description: "Version $RELEASE_VERSION"
|
||||
ref: "$CI_COMMIT_SHA"
|
||||
assets:
|
||||
links:
|
||||
- name: ${PACKAGE_NAME}
|
||||
url: "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.zip"
|
||||
- name: ${PACKAGE_NAME}.ddw
|
||||
url: "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.ddw"
|
||||
link_type: package
|
||||
|
18
.vscode/launch.json
vendored
18
.vscode/launch.json
vendored
@@ -12,7 +12,8 @@
|
||||
"start"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "valid_set"
|
||||
},
|
||||
"skipFiles": [
|
||||
@@ -30,7 +31,8 @@
|
||||
"test"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "valid_set"
|
||||
},
|
||||
"skipFiles": [
|
||||
@@ -51,7 +53,8 @@
|
||||
"--color=yes"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "valid_set"
|
||||
},
|
||||
"justMyCode": true
|
||||
@@ -67,7 +70,8 @@
|
||||
"start"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||
},
|
||||
"skipFiles": [
|
||||
@@ -85,7 +89,8 @@
|
||||
"test"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||
},
|
||||
"skipFiles": [
|
||||
@@ -106,7 +111,8 @@
|
||||
"--color=yes"
|
||||
],
|
||||
"env": {
|
||||
"ENTRY_FOLDER": "${workspaceFolder}/test",
|
||||
"CI_PROJECT_DIR": "${workspaceFolder}",
|
||||
"ENTRY_FOLDER": "test",
|
||||
"PACKAGE_NAME": "existing_valid_theme_set"
|
||||
},
|
||||
"justMyCode": true
|
||||
|
@@ -5,10 +5,11 @@ const { exit } = require("process");
|
||||
|
||||
|
||||
// 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"];
|
||||
if (!slug || !root) exit(1);
|
||||
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
|
||||
fs.readdir(workingDirectory, (err, files) => {
|
||||
|
@@ -33,11 +33,13 @@ function flatReferences(manifest) {
|
||||
|
||||
describe('Mandatory Checks', 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"];
|
||||
expect(slug).to.be.a("string").that.is.not.empty;
|
||||
const root = process.env["ENTRY_FOLDER"];
|
||||
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);
|
||||
expect(files).to.be.an('array').that.is.not.empty;
|
||||
validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8')));
|
||||
|
@@ -40,9 +40,10 @@ def _validate_brightness_image(working_path, theme_config, high_light, image_lis
|
||||
@pytest.fixture
|
||||
def working_path():
|
||||
# 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"]
|
||||
root_folder = os.environ["ENTRY_FOLDER"]
|
||||
working_path = Path(root_folder, project_slug)
|
||||
working_path = Path(work_directory, entry_folder, project_slug)
|
||||
if not working_path.is_dir():
|
||||
raise FileNotFoundError(f"No project found for the given {working_path}.")
|
||||
return working_path
|
||||
|
@@ -2,12 +2,12 @@
|
||||
"dayImageList": [
|
||||
1
|
||||
],
|
||||
"imageFilename": "stray__*.jpg",
|
||||
"nightImageList": [
|
||||
2
|
||||
],
|
||||
"sunsetImageList": [],
|
||||
"sunriseImageList": [],
|
||||
"imageFilename": "stray__*.jpg",
|
||||
"imageCredits": "©Thoscellen, ©BlueTwelve",
|
||||
"displayName": "Stray"
|
||||
"sunriseImageList": [],
|
||||
"displayName": "Stray",
|
||||
"sunsetImageList": []
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"imageFilename": "bl3_landscape_*.jpg",
|
||||
"imageCredits": "© Gearbox",
|
||||
"displayName": "BL3",
|
||||
"imageCredits": "© Gearbox",
|
||||
"dayImageList": [
|
||||
2
|
||||
],
|
||||
|
Reference in New Issue
Block a user