Skip to content

Instantly share code, notes, and snippets.

View chrisgilbert's full-sized avatar

Chris Gilbert chrisgilbert

View GitHub Profile
@chrisgilbert
chrisgilbert / ci-cd-ideas.cake
Last active March 19, 2019 17:57
Ideas for CI/CD implementation
// The basic ideas are:
// 1. We could use the cake Setup method thing to configure what the build does.
// 2. We can use implementation of interfaces to signal what needs to happen for each build step.
// 3. Custom steps would involve using a generic class, or creating your own and implementing required interfaces.
// 4. Each step would have to store state, e.g. a lock file to show it has been run.
// 5. The delivery step would use the strong typing to know which artefacts _should_ be there and what it should do with them.
// 6. You can pass a single parameter to the cake script and run it multiple times in parallel (maybe). You can also just run the "build-all" task to do it sequentially.
@chrisgilbert
chrisgilbert / gist:58f57c82f74162ed5c0f
Last active June 25, 2021 19:17
Run Ansible or Ansible-Playbook from Rundeck
#!/bin/bash
# Interpret whether the input needs to go to ansible, or ansible-playbook and run appropriately
# First update the git repos for each project
/usr/bin/update-git-repos
export ANSIBLE_FORCE_COLOR=1
export ANSIBLE_RETRY_FILES_ENABLED=False
def authorize_key_for_root(config, *key_paths)
[*key_paths, nil].each do |key_path|
if key_path.nil?
fail "Public key not found at following paths: #{key_paths.join(', ')}"
end
full_key_path = File.expand_path(key_path)
if File.exists?(full_key_path)
config.vm.provision 'file',
- name: Get list of databases
command: cat /etc/oratab
register: databases
changed_when: false
- name: Download latest create_db scripts
local_action: "git [email protected]:infrastructure/mosaic_infra_scripts.git dest=/tmp/mosaic_infra_scripts version={{ branch }}"