You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-16Lines changed: 42 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ Testing your Rails project on every change should be a smooth process. With Jenk
7
7
### Rails Project
8
8
9
9
This pipeline job assumes your project has the following:
10
+
10
11
- Capistrano based deployments
11
12
- Uses a single database the is cleaned up after each build
12
13
- Testing is done on a single node without docker
@@ -16,26 +17,33 @@ This pipeline job assumes your project has the following:
16
17
If you're new to Jenkins pipelines you should go read the [documentation](https://jenkins.io/doc/book/pipeline/) before proceeding to get a sense for what to expect using this code. The rest of the setup process will assume you have basic knowledge of Jenkins or CI/CD jobs in general.
17
18
18
19
#### OS
19
-
- rvm installed in the jenkins user
20
-
- git
21
-
- build-essential
20
+
21
+
- rvm installed in the jenkins user
22
+
- git
23
+
- build-essential
22
24
23
25
#### Jenkins
24
-
- Version: > 2.7.3 - tested on (2.19.4 LTS)
25
-
26
+
27
+
- Version: > 2.7.3 - tested on (2.89.4 LTS)
28
+
26
29
#### Plugins
27
-
- slack
28
-
- pipeline (workflow-aggregator)
29
-
- git
30
-
- timestamper
31
-
- credentials
32
-
- sshagent
33
-
- junit
30
+
31
+
- slack
32
+
- pipeline (workflow-aggregator)
33
+
- git
34
+
- timestamper
35
+
- credentials
36
+
- sshagent
37
+
- junit
38
+
- docker
39
+
- AWS ECR credentials
34
40
35
41
#### Scripts Approval
42
+
36
43
When the job runs the first time you will need to work through allowing certain functions to execute in the groovy sandbox. This is normal as not all high use groovy functions are in the default safelist but more are added all the time.
37
44
38
45
### Manage with Puppet
46
+
39
47
The following modules work great to manage a Jenkins instance.
I went ahead and left the first item in the list the same as above but changed the second to include explanations of the values. You can find these in the pipeline syntax section of a pipeline job. Once there select the `withCredentials` step. Then add the credentials needed for the deploy step and click generate code. It will generate code that looks like the below example.
You will notice that inside the `withCredentials` method there is a list of values. This is the list that you need to copy and paste (as is) into the `DEPLOY_VARS` parameter.
117
138
118
-
119
139
## Test Results
140
+
120
141
All test results are assumed to be in JUnit format and placed in a single directory named `testresults`.
121
142
122
-
## [Changelog](CHANGELOG.md)
143
+
## Docker Builds
123
144
124
-
## [MIT License](LICENSE)
145
+
If a Dockerfile is present in the repo and `DOCKER_REGISTRY_URL` and `DOCKER_REGISTRY_CREDS_ID` are set builds will run with Docker. A sidcar MySQL container is spun up to use for the build then deleted when the build completes. All containers are cleaned up after the build completes. Gems are stored in a Docker volume per project per branch (eg. mysite_master-gems). This allows for faster builds since gems are cached between runs. Since this can lead to filling up the disk quickly it is recommended that you run a periodic clean job to remove old volumes. See Jenkinsfile.clean_example.
146
+
147
+
**Note:** The current setup only works with AWS ECR but can easily be adapted to work with other private registries.
0 commit comments