Skip to content

Commit

Permalink
FACT-1881 change images to imported ones (#2568)
Browse files Browse the repository at this point in the history
* poke with readme change

* changed db image name to imported and test container one, still need to do sftp image

* jenkinsfiles adding imported line

* added last little line for sftp docker change
  • Loading branch information
justiceia authored Jul 15, 2024
1 parent 9a91535 commit faab179
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def component = "send-letter-service"

def channel = '#bsp-build-notices'

env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = 'hmctspublic.azurecr.io/imported/'

secrets = [
's2s-${env}': [
secret('microservicekey-send-letter-tests', 'TEST_S2S_SECRET')
Expand Down
2 changes: 2 additions & 0 deletions Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def component = "send-letter-service"

def channel = '#bsp-build-notices'

env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = 'hmctspublic.azurecr.io/imported/'

secrets = [
's2s-${env}': [
secret('microservicekey-send-letter-tests', 'TEST_S2S_SECRET')
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,3 @@ A letter can be in one of the following statuses:
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
2 changes: 1 addition & 1 deletion docker/database/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:16
FROM hmctspublic.azurecr.io/imported/postgres:16-alpine

MAINTAINER "HMCTS BSP <https://github.com/hmcts>"
LABEL maintainer = "HMCTS BSP <https://github.com/hmcts>"
Expand Down
2 changes: 1 addition & 1 deletion docker/sftp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM atmoz/sftp:alpine
FROM hmctspublic.azurecr.io/imported/atmoz/sftp:alpine

COPY keys/keypair.pub /home/sftp/.ssh/keys/keypair.pub
COPY keys/ssh_host_ed25519_key /etc/ssh/ssh_host_ed25519_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
import org.testcontainers.containers.DockerComposeContainer;

import java.io.File;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.DockerImageName;

/*
* The Microsoft Azure storage emulator provides a local environment
Expand All @@ -23,7 +22,9 @@ public class TestUploadStorageHelper {
private static TestUploadStorageHelper INSTANCE;
public static final String CONTAINER_NAME = "encrypted";

private static DockerComposeContainer<?> dockerComposeContainer;
private static GenericContainer<?> dockerComposeContainer =
new GenericContainer<>(DockerImageName.parse("mcr.microsoft.com/azure-storage/azurite:3.29.0"))
.withExposedPorts(10000);
private static String dockerHost;
public static final String STORAGE_CONN_STRING = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;"
+ "AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;"
Expand All @@ -43,17 +44,19 @@ public static TestUploadStorageHelper getInstance() {
}

private static void createDocker() {
dockerComposeContainer = new DockerComposeContainer<>(
new File("src/integrationTest/resources/docker/docker-compose.yml")
).withExposedService("azure-storage", 10000)
.withLocalCompose(true);
dockerComposeContainer.withEnv("executable", "blob");
dockerComposeContainer.withNetworkAliases("azurite");
dockerComposeContainer.start();
dockerHost = dockerComposeContainer.getServiceHost("azure-storage", 10000);
dockerHost = dockerComposeContainer.getHost();
}

private static void initializeStorage() {
blobServiceClient = new BlobServiceClientBuilder()
.connectionString(String.format(STORAGE_CONN_STRING, dockerHost, 10000))
.connectionString(String.format(
STORAGE_CONN_STRING,
dockerHost,
dockerComposeContainer.getMappedPort(10000)
))
.buildClient();
}

Expand Down

0 comments on commit faab179

Please sign in to comment.