forked from uselagoon/build-deploy-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MaxCWhitehead/2.23.0-update
2.23.0 update
- Loading branch information
Showing
207 changed files
with
5,688 additions
and
1,207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,12 @@ RUN go install github.com/a8m/envsubst/cmd/[email protected] | |
|
||
WORKDIR /app | ||
|
||
COPY . ./ | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
|
||
COPY main.go main.go | ||
COPY cmd/ cmd/ | ||
COPY internal/ internal/ | ||
|
||
ARG BUILD | ||
ARG GO_VER | ||
|
@@ -100,10 +105,9 @@ COPY legacy/build-deploy-docker-compose.sh /kubectl-build-deploy/build-deploy-do | |
|
||
COPY legacy/scripts /kubectl-build-deploy/scripts | ||
|
||
COPY legacy/helmcharts /kubectl-build-deploy/helmcharts | ||
|
||
ENV DBAAS_OPERATOR_HTTP=dbaas.lagoon.svc:5000 | ||
ENV DOCKER_HOST=docker-host.lagoon.svc | ||
ENV LAGOON_FEATURE_FLAG_DEFAULT_DOCUMENTATION_URL=https://docs.lagoon.sh | ||
|
||
RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 | arm64 | armv8) echo "arm64" ;; *) echo "amd64" ;; esac) \ | ||
&& curl -sSL https://github.com/uselagoon/lagoon-linter/releases/download/v0.8.0/lagoon-linter_0.8.0_linux_${architecture}.tar.gz \ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"os" | ||
"testing" | ||
|
||
"github.com/andreyvit/diff" | ||
"github.com/uselagoon/build-deploy-tool/internal/dbaasclient" | ||
"github.com/uselagoon/build-deploy-tool/internal/generator" | ||
"github.com/uselagoon/build-deploy-tool/internal/helpers" | ||
|
@@ -752,6 +753,61 @@ func TestImageBuildConfigurationIdentification(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
{ | ||
name: "test12 Force Pull Base Images with variable replacement", | ||
args: testdata.GetSeedData( | ||
testdata.TestData{ | ||
Namespace: "example-project-main", | ||
ProjectName: "example-project", | ||
EnvironmentName: "main", | ||
Branch: "main", | ||
LagoonYAML: "internal/testdata/basic/lagoon.forcebaseimagepull-2.yml", | ||
ProjectVariables: []lagoon.EnvironmentVariable{ | ||
{ | ||
Name: "BASE_IMAGE_TAG", | ||
Value: "my-tag", | ||
Scope: "build", | ||
}, | ||
{ | ||
Name: "BASE_IMAGE_REPO", | ||
Value: "my-repo", | ||
Scope: "build", | ||
}, | ||
}, | ||
}, true), | ||
want: imageBuild{ | ||
BuildKit: helpers.BoolPtr(true), | ||
BuildArguments: map[string]string{ | ||
"BASE_IMAGE_TAG": "my-tag", | ||
"BASE_IMAGE_REPO": "my-repo", | ||
"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/my-repo/imagename:my-tag", | ||
}, | ||
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) { | ||
|
@@ -788,10 +844,10 @@ func TestImageBuildConfigurationIdentification(t *testing.T) { | |
t.Errorf("%v", err) | ||
} | ||
|
||
oJ, _ := json.Marshal(out) | ||
wJ, _ := json.Marshal(tt.want) | ||
oJ, _ := json.MarshalIndent(out, "", " ") | ||
wJ, _ := json.MarshalIndent(tt.want, "", " ") | ||
if string(oJ) != string(wJ) { | ||
t.Errorf("returned output %v doesn't match want %v", string(oJ), string(wJ)) | ||
t.Errorf("ImageBuildConfigurationIdentification() = \n%v", diff.LineDiff(string(oJ), string(wJ))) | ||
} | ||
t.Cleanup(func() { | ||
helpers.UnsetEnvVars(tt.vars) | ||
|
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
Oops, something went wrong.