-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature - specify base images to refresh on deploy (#355)
* Adds --pull to docker build to support updating base images * adds REFRESH_BASE_IMAGES functionality * Introduces labels for base image indicators * debug * readding docker pull * Raw string jq * Adding dockerfile reference regex check for validity * Fixes comment * Removes dupe test --------- Co-authored-by: Blaize Kaye <[email protected]>
- Loading branch information
Showing
10 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -711,6 +711,47 @@ func TestImageBuildConfigurationIdentification(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
{ | ||
name: "test11 Force Pull Base Images", | ||
args: testdata.GetSeedData( | ||
testdata.TestData{ | ||
Namespace: "example-project-main", | ||
ProjectName: "example-project", | ||
EnvironmentName: "main", | ||
Branch: "main", | ||
LagoonYAML: "internal/testdata/basic/lagoon.forcebaseimagepull.yml", | ||
}, true), | ||
want: imageBuild{ | ||
BuildKit: false, | ||
BuildArguments: map[string]string{ | ||
"LAGOON_BUILD_NAME": "lagoon-build-abcdefg", | ||
"LAGOON_PROJECT": "example-project", | ||
"LAGOON_ENVIRONMENT": "main", | ||
"LAGOON_ENVIRONMENT_TYPE": "production", | ||
"LAGOON_BUILD_TYPE": "branch", | ||
"LAGOON_GIT_SOURCE_REPOSITORY": "ssh://[email protected]/lagoon-demo.git", | ||
"LAGOON_KUBERNETES": "remote-cluster1", | ||
"LAGOON_GIT_SHA": "abcdefg123456", | ||
"LAGOON_GIT_BRANCH": "main", | ||
"NODE_IMAGE": "example-project-main-node", | ||
"LAGOON_SSH_PRIVATE_KEY": "-----BEGIN OPENSSH PRIVATE KEY-----\nthisisafakekey\n-----END OPENSSH PRIVATE KEY-----", | ||
}, | ||
ForcePullImages: []string{ | ||
"registry.com/namespace/imagename:latest", | ||
}, | ||
Images: []imageBuilds{ | ||
{ | ||
Name: "node", | ||
ImageBuild: generator.ImageBuild{ | ||
BuildImage: "harbor.example/example-project/main/node:latest", | ||
Context: "internal/testdata/basic/docker", | ||
DockerFile: "basic.dockerfile", | ||
TemporaryImage: "example-project-main-node", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
internal/testdata/basic/docker-compose.forcebaseimagepull.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '2' | ||
services: | ||
node: | ||
networks: | ||
- amazeeio-network | ||
- default | ||
build: | ||
context: internal/testdata/basic/docker | ||
dockerfile: basic.dockerfile | ||
labels: | ||
lagoon.type: basic | ||
lagoon.service.usecomposeports: true | ||
lagoon.base.image: registry.com/namespace/imagename:latest | ||
volumes: | ||
- .:/app:delegated | ||
ports: | ||
- '1234' | ||
- '8191' | ||
- '9001/udp' | ||
|
||
networks: | ||
amazeeio-network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
docker-compose-yaml: internal/testdata/basic/docker-compose.forcebaseimagepull.yml | ||
|
||
environment_variables: | ||
git_sha: "true" | ||
|
||
environments: | ||
main: | ||
routes: | ||
- node: | ||
- example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters