-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add a testing CI on the aws image #19
Conversation
5c056f9
to
324023c
Compare
e9f4052
to
e74357e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @bidoubiwa for this PR 🔥
So so great 🚀
.github/workflows/test.yml
Outdated
run: | | ||
wget https://releases.hashicorp.com/packer/1.7.7/packer_1.7.7_linux_amd64.zip # change version | ||
unzip packer_1.7.7_linux_amd64.zip | ||
sudo mv packer /usr/local/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: | | |
wget https://releases.hashicorp.com/packer/1.7.7/packer_1.7.7_linux_amd64.zip # change version | |
unzip packer_1.7.7_linux_amd64.zip | |
sudo mv packer /usr/local/bin/ | |
uses: hashicorp/setup-packer@main | |
with: | |
version: ${{ env.PACKER_VERSION }} |
Is there a reason for not using the Packer Github action directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried initially but it didn't work. I can try again though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's worth spending too much time on it - if it works with the official GitHub-action, all the better, otherwise, let's keep what works for now.
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' --max-time 5 http://$PUBLIC_IP)" != "200" ]; do | ||
sleep 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a echo -n "."
before the sleep 5
, that way, we have a visual during the process. But I'm not sure it's will be visible on github-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about echo "Pinging the server..."
?
PUBLIC_IP=$1 | ||
start_time=$(date +%s) | ||
|
||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' --max-time 5 http://$PUBLIC_IP)" != "200" ]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the command -o /dev/null
to capture output if you're going to send it to /dev/null
? If you want to avoid having it printed in the terminal, the -s silent option is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a copypasta from chatgpt 😅 Good catch
# Check if the variable content is equal to '{"status":"available"}' | ||
if [ "$status" != '{"status":"available"}' ]; then | ||
# If not, echo the variable value and an error message, and exit with code 1 | ||
echo "Error: Meilisearch is not running correctly." | ||
echo "Server response: $status" | ||
exit 1 | ||
else | ||
# If it is equal, echo a success message and exit with code 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's better to comment on your code, but I don't think comments here do much.
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y curl unzip | ||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | ||
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | ||
sudo apt-get update && sudo apt-get install -y terraform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl unzip | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | |
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | |
sudo apt-get update && sudo apt-get install -y terraform | |
- uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.1.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here for Terraform? Maybe we can use both simultaneously ...
id = "sg-037fd498b332442c1" | ||
} | ||
|
||
resource "aws_instance" "test" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are predefined types, otherwise, you could change test
by github_action_test
or CI_test
or something maybe more precise WDYT?
Due to the reduced availability of the team that takes care of this repo. The team will never have time to complete this PR, so I'm closing it. |
This PR adds a CI that is run on every pull_request and push. In the CI:
/health
and ensure the answer is{"status":"available"}
.We used
continue-on-error: true
in the steps that might fail to ensure terraform correctly removes the image