Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 543354bb authored by Thierry Martinez's avatar Thierry Martinez
Browse files

Ignore failures on destruction

parent 63a2243c
No related branches found
No related tags found
No related merge requests found
Pipeline #752201 passed
...@@ -108,7 +108,7 @@ resource "cloudstack_instance" "runner" { ...@@ -108,7 +108,7 @@ resource "cloudstack_instance" "runner" {
} }
provisioner "remote-exec" { provisioner "remote-exec" {
when = destroy when = destroy
inline = ["sudo gitlab-runner unregister --all-runners"] inline = ["sudo gitlab-runner unregister --all-runners || true"]
} }
} }
``` ```
...@@ -133,7 +133,9 @@ We cannot use a variable for passing the path to this file, ...@@ -133,7 +133,9 @@ We cannot use a variable for passing the path to this file,
since the connection is used by a destroy provisioner, that since the connection is used by a destroy provisioner, that
cannot refer to variables. cannot refer to variables.
This destroy provisioner executes `gitlab-runner unregister` This destroy provisioner executes `gitlab-runner unregister`
before the destruction of the virtual machine. before the destruction of the virtual machine; failures are ignored
in case of the `gitlab-runner` command was not yet installed
when destroying occurs.
## The pipeline specification file [`.gitlab-ci.yml`](.gitlab-ci.yml) ## The pipeline specification file [`.gitlab-ci.yml`](.gitlab-ci.yml)
......
...@@ -55,6 +55,6 @@ resource "cloudstack_instance" "runner" { ...@@ -55,6 +55,6 @@ resource "cloudstack_instance" "runner" {
} }
provisioner "remote-exec" { provisioner "remote-exec" {
when = destroy when = destroy
inline = ["sudo gitlab-runner unregister --all-runners"] inline = ["sudo gitlab-runner unregister --all-runners || true"]
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment