Skip to content

Commit

Permalink
feat(docker): add terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Jun 14, 2024
1 parent 89bd28e commit 40b8f65
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions deployment/docker/runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ RUN --mount=type=cache,target=/go/pkg \


ENV OPENTOFU_VERSION="1.7.0"
#ENV TERRAFORM_VERSION="1.8.2"
ENV TERRAFORM_VERSION="1.8.2"
#ENV PULUMI_VERSION="3.116.1"

RUN wget https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz && \
tar xf tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz -C /tmp && \
rm tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz

#RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
# unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip -d /tmp && \
# rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip
#
RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip -d /tmp && \
rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip

#RUN if [ "$TARGETARCH" = "amd64" ]; then \
# export PULUMI_ARCH="x64"; \
# else \
Expand Down Expand Up @@ -67,6 +67,7 @@ COPY --chown=1001:0 ./deployment/docker/runner/ansible.cfg /tmp/semaphore/ansibl
COPY --from=builder /go/src/semaphore/deployment/docker/runner/runner-wrapper /usr/local/bin/
COPY --from=builder /go/src/semaphore/bin/semaphore /usr/local/bin/
COPY --from=builder /tmp/tofu /usr/local/bin/
COPY --from=builder /tmp/terraform /usr/local/bin/

RUN chown -R semaphore:0 /usr/local/bin/runner-wrapper && \
chmod +x /usr/local/bin/runner-wrapper && \
Expand Down
11 changes: 6 additions & 5 deletions deployment/docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ RUN --mount=type=cache,target=/go/pkg \


ENV OPENTOFU_VERSION="1.7.0"
#ENV TERRAFORM_VERSION="1.8.2"
ENV TERRAFORM_VERSION="1.8.2"
#ENV PULUMI_VERSION="3.116.1"

RUN wget https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz && \
tar xf tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz -C /tmp && \
rm tofu_${OPENTOFU_VERSION}_linux_${TARGETARCH}.tar.gz

#RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
# unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip -d /tmp && \
# rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip
#
RUN curl -O https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip -d /tmp && \
rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip

#RUN if [ "$TARGETARCH" = "amd64" ]; then \
# export PULUMI_ARCH="x64"; \
# else \
Expand Down Expand Up @@ -70,6 +70,7 @@ COPY --chown=1001:0 ./deployment/docker/server/ansible.cfg /tmp/semaphore/ansibl
COPY --from=builder /go/src/semaphore/deployment/docker/server/server-wrapper /usr/local/bin/
COPY --from=builder /go/src/semaphore/bin/semaphore /usr/local/bin/
COPY --from=builder /tmp/tofu /usr/local/bin/
COPY --from=builder /tmp/terraform /usr/local/bin/

RUN chown -R semaphore:0 /usr/local/bin/server-wrapper && \
chmod +x /usr/local/bin/server-wrapper && \
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/project/Templates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default {
viewTab: null,
templateApps: [
'', // Ansible
// 'terraform',
'terraform',
'tofu',
'bash',
// 'pulumi',
Expand Down

0 comments on commit 40b8f65

Please sign in to comment.