.gitlab-ci.yml 3.74 KB
Newer Older
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
1
image:
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
2
  name: acscommunity/acs
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
3
  entrypoint: [""]
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
4
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
5
6


Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
23
24
25
26
27
28
29



#code_quality:
#  services:            # Shut off Docker-in-Docker
#  tags:
#    - cq-astri     # Set this job to only run on our new specialized runner
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
30
31
32

  #variables:
    #CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.18"
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
33

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
34
35
#  artifacts:
#    paths: [gl-code-quality-report.json]
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
36

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
37
38
39
40
41
42
#code_quality_html:
#  extends: code_quality
#  variables:
#    REPORT_FORMAT: html
#  artifacts:
#    paths: [gl-code-quality-report.html]
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
43

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
44
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
45
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
46
47
48
#secondpipe:
#  trigger:
#    include: secondpipe/.pipe.yml
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
49
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
50
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
51
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
52
53
#include:
#  template: Jobs/Code-Quality.gitlab-ci.yml
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
54

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
55
56
57
#code_quality:
#  variables:
#    CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.18"
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
58

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
59
60
#  artifacts:
#    paths: [gl-code-quality-report.json]
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
61

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
62
63
64
65
66
67
#code_quality_html:
#  extends: code_quality
#  variables:
#    REPORT_FORMAT: html
#  artifacts:
#    paths: [gl-code-quality-report.html]
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
68

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
69

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
70
#before_script:
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
71
72
73
74
  ##
  ## Install ssh-agent if not already installed, it is required by Docker.
  ## (change apt-get to yum if you use an RPM-based image)
  ##
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
75
  #- 'command -v ssh-agent >/dev/null || ( yum install openssh-client -y )'
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
76
77
78
79

  ##
  ## Run ssh-agent (inside the build environment)
  ##
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
80
  #- eval $(ssh-agent -s)
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
81
82
83
84
85
86
87

  ##
  ## 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
  ##
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
88
  #- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
89
90
91
92

  ##
  ## Create the SSH directory and give it the right permissions
  ##
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
93
94
  #- mkdir -p ~/.ssh
  #- chmod 700 ~/.ssh
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
95

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
96
97
  #- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
  #- chmod 644 ~/.ssh/known_hosts
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
98

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
99
  #- cat  ~/.ssh/known_hosts
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
100
101
102
103
104
105
106
  ##
  ## 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"

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
107
  #- ssh-add -l
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
108

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
109
  #- git clone https://gitlab+deploy-token-4:xbVhzmdfzYd4eRuwH3G4@www.ict.inaf.it/gitlab/nicolo.parmiggiani/test_ci3.git
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
110

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
111
 # - ls -la test_ci3
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
112

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
113
114
115
116
117
build-job:
  stage: build
  script:
    - echo "Hello, $GITLAB_USER_LOGIN!"

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
118
test-job:
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
119
120
  stage: test
  script:
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
121
122
123
124
125
126
127
128
    - echo "test 1"

#test-job1:
#  stage: test
#  script:
#    - echo "This job tests something"
#    - source /alma/ACS-2020AUG/ACSSW/config/.acs/.bash_profile.acs
#    - acsStart
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
129
  
Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
130

Nicolo Parmiggiani's avatar
Nicolo Parmiggiani committed
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#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."