42 lines
1.9 KiB
Markdown
42 lines
1.9 KiB
Markdown
# Development Environments
|
|
|
|
Beside the __prod__ and __preprod__ environments, development environments for feature branches of the puppet git repository are automatically put on and removed from the puppet server. To create a new feature branch and test environment simply:
|
|
|
|
1. Clone the puppet repository https://git.psi.ch/linux-infra/puppet
|
|
2. Create a new branch with a name that matches following regex: `^[a-z]+[a-z,0-9,_]+$` (e.g. my_test_branch)
|
|
3. Do the necessary changes and commit your changes
|
|
4. Push the new branch / changes to the git server
|
|
|
|
Whenever the git server receives a push a gitlab-runner gets triggered on the puppet server that does the automatic checkout of the branch and registers this as a new development environment.
|
|
|
|
Note: If branches are deleted on the git server the corresponding checkouts/environments on the puppet server will also be removed. (with some delay)
|
|
|
|
To use/test the code changes via the puppet test environment use
|
|
```
|
|
puppet agent -t --environment=issue_x
|
|
```
|
|
|
|
The following video shows all the necessary steps in detail:
|
|
|
|
<video controls width="100%" src="../../_static/videos/dev_environments.m4v">video</video>
|
|
|
|
Once you are done with the develoment and testing create a merge request for the branch to the __preprod__ branch.
|
|
|
|
## Development Environment Names
|
|
|
|
The name of an branch/environment must match the following regex expression: `^[a-z]+[a-z,0-9,_]+$`
|
|
|
|
If the name is not compliant with this rule, a push of the branch to the git server will not be possible.
|
|
|
|
|
|
# Attach Node to Different Puppet Server
|
|
|
|
For testing purpose you might change the Puppet server to which a test node is attached to. To do so do, change the ``server`` in the ``[main]`` section of ``/etc/puppetlabs/puppet/puppet.conf`` accordingly.
|
|
|
|
Then delete the current host and CA certficate and the CRL:
|
|
|
|
#. ``rm /etc/puppetlabs/puppet/ssl/certs/*``
|
|
#. ``rm /etc/puppetlabs/puppet/ssl/crl.pem``
|
|
|
|
Finally run the puppet agent again.
|