@@ -57,119 +57,32 @@ Tips for addressing a temporary free-space issue on the behemoths:
57
57
community build job is running!)
58
58
* From time to time we can delete ` ~/.dbuild ` , ` ~/.ivy2 ` , ` ~/.m2 `
59
59
60
- ## Updating the scala-jenkins-infra cookbook
61
-
62
- Note that the setup instructions don't require you to clone all of the
63
- cookbooks to your local machine, only the scala-jenkins-infra
64
- cookbook. That's because our own cookbook is the one we usually
65
- update; the rest don't normally need to be touched.
66
-
67
- If you change the scala-jenkins-infra cookbook, you don't need
68
- to push your change anywhere in order to test it in production.
69
- We often test changes that way, and then after verifying that
70
- the change is working as desired in production, we push the change
71
- to scala/scala-jenkins-infra.
72
-
73
- To make changes,
74
-
75
- ### 1. Edit the cookbook
76
-
77
- Edit the cookbook. (For example, a common change is to edit
78
- one of the ` .xml.erb ` files for Jenkins.)
79
-
80
- ### 2. Upload the cookbook
81
-
82
- knife cookbook upload scala-jenkins-infra
83
-
84
- This always uploads the cookbook to the Typesafe account on chef.io,
85
- regardless of whether you made changes.
86
-
87
- ### 3. Run chef-client
88
-
89
- Run ` chef-client ` on the affected nodes (usually jenkins-master),
90
- which will cause the node to get the updated cookbook from chef.io.
91
- You can run it automatically or manually.
92
-
93
- Running it automatically just involves waiting. On a regular schedule
94
- (every 15 minutes, 30 minutes, something like that? it's configured in
95
- our cookbook for chef-client itself), an already running chef-client
96
- process will wake up and check chef.io for updates. (The log for
97
- the run presumably goes somewhere, but where? See
98
- https://github.com/scala/scala-jenkins-infra/issues/110 .)
99
-
100
- But it's usually better to do it manually because you can watch it
101
- happen and catch mistakes. Any cookbook changes found will show up as
102
- light-gray diffs in the ` chef-client ` output so you can spot and
103
- sanity-check them. If diffs are found, the cookbook specifies what
104
- should happen as a result -- for example, that service might be
105
- restarted.
106
-
107
- The commands to run chef-client depend on whether the node in question
108
- is Linux or Windows:
109
-
110
- #### Linux node
111
-
112
- Here ` hostname ` might be e.g. ` jenkins-master ` and username can be omitted
113
- to accept the default in your ` ~/.ssh/config ` , or can be explicitly supplied
114
- e.g. ` ec2-user@jenkins-master ` .
115
-
116
- ```
117
- ssh hostname # or username@hostname to override your ~/.ssh/config default
118
- sudo su --login # --login needed on ubuntu to set SSL_CERT_FILE (it's done in /etc/profile.d)
119
- chef-client
120
- ```
121
-
122
- #### Windows node
123
-
124
- ```
125
- PASS=$(aws ec2 get-password-data --instance-id i-0485455cc766c86ef --priv-launch-key ~/.ssh/typesafe-scala-aws-$AWS_USER.pem | jq .PasswordData | xargs echo)
126
- knife winrm jenkins-worker-windows-publish chef-client -m -P $PASS
127
- ```
128
60
129
61
# Misc
130
62
131
63
The remainder of this document is just rough notes.
132
64
133
- ## Upload all cookbooks to chef server
134
-
135
- ```
136
- knife cookbook upload --all
137
- ```
138
-
139
- this has not been done since the initial install!
140
-
141
- "Adriaan could also make a tarball" of his all-cookbooks setup
142
- sometime, maybe.
143
65
144
66
## SSL cert
145
- ```
146
- $ openssl genrsa -out scala-ci.key 2048
147
- ```
148
- and
67
+
68
+ We're using letsencrypt certificates, auto-renewing every 90 days.
149
69
150
70
```
151
- $ openssl req -new -out scala-ci.csr -key scala-ci.key -config ssl-certs/scalaci.openssl.cnf
71
+ sudo apt-get install python-certbot-nginx -t stretch-backports
72
+ sudo certbot --nginx
152
73
```
153
74
154
- Send CSR to SSL provider, receive scalaci.csr. Store scala-ci.key securely in vault master scala-ci-key (see above) .
75
+ The challenge/response happens over http, so I had to open up that port for master .
155
76
156
- Incorporate the cert into an ssl chain for nginx:
157
- ```
158
- (cd ssl-certs && cat 00\ -\ scala-ci.crt 01\ -\ COMODORSAOrganizationValidationSecureServerCA.crt 02\ -\ COMODORSAAddTrustCA.crt 03\ -\ AddTrustExternalCARoot.crt > ../files/default/scala-ci.crt)
159
- ```
160
77
78
+ ### static diffie-hellman param
161
79
For [ forward secrecy] ( http://axiacore.com/blog/enable-perfect-forward-secrecy-nginx/ ) :
162
80
```
163
81
openssl dhparam -out files/default/dhparam.pem 1024
164
82
```
165
83
166
84
Using 1024 bits (instead of 2048) for DH to be Java 6 compatible... Bye-bye A+ on https://www.ssllabs.com/ssltest/analyze.html?d=scala-ci.typesafe.com
167
85
168
- Confirm values in the csr using:
169
-
170
- ```
171
- $ openssl req -text -noout -in scala-ci.csr
172
- ```
173
86
174
87
# Give up, bypass Chef?
175
88
0 commit comments