mirror of
https://gitlab.com/Thoscellen/Wallset.git
synced 2025-05-31 19:04:51 +02:00
Merge branch 'main' into 'cicd'
This commit is contained in:
commit
530e2763d9
104
.gitlab-ci.yml
Normal file
104
.gitlab-ci.yml
Normal file
@ -0,0 +1,104 @@
|
||||
include:
|
||||
- .gitlab/*.yml
|
||||
|
||||
stages:
|
||||
- Manifest
|
||||
- Test
|
||||
- Bundle
|
||||
- Distribute
|
||||
- Release
|
||||
|
||||
variables:
|
||||
ENTRY_FOLDER: $CI_PROJECT_DIR/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}"
|
||||
|
||||
# Jobs from here run on Merge Requests as prerequisite for merging.
|
||||
.manifest-job:
|
||||
stage: Manifest
|
||||
image: node:latest
|
||||
rules:
|
||||
- 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
|
||||
- npm run test
|
||||
artifacts:
|
||||
paths:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/theme.json
|
||||
when: on_success
|
||||
expire_in: "1 hour"
|
||||
|
||||
.test-job:
|
||||
stage: Test
|
||||
image: python:latest
|
||||
rules:
|
||||
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd"
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
script:
|
||||
- pip install -U pytest pillow iteration_utilities
|
||||
- python -m pytest src/test_images.py --tb=line -rA --color=yes
|
||||
allow_failure: true
|
||||
|
||||
# Jobs from here run Merged_results or Push/Merge Commits to the main branch. Tag is created on release so no run with tag creation
|
||||
.bundle-job:
|
||||
stage: Bundle
|
||||
image: javieraviles/zip:latest
|
||||
rules:
|
||||
- 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}/*
|
||||
artifacts:
|
||||
paths:
|
||||
- ${PACKAGE_NAME}.zip
|
||||
when: on_success
|
||||
expire_in: "1 hour"
|
||||
|
||||
.upload-job:
|
||||
stage: Distribute
|
||||
image: curlimages/curl:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
changes:
|
||||
- ${ENTRY_FOLDER}/${PACKAGE_NAME}/*
|
||||
script:
|
||||
- |
|
||||
curl --fail \
|
||||
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
|
||||
--upload-file ${PACKAGE_NAME}.zip "${PACKAGE_REGISTRY_URL}/${PACKAGE_NAME}.zip?select=package_file"
|
||||
|
||||
.release-job:
|
||||
stage: Release
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- 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"
|
||||
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"
|
32
.gitlab/existing_valid_theme_set.yml
Normal file
32
.gitlab/existing_valid_theme_set.yml
Normal file
@ -0,0 +1,32 @@
|
||||
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
|
32
.gitlab/unbalanced_set.yml
Normal file
32
.gitlab/unbalanced_set.yml
Normal file
@ -0,0 +1,32 @@
|
||||
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
|
BIN
test/existing_valid_theme_set/stray__1.jpg
Normal file
BIN
test/existing_valid_theme_set/stray__1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 346 KiB |
BIN
test/existing_valid_theme_set/stray__2.jpg
Normal file
BIN
test/existing_valid_theme_set/stray__2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 422 KiB |
13
test/existing_valid_theme_set/theme.json
Normal file
13
test/existing_valid_theme_set/theme.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"dayImageList": [
|
||||
1
|
||||
],
|
||||
"nightImageList": [
|
||||
2
|
||||
],
|
||||
"sunsetImageList": [],
|
||||
"sunriseImageList": [],
|
||||
"imageFilename": "stray__*.jpg",
|
||||
"imageCredits": "©Thoscellen, ©BlueTwelve",
|
||||
"displayName": "Stray"
|
||||
}
|
BIN
test/unbalanced_set/unbalanced_set_1.jpg
Normal file
BIN
test/unbalanced_set/unbalanced_set_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
BIN
test/unbalanced_set/unbalanced_set_2.jpg
Normal file
BIN
test/unbalanced_set/unbalanced_set_2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 KiB |
BIN
test/unbalanced_set/unbalanced_set_3.jpg
Normal file
BIN
test/unbalanced_set/unbalanced_set_3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
Loading…
x
Reference in New Issue
Block a user