Attempting to prune containers on startup always.
This commit is contained in:
parent
618d8a5723
commit
21aba2fc71
|
@ -178,6 +178,7 @@ jobs:
|
||||||
|
|
||||||
- name: Pull testcontainers images
|
- name: Pull testcontainers images
|
||||||
run: |
|
run: |
|
||||||
|
docker system prune -f
|
||||||
if [ "${{ matrix.datasource }}" == "mssql" ]; then
|
if [ "${{ matrix.datasource }}" == "mssql" ]; then
|
||||||
docker pull mcr.microsoft.com/mssql/server@${{ steps.dotenv.outputs.MSSQL_SHA }}
|
docker pull mcr.microsoft.com/mssql/server@${{ steps.dotenv.outputs.MSSQL_SHA }}
|
||||||
elif [ "${{ matrix.datasource }}" == "mysql" ]; then
|
elif [ "${{ matrix.datasource }}" == "mysql" ]; then
|
||||||
|
|
|
@ -39,7 +39,6 @@ function getTestcontainers(): ContainerInfo[] {
|
||||||
|
|
||||||
function removeContainer(container: ContainerInfo) {
|
function removeContainer(container: ContainerInfo) {
|
||||||
execSync(`docker rm -f ${container.ID}`)
|
execSync(`docker rm -f ${container.ID}`)
|
||||||
execSync(`docker system prune -f`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getContainerByImage(image: string) {
|
export function getContainerByImage(image: string) {
|
||||||
|
@ -55,7 +54,9 @@ export function getContainerByImage(image: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContainerByName(name: string) {
|
function getContainerByName(name: string) {
|
||||||
return getTestcontainers().find(x => x.Names.includes(name))
|
return getTestcontainers().find(x =>
|
||||||
|
x.Names.toLowerCase().includes(name.toLowerCase())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getContainerById(id: string) {
|
export function getContainerById(id: string) {
|
||||||
|
|
Loading…
Reference in New Issue