... | @@ -57,4 +57,45 @@ To lesser the burden on administrator, logging into the [OAI Jenkins server](htt |
... | @@ -57,4 +57,45 @@ To lesser the burden on administrator, logging into the [OAI Jenkins server](htt |
|
|
|
|
|
Developer wanting to access will require a GitHub account. This will be used to track who is logging onto the server.
|
|
Developer wanting to access will require a GitHub account. This will be used to track who is logging onto the server.
|
|
|
|
|
|
**CAUTION: since the Server Certificate is incorrect, please add a SSL-check exception to your web browser for OAI Jenkins service** |
|
**CAUTION: since the Server Certificate is incorrect, please add a SSL-check exception to your web browser for OAI Jenkins service**
|
|
\ No newline at end of file |
|
|
|
|
|
# 4. Declarative Pipeline linter #
|
|
|
|
|
|
|
|
When developing your Jenkins Declarative Pipeline script inside your GIT repo, it is difficult to make sure your syntax is correct but push to central repository and perform a Jenkins build.
|
|
|
|
|
|
|
|
Jenkins has a CLI interface with a Declarative Pipeline linter service.
|
|
|
|
|
|
|
|
For me, I develop in a Virtual Machine with Ubuntu 16.04. I've installed a inactive Jenkins service (inactive in the sense I don't have any active project in it).
|
|
|
|
|
|
|
|
## 4.1. VM Jenkins User Setup ##
|
|
|
|
|
|
|
|
* In your Jenkins dashboard, click on **People** from the left navigation.
|
|
|
|
* Select your user:
|
|
|
|
* In my case, my **Jenkins User Id** is `rdefossej`
|
|
|
|
* Click on **Configure**. You should see
|
|
|
|
<img src="../images/jenkins-people-config1.png" alt="" border=3>
|
|
|
|
* Scroll down to the password/SSH public keys sections
|
|
|
|
* Copy the public keys from your `~/.ssh/id_rsa.pub` into the field like followed:
|
|
|
|
<img src="../images/jenkins-people-config1.png" alt="" border=3>
|
|
|
|
|
|
|
|
## 4.2. VM Jenkins Security Setup ##
|
|
|
|
|
|
|
|
* In your Jenkins dashboard, click on **Manage Jenkins** from the left navigation.
|
|
|
|
* Select **Configure Global Security** section
|
|
|
|
* Scroll down to **SSH Server** section
|
|
|
|
* I selected the fixed port choice and put 8084.
|
|
|
|
<img src="../images/jenkins-ssh-config.png" alt="" border=3>
|
|
|
|
|
|
|
|
## 4.3. Using the linter ##
|
|
|
|
|
|
|
|
On your prompt:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ ssh -p 8084 -l rdefossej localhost declarative-linter < ci-scripts/Jenkinsfile-gitlab
|
|
|
|
Jenkinsfile successfully validated.
|
|
|
|
```
|
|
|
|
|
|
|
|
where:
|
|
|
|
|
|
|
|
* `8084` is the SSH server port you setup in section 4.2.
|
|
|
|
* `rdefossej` is the Jenkins User Id in section 4.1. |