Skip to content

Bootstrap jenkins from scratch -- the oy vey! edition (oh, and move to our own artifactory) #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 13, 2015

Conversation

adriaanm
Copy link
Contributor

This functionality had bitrotted because we've never
really re-installed jenkins from scratch

With this PR, I'm able to bootstrap and fully configure
Jenkins ver. 1.611 on a ubuntu utopic vagrant box.

The provision has three phases: init, config, jenkins.

The config phase is needed when bootstrapping on EC2,
where chef vault is not yet available. After the instance
is up and authorized with chef-server for vault access,
we can go to the config phase.

Once Jenkins has the github oauth plugin and is restarted, we
can run the master-jenkins recipe.

NOTES:

  • switch to chef_vault_item for development in vagrant
  • Pass hudson.model.User.allowNonExistentUserToLogin to JVM
    to open jenkins up a bit for provisioning
  • Also need org.eclipse.jetty.server.Request.maxFormContentSize=1000000
    to allow plugin installs (??)

PS: when rerouting scala-ci.typesafe.com in your /etc/hosts to the ip of the bridged vagrant box,
don't be surprised when it's not the actual scala-ci that you were expecting...

@adriaanm
Copy link
Contributor Author

FYI, @lrytz & @retronym

@adriaanm
Copy link
Contributor Author

Next step: artifactory & a new EC2 instance to actually run all this on, now that I've convinced myself it will bootstrap from scratch.

This functionality had bitrotted because we've never
really re-installed jenkins from scratch

With this PR, I'm able to bootstrap and fully configure
Jenkins ver. 1.611 on a ubuntu utopic vagrant box.

The provision has three phases: init, config, jenkins.

The config phase is needed when bootstrapping on EC2,
where chef vault is not yet available. After the instance
is up and authorized with chef-server for vault access,
we can go to the config phase.

Once Jenkins has the github oauth plugin and is restarted, we
can run the master-jenkins recipe.

NOTES:
 - switch to chef_vault_item for development in vagrant
 - Pass `hudson.model.User.allowNonExistentUserToLogin` to JVM
   to open jenkins up a bit for provisioning
 - Also need `org.eclipse.jetty.server.Request.maxFormContentSize=1000000`
   to allow plugin installs (??)
Only relevant when bringing it up from scratch,
so this went undetected until we tried that again...
@adriaanm
Copy link
Contributor Author

I've confirmed this successfully brings up jenkins-master and workers.

FWIW, after an upgrade to aws v2 I ran into
```
Seahorse::Client::Http::Error: SSL_connect returned=1 errno=0 state=SSLv3
read server certificate B: certificate verify failed
```

During a chef-client run on amazon linux and ubuntu, where I managed to
make chef-client (and seahorse) happy again as follows:
- `SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt chef-client` (ubuntu)
- `SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt chef-client` (amazon linux)

See https://www.happyassassin.net/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/,
https://github.com/opscode-cookbooks/chef-client#attributes for more info.
fix NameError on Aws by installing aws-sdk

ebs for master needs to come first
(so we can access the /var/lib/jenkins that will actually be used)
note that chef-client needs to run on every node
to update its attributes based on current recipe impl
Since private-repo is going away tomorrow...
@adriaanm
Copy link
Contributor Author

Piggybacking move to the new artifactory on this PR. Last commit being validated by https://scala-ci.typesafe.com/job/scala-2.11.x-validate-publish-core/1125/console

@adriaanm adriaanm changed the title Bootstrap jenkins from scratch -- the oy vey! edition Bootstrap jenkins from scratch -- the oy vey! edition (oh, and move to our own artifactory) Apr 29, 2015
@adriaanm
Copy link
Contributor Author

TODO: do this consistently...

Don't tell anyone, but the password wasn't xml-safe.
Don't want to encode in ~/.credentials, but do in any xml file.
Should do it wholesale...

TODO: wrap `xmlSafe` around everything that's spliced into xml
chef_vault_item is pretty expensive --> hoist out of loop
simplify templates while we're at it
@adriaanm
Copy link
Contributor Author

@adriaanm
Copy link
Contributor Author

Merging so I can base the next PR on this. We'll review live in AMS.

adriaanm added a commit that referenced this pull request May 13, 2015
Bootstrap jenkins from scratch -- the oy vey! edition (oh, and move to our own artifactory)
@adriaanm adriaanm merged commit a45d662 into scala:master May 13, 2015
@adriaanm adriaanm mentioned this pull request May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant