Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
v1.5.4
Temporarily disable Go version checks
v1.6.0
Add new deploy-apps command

Previously:
- Temporarily disable Go version checks
- Push Docker images to one ECR region
- add option to pass branch name and dryRun to catalog-sync
- add shared workflow for Claude actions
39 changes: 38 additions & 1 deletion cmd/goci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,42 @@ go build -o ./bin/goci ./cmd/goci

cp ./bin/goci ./testApp

cd testApp && goci
cd testApp && ./goci validate
```

Running goci fully locally is awkward: most behavior depends on Clever CI **contexts and environment variables** (AWS, Catapult, etc.). For realistic validation, prefer testing **in CircleCI** using the orb parameter below.

### Testing a goci branch in CircleCI (`build_goci_from_branch`)

The [circleci-orbs](https://github.com/Clever/circleci-orbs) jobs that invoke goci accept an optional parameter **`build_goci_from_branch`**. When set to a **branch name on this repo (`ci-scripts`)**, the job clones that branch and runs `go install ./cmd/goci` instead of installing the latest released goci binary.

**Steps**

1. **Push your goci changes** to a branch of `github.com/Clever/ci-scripts`
2. **Pick a test application** whose `.circleci/config.yml` already uses `clever/circleci-orbs`
3. **Set `build_goci_from_branch`** on each orb job that should use your in-development goci, using the ci-scripts branch name:

```yaml
- circleci-orbs/build_publish_deploy:
name: build_publish_deploy
working_directory: ~/project
build_goci_from_branch: YOUR_CI_SCRIPTS_BRANCH
# ... contexts, requires, etc.
- circleci-orbs/deploy_apps:
name: deploy_apps
working_directory: ~/project
build_goci_from_branch: YOUR_CI_SCRIPTS_BRANCH
requires:
- build_publish_deploy
# ... contexts, filters, etc.
```

4. **If you also changed the orb YAML or scripts**, publish or reference a **dev** orb version from your `circleci-orbs` branch (for example `clever/circleci-orbs@dev:<git-sha>`) so the pipeline runs your updated job definitions, not only a new goci binary.

**Jobs that support `build_goci_from_branch`**

| Job | What it runs |
| --- | --- |
| `build_publish_deploy` | `goci artifact-build-publish-deploy` |
| `deploy_apps` | goci in deploy-apps mode (after artifacts exist) |
| `publish_utility` | goci `publish-utility` flow |
23 changes: 21 additions & 2 deletions cmd/goci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import (
"github.com/Clever/ci-scripts/internal/environment"
"github.com/Clever/ci-scripts/internal/lambda"
"github.com/Clever/ci-scripts/internal/repo"
"github.com/Clever/ci-scripts/internal/slingshot"
ciIntegrationsModels "github.com/Clever/circle-ci-integrations/gen-go/models"
)

const usage = "usage: goci <validate|detect|artifact-build-publish-deploy|publish-utility>"
const usage = "usage: goci <validate|detect|artifact-build-publish-deploy|publish-utility|deploy-apps>"

// This app assumes the code has been checked out and that the
// repository is the working directory.
Expand Down Expand Up @@ -56,7 +57,7 @@ func run(mode string) error {
var err error

// Only discover applications for specific modes
if mode == "validate" || mode == "detect" || mode == "artifact-build-publish-deploy" {
if mode == "validate" || mode == "detect" || mode == "artifact-build-publish-deploy" || mode == "deploy-apps" {
apps, err = repo.DiscoverApplications("./launch")
if err != nil {
return err
Expand All @@ -79,6 +80,8 @@ func run(mode string) error {
case "detect":
fmt.Println(strings.Join(appIDs, " "))
return nil
case "deploy-apps":
return deployApps(appIDs)
case "artifact-build-publish-deploy":
// continue
default:
Expand Down Expand Up @@ -295,3 +298,19 @@ func publishUtility() error {
return nil

}

func deployApps(appIds []string) error {
if len(appIds) == 0 {
fmt.Println("No applications have buildable changes. If this is unexpected, " +
"double check your artifact dependency configuration in the launch yaml.")
return nil
}
ctx := context.Background()

if environment.Branch() == "master" {
if err := slingshot.New().DeployApps(ctx, appIds); err != nil {
return err
}
}
return validateRun()
}
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ require (
github.com/Clever/catapult/gen-go/models v1.206.0
github.com/Clever/circle-ci-integrations/gen-go/client v0.14.0
github.com/Clever/circle-ci-integrations/gen-go/models v0.14.0
github.com/Clever/slingshot/gen-go/client v1.1.0
github.com/Clever/slingshot/gen-go/models v1.1.0
github.com/Clever/wag/logging/wagclientlogger v0.0.0-20250514163731-344287ef8d81
github.com/aws/aws-sdk-go-v2 v1.36.5
github.com/aws/aws-sdk-go-v2/config v1.29.17
Expand Down
Loading