-
Notifications
You must be signed in to change notification settings - Fork 30
Add Jenkins pipeline for airgap infrastructure deployment and testing #498
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
Changes from all commits
5d966ed
f28da24
2d510ce
623281e
b7f19e8
d707464
747c637
6526afa
4984130
79414b8
dd6ad51
64fc6dc
2a476d2
f67983b
261497c
ccf943c
972fa39
4e05a64
2d8b416
45b5ca6
49d64b2
d535cb1
82ff2c8
86e855f
8472447
c0f653f
e111a47
17011ab
7e81590
34b57eb
4ed1772
8bbc86e
9409383
5ebf75e
58c430c
87428b1
7abc837
283619c
175d843
1d3dc90
4de9a7c
5b6e745
ac7005c
bf4528c
c772c84
492fd40
0557431
e05b903
809cee1
0a3d8eb
da025c2
cb9c703
45c9b08
3de1852
c2cfe4f
01439a0
dcfb052
7faacb4
5699ffd
3bd8fc4
0abf0d8
ea46fb1
0aa3ce1
2bbe883
7eeef81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Dockerfile for Airgap Go Testing | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: The file names is a little different from the standart, could you rename the file to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought a lot about the name of this file. I might replace airgap with Ansible because it really can be used for any Ansible/Tofu-based setup that wants to run tests. I will replace the other validation/Dockerfile.infra with this one, but I will do that in a separate PR in tests and jenkins-job-builder.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense to me! What do you think of updating Dockerfile.infra with what you need and use it here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created an issue, and I'll tackle this in another PR. |
||
| # Provides Go toolchain, gotestsum, OpenTofu, Ansible, and AWS CLI for test execution | ||
|
|
||
| ARG TOFU_VERSION=1.10.7 | ||
| ARG GOTESTSUM_VERSION=v1.13.0 | ||
| ARG ANSIBLE_VERSION=13.3.0 | ||
| ARG AWSCLI_VERSION=1.44.44 | ||
|
|
||
| FROM --platform=linux/amd64 golang:1.25-alpine3.22 | ||
|
|
||
| ARG TOFU_VERSION | ||
| ARG GOTESTSUM_VERSION | ||
| ARG ANSIBLE_VERSION | ||
| ARG AWSCLI_VERSION | ||
|
|
||
| # Install runtime dependencies | ||
| RUN apk add --no-cache \ | ||
| bash \ | ||
| curl \ | ||
| git \ | ||
| openssh-client \ | ||
| python3 \ | ||
| py3-pip \ | ||
| ca-certificates | ||
|
|
||
| # Install Ansible and AWS CLI (pinned versions for reproducible builds) | ||
| RUN pip3 install --no-cache-dir --break-system-packages \ | ||
| ansible==${ANSIBLE_VERSION} \ | ||
| awscli==${AWSCLI_VERSION} | ||
|
|
||
| # Install OpenTofu with checksum verification | ||
| RUN curl -Lo /tmp/tofu_${TOFU_VERSION}_linux_amd64.tar.gz "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_amd64.tar.gz" \ | ||
| && curl -Lo /tmp/tofu_SHA256SUMS "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_SHA256SUMS" \ | ||
| && cd /tmp && grep "tofu_${TOFU_VERSION}_linux_amd64.tar.gz$" tofu_SHA256SUMS | sha256sum -c - \ | ||
| && tar -xzf /tmp/tofu_${TOFU_VERSION}_linux_amd64.tar.gz -C /usr/local/bin/ \ | ||
| && rm /tmp/tofu_${TOFU_VERSION}_linux_amd64.tar.gz /tmp/tofu_SHA256SUMS \ | ||
| && chmod +x /usr/local/bin/tofu | ||
|
|
||
| # Install gotestsum (pinned version for reproducible builds) | ||
| ENV GOBIN=/usr/local/bin | ||
| RUN go install gotest.tools/gotestsum@${GOTESTSUM_VERSION} | ||
| ENV GOBIN= | ||
|
rancher-max marked this conversation as resolved.
|
||
|
|
||
| # Set Ansible config to the consolidated ansible.cfg in qa-infra-automation | ||
| ENV ANSIBLE_CONFIG=/workspace/qa-infra-automation/ansible/ansible.cfg | ||
|
|
||
| # Create working directory | ||
| WORKDIR /workspace | ||
|
|
||
| # Verify installations | ||
| RUN tofu version && \ | ||
| ansible --version && \ | ||
| aws --version && \ | ||
| go version && \ | ||
| gotestsum --version | ||
|
|
||
| # Default to sh shell (compatible with docker run sh -c) | ||
| CMD ["/bin/sh"] | ||
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.
You made Copilot very happy by including versions and checksum verification.
This dockerfile looks like it will be a nice default to use with all of the qa-infra-automation stuff too to be honest.