-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates tests, adds test helper scripts (#39)
* Updates tests, adds test helper scripts * removes extra step not required for k3s * bump drone's tf version * Bumps TF URL -- 0.12.18 * Adds test status to README * updates scp path * Adds default plans to baremetal_0 to drone
- Loading branch information
Showing
5 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/ash | ||
# This script is not used by Terraform; this is soley to assist in the testing pipeline. | ||
/usr/bin/curl -s -H 'Content-Type: application/json' -H "X-Auth-Token: $PACKET_TOKEN" https://api.packet.net/ssh-keys -d "{\"label\":\"$KEY_NAME\", \"key\":\"$(cat drone-key-$KEY_NAME.pub)\"}" -X POST | jq .id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
import requests | ||
import os | ||
|
||
# This is only used for the "Clean Up" pipeline stage in Drone-- If your name is not Drone, please stop. | ||
|
||
PACKET_TOKEN = os.environ['PACKET_TOKEN'] | ||
KEY_TAG = os.environ['KEY_TAG'] | ||
|
||
response_keys = requests.get("https://api.packet.net/ssh-keys", headers={"X-Auth-Token":"%s" % (PACKET_TOKEN)}).text | ||
keys = json.loads(response_keys)['ssh_keys'] | ||
|
||
for key in keys: | ||
if key['label'].startswith(KEY_TAG): | ||
print("Deleting %s" % key['id']) | ||
d = requests.delete("https://api.packet.net/ssh-keys/%s" % (key['id']), headers={"X-Auth-Token":"%s" % (PACKET_TOKEN)}) | ||
print(d.text) |