Skip to content
.gitlab-ci.yml 4.51 KiB
Newer Older
image:
  name: acscommunity/acs
  entrypoint: [""]
#sonarqube-check:
#  image: 
#    name: sonarsource/sonar-scanner-cli:latest
#    entrypoint: [""]
#  variables:
#    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
#    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
#  cache:
#    key: "${CI_JOB_NAME}"
#    paths:
#      - .sonar/cache
#  script: 
#    - sonar-scanner
#  allow_failure: true
#  only:
#    - master # or the name of your main branch
include:
  - template: Code-Quality.gitlab-ci.yml
code_quality:
  services:            # Shut off Docker-in-Docker
  tags:
    - cq-astri     # Set this job to only run on our new specialized runner
  variables:
    CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:latest"
  artifacts:
    paths: [gl-code-quality-report.json]
code_quality_html:
  extends: code_quality
  variables:
    REPORT_FORMAT: html
  artifacts:
    paths: public/jobs/${CI_JOB_ID}/artifacts/gl-code-quality-report.html
 
code_quality_html2:
  extends: code_quality
  variables:
    REPORT_FORMAT: html
  artifacts:
    paths: [public/jobs/${CI_JOB_ID}/artifacts/gl-code-quality-report.html]
 
pages:
  stage: deploy
  script:
    - mkdir -p public/jobs/${CI_JOB_ID}/artifacts
    - cp gl-code-quality-report.html public/jobs/${CI_JOB_ID}/artifacts
  artifacts:
    paths:
      - public
#secondpipe:
#  rules:
#    - if: $CI_PIPELINE_SOURCE == "push"
#      when: manual
#  trigger:
#    include: secondpipe/.pipe.yml
#include:
#  template: Jobs/Code-Quality.gitlab-ci.yml
#code_quality:
#  variables:
#    CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.18"
#  artifacts:
#    paths: [gl-code-quality-report.json]
#code_quality_html:
#  extends: code_quality
#  variables:
#    REPORT_FORMAT: html
#  artifacts:
#    paths: [gl-code-quality-report.html]
#before_script:
  ##
  ## Install ssh-agent if not already installed, it is required by Docker.
  ## (change apt-get to yum if you use an RPM-based image)
  ##
  #- 'command -v ssh-agent >/dev/null || ( yum install openssh-client -y )'

  ##
  ## Run ssh-agent (inside the build environment)
  ##
  #- eval $(ssh-agent -s)

  ##
  ## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
  ## We're using tr to fix line endings which makes ed25519 keys work
  ## without extra base64 encoding.
  ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
  ##
  #- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -

  ##
  ## Create the SSH directory and give it the right permissions
  ##
  #- mkdir -p ~/.ssh
  #- chmod 700 ~/.ssh
  #- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
  #- chmod 644 ~/.ssh/known_hosts
  #- cat  ~/.ssh/known_hosts
  ##
  ## Optionally, if you will be using any Git commands, set the user name and
  ## and email.
  ##
  # - git config --global user.email "user@example.com"
  # - git config --global user.name "User name"

  #- ssh-add -l
  #- git clone https://gitlab+deploy-token-4:xbVhzmdfzYd4eRuwH3G4@www.ict.inaf.it/gitlab/nicolo.parmiggiani/test_ci3.git
 # - ls -la test_ci3
#job:on-schedule:
#  rules:
#    - if: $CI_PIPELINE_SOURCE == "schedule"
#  stage: build
#  script:
#    - echo "Hello, Scheduled job"

#build-job:
#  rules:
#    - if: $CI_PIPELINE_SOURCE == "push"
#  stage: build
#  script:
#    - echo "Hello, $GITLAB_USER_LOGIN!"

#test-job:
#  rules:
#    - if: $CI_PIPELINE_SOURCE == "push"
#      when: manual
#  stage: test
#  script:
#    - echo "test 1"

#test-job1:
#  stage: test
#  script:
#    - echo "This job tests something"
#    - source /alma/ACS-2020AUG/ACSSW/config/.acs/.bash_profile.acs
#    - acsStart
#test-job2:
#  stage: test
#  script:
#    - echo "This job tests something, but takes more time than test-job1."
#    - echo "After the echo commands complete, it runs the sleep command for 20 seconds"
#    - echo "which simulates a test that runs 20 seconds longer than test-job1"
#    - git clone https://www.ict.inaf.it/gitlab/astri/scada/tcs.git


#test-job3:
#  stage: test
#  script:
#    - echo "This job tests something, but takes more time than test-job1."
#    - echo "After the echo commands complete, it runs the sleep command for 20 seconds"
#    - echo "which simulates a test that runs 20 seconds longer than test-job1"
#    - git clone git@git.ia2.inaf.it:nicolo.parmiggiani/test_ci_2.git
#    - ls -la 

#deploy-prod:
#  stage: deploy
#  script:
#    - echo "This job deploys something from the $CI_COMMIT_BRANCH branch."