ops-tools
Helper scripts for managing the servers.
Configuration
The configuration file ops-config.yml is searched either under /etc or the directory of the ops installation and all paths above.
You can use the command
ops config init
to create or update a configuration with all options.
Example:
docker:
email: [email protected]
user: my-user
password: my-password
url: https://my-docker-registry
Docker
build
This command builds tags and pushes an image to a docker registry.
Example:
bundle exec ops docker build ~/workspace/docker/docker-jenkins-odania docker-jenkins-odania
This will do the following steps:
- Login to the registry
- Get the highest version number from the registry
- Detect the base image (in this case odaniait/docker-jenkins:latest) and pull it. To make sure it is up to date.
- Build the docker image in the folder
- Tag the image with the version vBUILD_NUMBER and latest
- Push the image
You can additionally add the version number as a last parameter, e.g.
bundle exec ops docker build ~/workspace/docker/docker-jenkins-odania docker-jenkins-odania 10
This will build and push to v10 and latest.
Version numbers
Version numbers are expected to be in tags like v1 (vNUMBER in general).
base_image_check
This command checks all Dockerfiles under
The folder name has to be the name of the image. The image is looked up in the registry from the config.
Example:
bundle exec ops docker base_image_check ~/workspace/docker
- Important: For the detection to work you need to have the FROM in the first line followed by a line with MAINTAINER! *