Skip to content

Commit aaa9770

Browse files
committed
Fixes errant changes
1 parent 7ee52d9 commit aaa9770

4 files changed

Lines changed: 44 additions & 26 deletions

File tree

Makefile

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ api-tests: gen
122122
# upstream
123123
CI_BUILD_TAG ?= lagoon-cli
124124
CORE_REPO=https://github.com/uselagoon/lagoon.git
125-
CORE_TREEISH=main
125+
CORE_TREEISH=make-export-refactoring
126+
127+
LAGOON_CORE_IMAGE_REPO=testlagoon
128+
LAGOON_CORE_IMAGE_TAG=main
126129

127130
TEMP_CONFIG_FILE := temp_config.yaml
128131

@@ -133,23 +136,33 @@ generate-config:
133136
clean-config:
134137
@rm -f $(TEMP_CONFIG_FILE)
135138

136-
# TODO - Update with UI-PR#266
137-
.PHONY: test-with-api
138-
test-with-api:
139+
.PHONY: cli-tests-with-development-api
140+
cli-tests-with-development-api: development-api
141+
TOKEN=$$(docker run -e JWTSECRET=super-secret-string \
142+
-e JWTAUDIENCE=api.dev \
143+
-e JWTUSER=localadmin \
144+
uselagoon/tests \
145+
python3 /ansible/tasks/api/admin_token.py) \
146+
&& $(MAKE) generate-config TOKEN=$$TOKEN \
147+
&& $(MAKE) api-tests \
148+
&& $(MAKE) clean-config \
149+
&& $(MAKE) CI_BUILD_TAG=$(CI_BUILD_TAG) development-api-down
150+
151+
.PHONY: development-api
152+
development-api:
139153
export LAGOON_CORE=$$(mktemp -d ./lagoon-core.XXX) \
140-
&& git clone $(CORE_REPO) "$$LAGOON_CORE" \
141-
&& cd "$$LAGOON_CORE" \
142-
&& git checkout $(CORE_TREEISH) \
143-
&& TOKEN=$$(docker run -e JWTSECRET=super-secret-string \
144-
-e JWTAUDIENCE=api.dev \
145-
-e JWTUSER=localadmin \
146-
uselagoon/tests \
147-
python3 /ansible/tasks/api/admin_token.py) \
148-
&& IMAGE_REPO=uselagoon docker compose -p $(CI_BUILD_TAG) --compatibility up -d api api-db actions-handler local-api-data-watcher-pusher keycloak keycloak-db broker api-redis logs2notifications local-minio mailhog \
149-
&& $(MAKE) CI_BUILD_TAG=$(CI_BUILD_TAG) wait-for-keycloak \
150-
&& cd .. \
151-
&& $(MAKE) generate-config TOKEN=$$TOKEN \
152-
&& $(MAKE) api-tests \
153-
&& $(MAKE) clean-config \
154-
&& cd "$$LAGOON_CORE" \
155-
&& $(MAKE) CI_BUILD_TAG=$(CI_BUILD_TAG) down
154+
&& git clone $(CORE_REPO) "$$LAGOON_CORE" \
155+
&& cd "$$LAGOON_CORE" \
156+
&& git checkout $(CORE_TREEISH) \
157+
&& IMAGE_REPO=$(LAGOON_CORE_IMAGE_REPO) IMAGE_REPO_TAG=$(LAGOON_CORE_IMAGE_TAG) COMPOSE_STACK_NAME=core-$(CI_BUILD_TAG) docker compose -p core-$(CI_BUILD_TAG) pull \
158+
&& IMAGE_REPO=$(LAGOON_CORE_IMAGE_REPO) IMAGE_REPO_TAG=$(LAGOON_CORE_IMAGE_TAG) COMPOSE_STACK_NAME=core-$(CI_BUILD_TAG) $(MAKE) compose-api-logs-development
159+
160+
.PHONY: development-api-down
161+
development-api-down:
162+
cd lagoon-core* && \
163+
docker-compose -p core-$(CI_BUILD_TAG) --compatibility down -v --remove-orphans
164+
165+
.PHONY: down
166+
down:
167+
$(MAKE) development-api-down
168+
docker-compose -p $(CI_BUILD_TAG) --compatibility down -v --remove-orphans

cmd/deploy.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ use 'lagoon deploy latest' instead`,
8282
return err
8383
}
8484
resultData := output.Result{Result: result.DeployEnvironmentBranch}
85-
output.RenderResult(resultData, outputOptions, cmd)
85+
r := output.RenderResult(resultData, outputOptions)
86+
fmt.Fprintf(cmd.OutOrStdout(), "%s", r)
8687
}
8788
return nil
8889
},
@@ -146,7 +147,8 @@ var deployPromoteCmd = &cobra.Command{
146147
return err
147148
}
148149
resultData := output.Result{Result: result.DeployEnvironmentPromote}
149-
output.RenderResult(resultData, outputOptions, cmd)
150+
r := output.RenderResult(resultData, outputOptions)
151+
fmt.Fprintf(cmd.OutOrStdout(), "%s", r)
150152
}
151153
return nil
152154
},
@@ -208,7 +210,8 @@ This environment should already exist in lagoon. It is analogous with the 'Deplo
208210
return err
209211
}
210212
resultData := output.Result{Result: result.DeployEnvironmentLatest}
211-
output.RenderResult(resultData, outputOptions, cmd)
213+
r := output.RenderResult(resultData, outputOptions)
214+
fmt.Fprintf(cmd.OutOrStdout(), "%s", r)
212215
}
213216
return nil
214217
},
@@ -296,7 +299,8 @@ This pullrequest may not already exist as an environment in lagoon.`,
296299
return err
297300
}
298301
resultData := output.Result{Result: result.DeployEnvironmentPullrequest}
299-
output.RenderResult(resultData, outputOptions, cmd)
302+
r := output.RenderResult(resultData, outputOptions)
303+
fmt.Fprintf(cmd.OutOrStdout(), "%s", r)
300304
}
301305
return nil
302306
},

cmd/project_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestAPIProjectCommands(t *testing.T) {
2121
}{
2222
{
2323
name: "Add Project",
24-
cmdArgs: []string{"add", "project", "--project=test-project", "--production-environment=main", "--openshift=4", "--git-url=https://github.com/lagoon-examples/drupal10-base"},
24+
cmdArgs: []string{"add", "project", "--project=test-project", "--production-environment=main", "--deploytarget=4", "--git-url=https://github.com/lagoon-examples/drupal10-base"},
2525
setupCmd: func(cmd *cobra.Command, flags pflag.FlagSet) {
2626
cmd.AddCommand(addCmd)
2727
addCmd.AddCommand(addProjectCmd)
@@ -31,7 +31,7 @@ func TestAPIProjectCommands(t *testing.T) {
3131
},
3232
{
3333
name: "Add Project to an Organization",
34-
cmdArgs: []string{"add", "project", "--project=test-organization-project", "--organization-name=lagoon-demo-organization", "--production-environment=main", "--openshift=4", "--git-url=https://github.com/lagoon-examples/drupal10-base"},
34+
cmdArgs: []string{"add", "project", "--project=test-organization-project", "--organization-name=lagoon-demo-organization", "--production-environment=main", "--deploytarget=4", "--git-url=https://github.com/lagoon-examples/drupal10-base"},
3535
setupCmd: func(cmd *cobra.Command, flags pflag.FlagSet) {
3636
cmd.AddCommand(addCmd)
3737
addCmd.AddCommand(addProjectCmd)

local-dev/config.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ lagoons:
66
hostname: "localhost"
77
port: "2020"
88
token: ${TOKEN}
9+
version: v1.9.0

0 commit comments

Comments
 (0)