Commit 1a9b1556 authored by GridexX's avatar GridexX Committed by Thomas Boni
Browse files

chore: delete unused jobs



Signed-off-by: default avatarGridexX <arsene582@gmail.com>
parent e983945a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -35,6 +35,11 @@ ci_linter:
    - git fetch
    - JOBS_TEMPLATE_CHANGED=$(git diff-tree --no-commit-id --name-only -r origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -r $CI_COMMIT_SHA | tr ' ' '\n' | grep "jobs/.*${JOB_FILES_EXTENSION}$" | tr '\n' ' ')
    - for JOB_PATH in $JOBS_TEMPLATE_CHANGED; do
    # Check if the file still exists in the current branch and ignore it if it doesn't
    -   if ! git ls-files --error-unmatch ${JOB_PATH} > /dev/null 2>&1; then
    -     echo "👎 job ${JOB_PATH} has been deleted"
    -     continue
    -   fi
    -   echo "Start checking ${JOB_PATH} using Gitlab CI linter API"
    -   JOB=$(basename ${JOB_PATH})
      # Loop over all GitLab CI linter API URLs until one of them is working
@@ -127,6 +132,11 @@ ci_linter:
    -   JOBS=$(git diff-tree --no-commit-id --name-only -r origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -r $CI_COMMIT_SHA | tr ' ' '\n' | grep "jobs/.*${JOB_FILES_EXTENSION}$" | tr '\n' ' ' | cut -d'/' -f2)
    - fi
    - for JOB in $JOBS; do
    # Check if the file still exists in the current branch and ignore it if it doesn't
    -   if ! git ls-files --error-unmatch ${JOB} > /dev/null 2>&1; then
    -     echo "👎 job ${JOB} has been deleted"
    -     continue
    -   fi
    -   IMAGE=$(pipenv run python3 tools/job_image/job_image.py ${JOB})
    -   if [ ! -z ${IMAGE} ]; then
    -     NAME=$(basename ${IMAGE})

deployer.r2.yml

deleted100644 → 0
+0 −13
Original line number Diff line number Diff line
files:
  template: ./jobs/deployer/deployer.yml
  documentation: ./jobs/deployer/README.md
  changelog: ./jobs/deployer/CHANGELOG.md
data:
  description: A ready-to-use job to deploy PHP projects using Deployer
  public: true
  license: MIT
  icon: 🔧
  labels:
    - Utilities
    - PHP
    - Deploy

dusk_test.r2.yml

deleted100644 → 0
+0 −13
Original line number Diff line number Diff line
files:
  template: ./jobs/dusk_test/dusk_test.yml
  documentation: ./jobs/dusk_test/README.md
  changelog: ./jobs/dusk_test/CHANGELOG.md
data:
  description: A ready to use Laravel Dusk job to test your project
  public: true
  license: MIT
  icon: 💡
  labels:
    - Test
    - Utilities
    - Laravel

jobs/deployer/CHANGELOG.md

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [0.2.2] - 2023-03-07
* Tag this job as deprecated

## [0.2.1] - 2023-02-28
* Fix broken documentation links

## [0.2.0] - 2022-07-28
* Add docker image tag in variable 

## [0.1.0] - 2021-04-30
* Initial version

jobs/deployer/README.md

deleted100644 → 0
+0 −100
Original line number Diff line number Diff line
## Objective

!!! error "This job is deprecated 🚨"
    The job is no more maintained and is now deprecated. Despites it still exists to keep working on pipelines.

Deploy your PHP project using [Deployer](https://deployer.org/){:target="_blank"}

## How to use it

1. Copy/paste job URL in `include` list of your `.gitlab-ci.yml` (see the [quick use](https://docs.r2devops.io/get-started/use-templates/#use-a-template)). You can specify [a fixed version](https://docs.r2devops.io/get-started/use-templates/#versioning) instead of `latest`.
1. Set the secret variable `SSH_PRIVATE_KEY` and `SSH_KNOWN_HOSTS`as CI/CD variables in [your Gitlab project](https://docs.gitlab.com/ee/ci/variables/README.html#project-cicd-variables){:target="_blank"}
   if you need encrypted variables.

    !!! info
        `SSH_KNOWN_HOSTS` needs to contain the same data that we find in the file `.ssh/known_hosts`, this step is needed so that the SSH connection doesn't ask to add the server to `.ssh/known_hosts` as you wouldn't be able to interact with the terminal.

1. Make sure that you have the deployer config file (`deploy.php` or `deploy.yaml`) in the root folder of your project, More info in [this guide](https://deployer.org/docs/7.x/getting-started){:target="_blank"}
1. If you need to customize other part of the job (stage, variables, ...) 👉
   check the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization)
1. Well done, your job is ready to work ! 😀

## Example of `deploy.php` file

```php
<?php

namespace Deployer;

// Include the Laravel recipe
require 'recipe/laravel.php';

set('application', getenv('CI_PROJECT_NAME')); // Configure from gitlab's env vars
set('ssh_multiplexing', true); // Speed up deployment

// Hosts
host('production.app.com') // Name of the server
    ->hostname('165.22.242.104') // Hostname or IP address
    ->stage('production') // Deployment stage (production, staging, etc)
    ->user('deploy') // SSH user
    ->set('deploy_path', '/var/www'); // Deploy path

// Tasks

desc('Deploy the application');
task('deploy', [
    'deploy:info',
    'deploy:prepare',
    'deploy:lock',
    'deploy:release',
    'deploy:shared',
    'deploy:vendors',
    'deploy:writable',
    'artisan:storage:link', // |
    'artisan:view:cache',   // |
    'artisan:config:cache', // | Laravel specific steps
    'artisan:optimize',     // |
    'artisan:migrate',      // |
    'deploy:symlink',
    'deploy:unlock',
    'cleanup',
]);
```

## Variables

!!! info
    All variables can be set using [Gitlab CI/CD
    variables](https://docs.gitlab.com/ee/ci/variables/README.html#project-cicd-variables) to
    avoid exposing them in clear text in your `.gitlab-ci.yml`. This is recommended
    for sensitive parameters such as `SSH_KNOWN_HOSTS` and it's **HIGHLY**
    recommended for secret variable `SSH_PRIVATE_KEY`.

| Name | Description | Mandatory | Default |
| ---- | ----------- | --------- | ------- |
| `SSH_PRIVATE_KEY` | Private SSH key to login on the `host` server | yes | ` `
| `SSH_KNOWN_HOSTS` | List of known_hosts for a seamless deployment | yes | ` `
| `PROJECT_ROOT` | Path to the directory containing `deploy.php` or `deploy.yaml` | no | `.` |
| `DEPLOY_OPTIONS` | Additional options for command `dep deploy` | no | ` ` |
| `DEPLOYER_OUTPUT` | Name for logs file | no | `deployer_output.txt` |
| `IMAGE_TAG` | The default tag for the docker image | `7.3-alpine`  |

## Artifacts

* If deployment succeeds: the job succeeds with the output as artifact
* If deployment fails: the job fails with the output as artifact

`dep deploy`'s output is available as artifact.

!!! warning
    It's also [exposed
    as](https://docs.gitlab.com/ee/ci/yaml/#artifactsexpose_as){:target="_blank"}
    `Deployer output` in merge requests.  Exposition of artifact currently works
    only if you keep `DEPLOYER_OUTPUT` default value because of [this issue
    from
    Gitlab](https://gitlab.com/gitlab-org/gitlab/-/issues/37129){:target="_blank"}.
    As soon as the issue will be fixed, exposed artifacts will be available
    with any output location.

## Author
This resource is an **[official job](https://docs.r2devops.io/get-started/faq/#use-a-template)** added in [**R2Devops repository**](https://gitlab.com/r2devops/hub) by [@moha-s](https://gitlab.com/moha-s)
Loading