18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/kraaken/cloud.rb', line 18
def prepare(name)
new_relic = config.credentials.credential("new-relic")
config.ssh.connect(name) do |ssh|
ssh.run <<~BASH
sudo apt update
sudo apt upgrade -y
sudo apt install -y docker.io docker-compose
sudo docker network create cloudflaretunnel
sudo gpasswd -a $USER docker
curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=#{new_relic.password} NEW_RELIC_ACCOUNT_ID=#{new_relic.username} NEW_RELIC_REGION=EU /usr/local/bin/newrelic install -y
BASH
end
logger.increment_progress by: 25
config.ssh.connect(name) do |ssh|
ssh.run "mkdir -p ~/traefik"
ssh.write_file "~/traefik/docker-compose.yml", config.load_template("traefik-compose.yml", tunnel_token: config.ingress.tunnel_token_for_name(name))
logger.increment_progress by: 20
ssh.run "cd ~/traefik && docker-compose up -d"
ssh.run "echo #{config.credentials.password("docker-registry")} | docker login ghcr.io -u USERNAME --password-stdin", log: false
end
end
|