diff --git a/README.md b/README.md index 50e604fd818cfe50232f44c2d78c90b3fa50a437..bdc5c64f55dc56a44340adb345ae65b2e9cfdc0c 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,14 @@ export CI_WRAPPER_HOME=${HOME}/.ci-wrappers ## Usage -- `install-ci-software` <br/> +- `ci-install-software` <br/> Installs GitHub CLI, Docker client, docker compose plugin, vagrant and terraform in $CI_WRAPPERS_HOME - `new-java-project testci fr.univtln.bruno.tests` <br/> Creates a new maven projects ready for C.I. - `docker-mvn` <br/> Wraps maven in a container (docker needed see beelow).<br/> For example to build a C.I. project: `docker-mvn clean verify` -- `github-runner-repo` or `github-runner-org` <br/> +- `ci-github-runner-repo` or `ci-github-runner-org` <br/> Creates and register a new GitHub runner in a docker container for the current repository or the organisation (account). - A docker engine with http proxy support in VM : diff --git a/ci-wrappers.sh b/ci-wrappers.sh index c93e3f0137e7664595ad9b6194a92a82d7fcb6f5..8534704d713daeb26d24c6ec5b868fe72ee8aa1e 100644 --- a/ci-wrappers.sh +++ b/ci-wrappers.sh @@ -17,7 +17,7 @@ var_expand() { } ci-wrappers-usage() { - printf 'install-ci-software\n\t installs a docker client and compose plugin, Github CLI, vagrant and terraform in %s/bin\n'"${CI_WRAPPERS_HOME}" + printf 'ci-install-software\n\t installs a docker client and compose plugin, Github CLI, vagrant and terraform in %s/bin\n'"${CI_WRAPPERS_HOME}" printf "new-java-project [projectname] [groupid]\n\t create a new java+maven project ready for CI\n" echo "docker-wrapper" echo "docker-wrapper-build" @@ -27,7 +27,7 @@ ci-wrappers-usage() { echo "docker-sonar-analysis" } -install-ci-software() { +ci-install-software() { _init if [ -n "$ZSH_VERSION" ]; then emulate -L ksh; fi @@ -292,11 +292,11 @@ _generate_and_install_new_deploy_key() ( ) # create a github hosted runner in a container for the current repo -github-runner-repo() ( +ci-github-runner-repo() ( _check_variables GITHUBORG local workdir workdir=$(mktemp --directory "/tmp/ghrunner-${GITHUBORG}_${PWD##*/}_XXXXXX") - docker run -d --rm --restart always --name ghrunner_$(echo "$workdir" | cut -d '-' -f 2) \ + docker run -d --rm --restart unless-stopped --name ghrunner_$(echo "$workdir" | cut -d '-' -f 2) \ -e RUNNER_NAME_PREFIX="${GITHUBORG}-${PWD##*/}-runner" \ -e ACCESS_TOKEN="${GITHUBTOKEN}" \ -e RUNNER_SCOPE="repo" \ @@ -308,11 +308,11 @@ github-runner-repo() ( ) # create a github hosted runner in a container for the org in $GITHUBORG -github-runner-org() ( +ci-github-runner-org() ( _check_variables GITHUBORG local workdir workdir=$(mktemp --directory "/tmp/ghrunner-${GITHUBORG}_XXXXXX") - docker run -d --rm --restart always --name ghrunner_$(echo "$workdir" | cut -d '-' -f 2) \ + docker run -d --rm --restart unless-stopped --name ghrunner_$(echo "$workdir" | cut -d '-' -f 2) \ -e RUNNER_NAME_PREFIX="${GITHUBORG}-${PWD##*/}-runner" \ -e ACCESS_TOKEN="${GITHUBTOKEN}" \ -e RUNNER_SCOPE="org" \ @@ -324,7 +324,7 @@ github-runner-org() ( myoung34/github-runner:latest ) -github-runner-remove-all() ( +ci-github-runner-remove-all() ( docker rm $(docker ps -a|grep myoung34/github-runner|cut -f 1 -d ' ') )