File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Install jq if not exists
2
+ if ! [ -x "$(command -v jq)" ]; then
3
+ yum install jq -y
4
+ fi
5
+
1
6
# Provide the parent instance id in the spawned runner tags
2
- PARENT_INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data /instance-id);
7
+ PARENT_INSTANCE_ID=$(curl -s -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/dynamic /instance-identity/document | jq -r .instanceId)
3
8
PARENT_TAG="gitlab-runner-parent-id,$${ PARENT_INSTANCE_ID} "
4
9
5
10
mkdir -p /etc/gitlab-runner
@@ -62,11 +67,6 @@ docker-machine rm -y dummy-machine
62
67
unset HOME
63
68
unset USER
64
69
65
- # Install jq if not exists
66
- if ! [ -x "$(command -v jq)" ]; then
67
- yum install jq -y
68
- fi
69
-
70
70
# fetch Runner token from SSM and validate it
71
71
token=$(aws ssm get-parameters --names "${ secure_parameter_store_runner_token_key} " --with-decryption --region "${ secure_parameter_store_region} " | jq -r ".Parameters | .[0] | .Value")
72
72
You can’t perform that action at this time.
0 commit comments