Size: a a a

Aerokube Support

2020 November 24

J

Julien in Aerokube Support
because right now I was relying on that script :

#!/usr/bin/env bash
docker ps --filter "name=^selenoid$" --format '{{.Ports}}'
if [ $? -eq 0 ]
then
 echo "Selenoid is already running"
 exit 0
else
 open --background -a Docker
 sleep 5
 curl -s https://aerokube.com/cm/bash | bash && ./cm selenoid start --vnc
 if [ $? -eq 0 ]
 then
   echo "Selenoid started successfully" >&2
   exit 0
 else
  echo "Start selenoid failed" >&2
  exit 1
 fi
fi
источник

IK

Ivan Krutov in Aerokube Support
simply download latest CM binary from releases page here: https://github.com/aerokube/cm/releases
источник

J

Julien in Aerokube Support
ok but so I have to parse the release page myself 🙁 ?
источник

J

Julien in Aerokube Support
(if I want to automate the download)
источник

IK

Ivan Krutov in Aerokube Support
yes, there were a lot of issues with this script, so we decided to remove it
источник

АА

Александр Андряшин... in Aerokube Support
Julien
ok but so I have to parse the release page myself 🙁 ?
echo $(curl -s -I https://github.com/aerokube/cm/releases/latest | grep location | sed -e 's/^location: //')
источник

J

Julien in Aerokube Support
Thanks for the hint, but I wanted the binary 🙂

It seems to be working like that :

#!/bin/bash

if [ $(docker inspect -f '{{.State.Running}}' "selenoid") = "true" ]
then
 echo "Selenoid is already running"
 exit 0
else
 open --background -a Docker
 sleep 5
 arch=$(echo `uname -s` | awk '{print tolower($0)}')
 cm_url=$(curl --silent "https://api.github.com/repos/aerokube/cm/releases/latest" | jq --arg PLATFORM_ARCH "$arch" -r '.assets[] | select(.name | contains($PLATFORM_ARCH)).browser_download_url')
 curl -L -o cm $cm_url
 chmod +x ./cm
./cm selenoid start --vnc
 if [ $? -eq 0 ]
 then
   echo "Selenoid started successfully" >&2
   exit 0
 else
  echo "Start selenoid failed" >&2
  exit 1
 fi
fi
источник

J

Julien in Aerokube Support
all this stuff isn't really straightforward to use in CI 🙁
источник

J

Julien in Aerokube Support
shouldn't "cm start" handle the case where selenoid or cm was already started and stop it ? maybe by introducing a "start if needed" option ?
источник

J

Julien in Aerokube Support
in my case, depending on the continuous integration agent OSX / windows I may run with --use-drivers, so before using docker commands to stop the container I must check wether it is up, and so on...
источник

J

Julien in Aerokube Support
I am writing more code to get a selenium server up than I wrote in the test itself ^^
источник

IK

Ivan Krutov in Aerokube Support
CM only starts Selenoid in case when it's not started
источник

J

Julien in Aerokube Support
2020-11-24T14:24:46.9830600Z x Failed to start: failed to create container: Error response from daemon: Conflict. The container name "/selenoid" is already in use by container "54a31108bdca562b88a935549bebebd8dcefa647c7c9feee91dc9fb43e52719a". You have to remove (or rename) that container to be able to reuse that name.
источник

J

Julien in Aerokube Support
is this case a bug to report then ?
источник

IK

Ivan Krutov in Aerokube Support
Julien
is this case a bug to report then ?
this should be some previously manually started container
источник

IK

Ivan Krutov in Aerokube Support
in latest releases CM is starting everything in Docker network called selenoid
источник

J

Julien in Aerokube Support
hm it seems I am mixing different errors from different sources. our CI tool seems to kill cm when he moves to the next build step...
источник

J

Julien in Aerokube Support
I am using "&" bash operator to run it in background, is there another way to install it as a daemon ?
источник

АА

Александр Андряшин... in Aerokube Support
Julien
I am using "&" bash operator to run it in background, is there another way to install it as a daemon ?
cm cannot be run as daemon, it is command line utility to start selenoid, when selenoid started cm exits...
источник

J

Julien in Aerokube Support
so after "./cm selenoid start --vnc --use-drivers" is executed, selenoid should be up ?
источник