Skip to content
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

DATAGO-65659: Add terraform assets to the docker build #136

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ target
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
Expand Down
5 changes: 5 additions & 0 deletions service/application/docker/.terraformrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
provider_installation {
dev_overrides {
"registry.terraform.io/solaceproducts/solacebroker" = "/opt/ema/terraform"
}
}
14 changes: 13 additions & 1 deletion service/application/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ FROM ${BASE_IMAGE}

VOLUME /tmp

RUN mkdir -p /opt/ema && chmod 777 /opt/ema
RUN mkdir -p /opt/ema && chmod 777 /opt/ema && mkdir -p /opt/ema/terraform && chmod 777 /opt/ema/terraform
WORKDIR /opt/ema

ARG PLATFORM=linux_amd64

# Do not update, this is the latest MPL-licensed Terraform version
ADD terraform_1.5.5_${PLATFORM}.tar.gz /opt/ema/terraform

ARG SOLACE_PROVIDER_VERSION=0.9.0
ADD terraform-provider-solacebroker_${SOLACE_PROVIDER_VERSION}_${PLATFORM}.tar.gz /opt/ema/terraform

COPY .terraformrc /root/.terraformrc

ENV PATH $PATH:/opt/ema/terraform

ARG GITHASH
ARG GITBRANCH
ARG BUILD_TIMESTAMP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export JAR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceSt
cp ../target/event-management-agent-${JAR_VERSION}.jar .

cd ..
docker build docker -t event-management-agent:${IMAGE_TAG} --build-arg BASE_IMAGE=${BASE_IMAGE}\
docker build docker -t event-management-agent:${IMAGE_TAG} --platform linux/amd64 --build-arg BASE_IMAGE=${BASE_IMAGE}\
--build-arg JAR_FILE=event-management-agent-${JAR_VERSION}.jar --build-arg GITHASH=${GITHASH}\
--build-arg BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" --build-arg GITBRANCH=${GITBRANCH}
cd ${script_dir}
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Service
@Data
public class TerraformProperties {
@Value("${plugins.terraform.workingDirectoryRoot:/${HOME}/tfconfig}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the unneeded leading / character.

@Value("${plugins.terraform.workingDirectoryRoot:${HOME}/tfconfig}")
private String workingDirectoryRoot;
}
Loading