diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 117be9208e66c699a3e494103a160474f5c5b528..d2b7d363b7bd9593c735eee9b9874d11bd4adf71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,16 +41,19 @@ workflow: pylint: extends: .analyze script: + - cd scripts - pylint --rcfile=pylintrc *.py black: extends: .analyze script: + - cd scripts - black --diff --check *.py executable: extends: .analyze script: + - cd scripts - (! find ! -executable -name "*.py" -exec echo "not executable:"" {}" \; | grep .) yamllint: @@ -111,7 +114,7 @@ yamllint: MERGE: "" script: - cd ${CI_PROJECT_DIR} - - ./deploy_gitlab_ci.py + - scripts/deploy_gitlab_ci.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} diff --git a/ci-test-manifest-integration.yml b/ci-test-manifest-integration.yml index b49a45fbcd2d137dec14dd3ffd1eb00302b5b864..fa5e7628e9c5a8478a1d38fd74709f2209f7d9f1 100644 --- a/ci-test-manifest-integration.yml +++ b/ci-test-manifest-integration.yml @@ -79,7 +79,7 @@ integrate: else MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}"; fi - - .gitlab-ci/integrate_into_manifest.py + - .gitlab-ci/scripts/integrate_into_manifest.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} @@ -103,7 +103,7 @@ merge: - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT script: - cd ${CI_PROJECT_DIR} - - .gitlab-ci/merge_into_manifest.py + - .gitlab-ci/scripts/merge_into_manifest.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} diff --git a/ci-test-manifest.yml b/ci-test-manifest.yml index 7907b4bbd471e8fb77d71889948a7c1b69b40e16..ef2a2eb54a266d9bb8cd687e99f3b270842a6d3c 100644 --- a/ci-test-manifest.yml +++ b/ci-test-manifest.yml @@ -45,7 +45,7 @@ retrigger: - if: $CI_COMMIT_REF_NAME == $MASTER_BRANCH_MANIFEST && $CI_PIPELINE_SOURCE != "api" script: - PROJECTS=$( - .gitlab-ci/get_manifest_projects.py + .gitlab-ci/scripts/get_manifest_projects.py --manifest=default.xml --remote=ci-test ) @@ -55,7 +55,7 @@ retrigger: # Retrigger also project in SRCREV - echo -e "Projects:\n${PROJECTS}" - for PROJECT in ${PROJECTS}; do - .gitlab-ci/retrigger_mr_pipeline_jobs.py + .gitlab-ci/scripts/retrigger_mr_pipeline_jobs.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${PROJECT} @@ -166,7 +166,7 @@ build:merge_request: script: - cd ${CI_PROJECT_DIR} # Get pipeline for merge request - - MR_PIPELINE=$(.gitlab-ci/get_pipelines.py + - MR_PIPELINE=$(.gitlab-ci/scripts/get_pipelines.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} @@ -174,14 +174,14 @@ build:merge_request: --ref=^${MASTER_BRANCH_MANIFEST} || true | head -1) # If pipeline exists, mirror its result - if [ ! -z "${MR_PIPELINE}" ]; then - .gitlab-ci/mirror_pipeline_result.py + .gitlab-ci/scripts/mirror_pipeline_result.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} --pipeline=${MR_PIPELINE} # If no pipeline found, trigger a new one on the master - else - .gitlab-ci/trigger_pipeline.py + .gitlab-ci/scripts/trigger_pipeline.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} @@ -269,7 +269,7 @@ test:fail: RELEASE="Yocto-dunfell-15.0/" INSTALLSCRIPT_ABS="$DEPLOYPATH_TEST/$RELEASE/$CI_PARAM_MACHINE/fng-install.sh" FNG_INSTALL_URL="${INSTALLSCRIPT_ABS#/*/}" - .gitlab-ci/submit_test.py \ + .gitlab-ci/scripts/submit_test.py \ --fng-install "${FNG_INSTALL_URL}" \ --name \ "Gitlab build test ${CI_PARAM_MACHINE} ${RELEASE} ${CI_PIPELINE_ID}" \ diff --git a/common.yml b/common.yml index 774d8a2a2829b35adb23f9c5316fd10b8a44e154..ea0ccf608c890b3aac22ca028769da89e914406b 100644 --- a/common.yml +++ b/common.yml @@ -85,7 +85,7 @@ yamllint: - if [ -n "${parent_merge_request}" ];then PARENT_MR="--parent-merge-request=${parent_merge_request}"; fi - - .gitlab-ci/check_if_integration_branch_is_up_to_date.py + - .gitlab-ci/scripts/check_if_integration_branch_is_up_to_date.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} diff --git a/manifest-build.yml b/manifest-build.yml index 4b9d0726c0cb6bc78dc21f9a645cc10161e28248..697dc69120e1acbfe1161757bf5e8378dcd24a59 100644 --- a/manifest-build.yml +++ b/manifest-build.yml @@ -126,6 +126,6 @@ variables: - |- # Copy artifacts to local server for automated tests echo "${LOGPREFIX} Copy files for automated tests using package_release" - .gitlab-ci/package_release.py \ + .gitlab-ci/scripts/package_release.py \ --images-dir="${BUILDPATH}/${IMAGEPATH}" \ --outputdir-local="${DEPLOYPATH_TEST}" diff --git a/manifest-integration.yml b/manifest-integration.yml index eb2fc5bb5e38c077753118683ad31102ef5ae51c..e3670a2676543429f357c711d3601b54213b2fd0 100644 --- a/manifest-integration.yml +++ b/manifest-integration.yml @@ -66,7 +66,7 @@ integrate: else MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}"; fi - - .gitlab-ci/integrate_into_manifest.py + - .gitlab-ci/scripts/integrate_into_manifest.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} @@ -90,7 +90,7 @@ merge: - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT script: - cd ${CI_PROJECT_DIR} - - .gitlab-ci/merge_into_manifest.py + - .gitlab-ci/scripts/merge_into_manifest.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --manifest-project=${MANIFEST_PROJECT} diff --git a/manifest-package.yml b/manifest-package.yml index 55b721ffc1818b58ef74cf15e844535a970b113e..3ac3edbc05c7a08f02ff1f6429f48bc2bba8ebb8 100644 --- a/manifest-package.yml +++ b/manifest-package.yml @@ -56,7 +56,7 @@ echo "${LOGPREFIX} outdir=${outdir}" # Check if the package_release script is available - script=".gitlab-ci/package_release.py" + script=".gitlab-ci/scripts/package_release.py" # Change script path if ? [ ! -x "${script}" ] && script=".repo/manifests/${script}" if [ ! -x "${script}" ]; then @@ -93,7 +93,7 @@ # - a release tag is set # - this is an image build and # - the files were deployed to local network (drive Z) - apscript=".gitlab-ci/alphaplan_fwr.py" + apscript=".gitlab-ci/scripts/alphaplan_fwr.py" echo "${LOGPREFIX} Check if AlphaPlan FWR articles need to be generated" if [ -n "$CI_COMMIT_TAG" ] && [ -d "${ARTIFACTS_IMAGE_PATH}" ] && \ [[ "${CI_PARAM_PACKAGE_FTP}" == "false" ]];then diff --git a/manifest.yml b/manifest.yml index 9a78952849d67b3061e7aad5d4df9e26b914f2af..52c32d3a04f3a990164da69836226fd44b0d7a56 100644 --- a/manifest.yml +++ b/manifest.yml @@ -54,7 +54,7 @@ retrigger: - if: $CI_COMMIT_REF_NAME == $MASTER_BRANCH_MANIFEST && $CI_PIPELINE_SOURCE != "api" script: - PROJECTS=$( - .gitlab-ci/get_manifest_projects.py + .gitlab-ci/scripts/get_manifest_projects.py --manifest=default.xml --remote=seco-ne --concat-namespaces @@ -65,7 +65,7 @@ retrigger: # Retrigger also project in SRCREV - echo -e "Projects:\n${PROJECTS}" - for PROJECT in ${PROJECTS}; do - .gitlab-ci/retrigger_mr_pipeline_jobs.py + .gitlab-ci/scripts/retrigger_mr_pipeline_jobs.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${PROJECT} @@ -83,7 +83,7 @@ changelog: extends: .infrastructure rules: - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST || $CI_PIPELINE_SOURCE == "api" - script: .gitlab-ci/changelog_generator.py + script: .gitlab-ci/scripts/changelog_generator.py --token=${GITBOT_TOKEN} --branch ${MASTER_BRANCH_MANIFEST} > changelog.md @@ -138,7 +138,7 @@ build:merge_request: script: - cd ${CI_PROJECT_DIR} # Get pipeline for merge request - - MR_PIPELINE=$(.gitlab-ci/get_pipelines.py + - MR_PIPELINE=$(.gitlab-ci/scripts/get_pipelines.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} @@ -146,14 +146,14 @@ build:merge_request: --ref=^${MASTER_BRANCH_MANIFEST} || true | head -1) # If pipeline exists, mirror its result - if [ ! -z "${MR_PIPELINE}" ]; then - .gitlab-ci/mirror_pipeline_result.py + .gitlab-ci/scripts/mirror_pipeline_result.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} --pipeline=${MR_PIPELINE} # If no pipeline found, trigger a new one on the master - else - .gitlab-ci/trigger_pipeline.py + .gitlab-ci/scripts/trigger_pipeline.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} @@ -210,7 +210,7 @@ build:merge_request: RELEASE=$(ls ${DEPLOYPATH_TEST}/) INSTALLSCRIPT_ABS="$DEPLOYPATH_TEST/$RELEASE/$CI_PARAM_MACHINE/fng-install.sh" FNG_INSTALL_URL="${ARTIFACTS_HOST_URL}/${INSTALLSCRIPT_ABS#/*/}" - .gitlab-ci/submit_test.py \ + .gitlab-ci/scripts/submit_test.py \ --fng-install "${FNG_INSTALL_URL}" \ --name \ "Gitlab build test ${CI_PARAM_MACHINE} ${RELEASE} ${CI_PIPELINE_ID}" \ diff --git a/accept_merge_request.py b/scripts/accept_merge_request.py similarity index 100% rename from accept_merge_request.py rename to scripts/accept_merge_request.py diff --git a/alphaplan_fwr.py b/scripts/alphaplan_fwr.py similarity index 100% rename from alphaplan_fwr.py rename to scripts/alphaplan_fwr.py diff --git a/alphaplan_keys.py b/scripts/alphaplan_keys.py similarity index 100% rename from alphaplan_keys.py rename to scripts/alphaplan_keys.py diff --git a/changelog_generator.py b/scripts/changelog_generator.py similarity index 100% rename from changelog_generator.py rename to scripts/changelog_generator.py diff --git a/check_if_integration_branch_is_up_to_date.py b/scripts/check_if_integration_branch_is_up_to_date.py similarity index 100% rename from check_if_integration_branch_is_up_to_date.py rename to scripts/check_if_integration_branch_is_up_to_date.py diff --git a/common.py b/scripts/common.py similarity index 100% rename from common.py rename to scripts/common.py diff --git a/convert_md2html.py b/scripts/convert_md2html.py similarity index 100% rename from convert_md2html.py rename to scripts/convert_md2html.py diff --git a/create_merge_request.py b/scripts/create_merge_request.py similarity index 100% rename from create_merge_request.py rename to scripts/create_merge_request.py diff --git a/deploy_gitlab_ci.py b/scripts/deploy_gitlab_ci.py similarity index 100% rename from deploy_gitlab_ci.py rename to scripts/deploy_gitlab_ci.py diff --git a/generate_job_from_template.py b/scripts/generate_job_from_template.py similarity index 100% rename from generate_job_from_template.py rename to scripts/generate_job_from_template.py diff --git a/generate_release_metadata.py b/scripts/generate_release_metadata.py similarity index 100% rename from generate_release_metadata.py rename to scripts/generate_release_metadata.py diff --git a/get_current_revision_from_manifest.py b/scripts/get_current_revision_from_manifest.py similarity index 100% rename from get_current_revision_from_manifest.py rename to scripts/get_current_revision_from_manifest.py diff --git a/get_manifest_projects.py b/scripts/get_manifest_projects.py similarity index 100% rename from get_manifest_projects.py rename to scripts/get_manifest_projects.py diff --git a/get_merge_requests.py b/scripts/get_merge_requests.py similarity index 100% rename from get_merge_requests.py rename to scripts/get_merge_requests.py diff --git a/get_pipelines.py b/scripts/get_pipelines.py similarity index 100% rename from get_pipelines.py rename to scripts/get_pipelines.py diff --git a/integrate_into_manifest.py b/scripts/integrate_into_manifest.py similarity index 100% rename from integrate_into_manifest.py rename to scripts/integrate_into_manifest.py diff --git a/merge_into_manifest.py b/scripts/merge_into_manifest.py similarity index 100% rename from merge_into_manifest.py rename to scripts/merge_into_manifest.py diff --git a/mirror_pipeline_result.py b/scripts/mirror_pipeline_result.py similarity index 100% rename from mirror_pipeline_result.py rename to scripts/mirror_pipeline_result.py diff --git a/package_release.py b/scripts/package_release.py similarity index 100% rename from package_release.py rename to scripts/package_release.py diff --git a/pylintrc b/scripts/pylintrc similarity index 100% rename from pylintrc rename to scripts/pylintrc diff --git a/retrigger_mr_pipeline_job.py b/scripts/retrigger_mr_pipeline_job.py similarity index 100% rename from retrigger_mr_pipeline_job.py rename to scripts/retrigger_mr_pipeline_job.py diff --git a/retrigger_mr_pipeline_jobs.py b/scripts/retrigger_mr_pipeline_jobs.py similarity index 100% rename from retrigger_mr_pipeline_jobs.py rename to scripts/retrigger_mr_pipeline_jobs.py diff --git a/submit_test.py b/scripts/submit_test.py similarity index 100% rename from submit_test.py rename to scripts/submit_test.py diff --git a/trigger_pipeline.py b/scripts/trigger_pipeline.py similarity index 100% rename from trigger_pipeline.py rename to scripts/trigger_pipeline.py diff --git a/update_submodule.py b/scripts/update_submodule.py similarity index 100% rename from update_submodule.py rename to scripts/update_submodule.py