-
-
Notifications
You must be signed in to change notification settings - Fork 168
Added new dynamic-ubuntu-wait.sh #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d3e21a6
Added new dynamic-ubuntu-wait.sh - a utility script that can be curle…
eak12913 18ffed3
Added example of how to curl the script. Also added script to the lis…
eak12913 f8164e3
Update per PR comments
eak12913 bc9fc8a
Added one more echo - just to experiment as I'm still seeing sporadic…
eak12913 63d8536
Reverse the ordering of the waits and add a small sleep in case this …
eak12913 97c4713
increase wait time a bit
eak12913 48738df
Added example packer template. Will add a test later, when time allows
eak12913 c580adb
Add integration test for dynamic-ubuntu-wait
yorinasub17 f32ccd6
Add integration test to workflow
yorinasub17 b6ea582
Shellcheck changed how they are publishing their bins
yorinasub17 0e6b871
Update examples/dynamic-ubuntu-wait/packer-build.json
yorinasub17 a67d194
Include gruntwork credentials and remove nano install step
yorinasub17 3a5685a
Update examples/dynamic-ubuntu-wait/packer-build.json
yorinasub17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,41 @@ | ||
{ | ||
"min_packer_version": "0.12.0", | ||
"variables": { | ||
"aws_region": "us-west-1", | ||
"instance_type": "", | ||
"module_branch": "" | ||
}, | ||
"builders": [{ | ||
"name": "dynamic-wait-test-ami-ubuntu", | ||
"ami_name": "gruntwork-ubuntu-dynamic-wait-example-{{uuid | clean_resource_name}}", | ||
"ami_description": "An Ubuntu AMI that has Elasticsearch installed.", | ||
"instance_type": "{{user `instance_type`}}", | ||
"region": "{{user `aws_region`}}", | ||
"type": "amazon-ebs", | ||
"source_ami_filter": { | ||
"filters": { | ||
"virtualization-type": "hvm", | ||
"architecture": "x86_64", | ||
"name": "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*", | ||
"block-device-mapping.volume-type": "gp2", | ||
"root-device-type": "ebs" | ||
}, | ||
"owners": ["099720109477"], | ||
"most_recent": true | ||
}, | ||
"ssh_username": "ubuntu" | ||
}], | ||
"provisioners": [{ | ||
"type": "shell", | ||
"inline": [ | ||
"# Get around issue where automatic ubuntu updates prevent package installation.", | ||
"curl -LsS https://raw.githubusercontent.com/gruntwork-io/bash-commons/{{user `module_branch`}}/modules/bash-commons/src/dynamic-ubuntu-wait.sh | bash", | ||
"sudo apt-get -y update" | ||
] | ||
},{ | ||
"type": "shell", | ||
"inline": [ | ||
"sudo DEBIAN_FRONTEND=noninteractive apt-get install -y rolldice" | ||
] | ||
}] | ||
} |
This file contains hidden or 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,26 @@ | ||
package integration_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/gruntwork-io/terratest/modules/aws" | ||
"github.com/gruntwork-io/terratest/modules/git" | ||
"github.com/gruntwork-io/terratest/modules/packer" | ||
) | ||
|
||
func TestDynamicUbuntuWait(t *testing.T) { | ||
t.Parallel() | ||
|
||
region := aws.GetRandomStableRegion(t, nil, nil) | ||
instance_type := aws.GetRecommendedInstanceType(t, region, []string{"t2.micro", "t3.micro"}) | ||
buildOptions := &packer.Options{ | ||
Template: "../examples/dynamic-ubuntu-wait/packer-build.json", | ||
Vars: map[string]string{ | ||
"aws_region": region, | ||
"instance_type": instance_type, | ||
"module_branch": git.GetCurrentBranchName(t), | ||
}, | ||
} | ||
artifactID := packer.BuildArtifact(t, buildOptions) | ||
aws.DeleteAmiAndAllSnapshots(t, region, artifactID) | ||
} |
This file contains hidden or 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,5 @@ | ||
module github.com/gruntwork-io/bash-commons/integration-test | ||
|
||
go 1.14 | ||
|
||
require github.com/gruntwork-io/terratest v0.29.0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.