Skip to content

Commit 779d073

Browse files
authored
Merge pull request #151 from Clever/INFRANG-6709
[INFRANG-6709] Finish the README and docs
2 parents f3ccc56 + c5da725 commit 779d073

File tree

4 files changed

+40
-35
lines changed

4 files changed

+40
-35
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# ci-scripts
22

3-
Re-usable continuous integration (CI) scripts
4-
5-
Inspired by: https://circleci.com/blog/continuous-integration-at-segment/
3+
Re-usable continuous integration (CI) scripts and tools.
64

75
Owned by `#eng-infra`.
86

7+
## goci
8+
9+
goci is a go application tool intended for use in CI. It helps with building, publishing, and deploying applications. It is the next evolution of many of the scripts in this repository, and offers more automation, configurability and optimization.
10+
11+
See the [README](./cmd/goci/README.md) for more details
12+
913
## Scripts
1014

15+
### Note!!!
16+
Before adding any new scripts, or changing major functionality, you should strongly consider doing that work in the new [private Clever orbs repo](https://github.com/Clever/circleci-orbs/tree/master) instead. Orbs are more composable, more powerful and more maintainable.
17+
1118
### General-purpose
1219

1320
The following scripts don't rely on any Clever-specific tooling.
@@ -72,10 +79,3 @@ Publishes a workflow to [workflow-manager](https://github.com/clever/workflow-ma
7279
```
7380
$ ./circleci/workflow-publish [WF_URL] [WF_USER] [WF_PASS] [WF_JSON]
7481
```
75-
76-
#### Report-card
77-
78-
Disabled.
79-
80-
We still are keeping the script here so that repos that invoke it can do so safely.
81-
But it is a no-op.

VERSION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
v1.0.1
2-
- Instead of emitting an error on failed catalog syncs, simply warn
1+
v1.0.2
2+
variable MASTER_COMPARE is now required for local dev
33

44
Previously:
5+
- Instead of emitting an error on failed catalog syncs, simply warn
56
- Begin publishing goci binaries
67
- Call catalogue config with goci
78
- build with goci

cmd/goci/README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
# goci
22

3-
`goci` is a small command line application which performs packaging and
4-
publishing of Clever build artifacts.
3+
`goci` is a small command line application which performs building, publishing, and deploying applications. It is the next evolution of many of the scripts in this repository, and offers more automation, configurability and optimization.
54

6-
# Configuration
5+
## Configuration
76

8-
goci does not accept any arguments and is instead configured entirely
9-
through environment variables and launch config settings. See the
10-
[environment](../../internal/environment/environment.go) package for
11-
detailed documentation of environment variables for configuration. goci
12-
reads it's configuration from the `build` section of the launch config
13-
of each application.
7+
goci accepts very limited arguments which merely change the mode it runs in. The rest of the configuration is entirely through environment variables and launch config settings. See the[environment](../../internal/environment/environment.go) package for detailed documentation of environment variables for configuration. goci reads it's configuration from the `build` section of the launch config of each application. See the [build section](https://github.com/Clever/catapult/blob/master/swagger.yml#L1773) of the launch yaml to learn about the various parameters which configure goci.
148

15-
# Multi-app Support
9+
## Modes
10+
11+
1. `goci detect` detects any changed applications according to their launch configuration. This can be used to pass a name of apps to another script.
12+
2. `goci artifact-build-publish-deploy` builds, publishes and deploys any application artifacts.
13+
14+
15+
## Multi-app Support
1616

1717
goci will automatically detect all launch configs in the `launch`
1818
directory, then perform the following actions as needed.
1919

2020
1. detect the run type of the application
21-
2. build any docker images
22-
3. publish all built docker images to ECFR
23-
4. publish all pre-built lambdas to s3
21+
2. Run any configured build commands
22+
3. build any docker images
23+
4. publish all built docker images to all ECR regions
24+
5. publish all lambdas to s3 in all regions.
25+
6. Sync all changed apps with catalog config
26+
7. Publish new application versions to catapult
27+
8. Deploy any changed applications.
28+
29+
## Development
2430

25-
Currently, goci does not build lambdas.
31+
Since goci is just a go app, it can be run locally after building the binary. goci expects to be run from within the root of an applications repo.
2632

27-
## Running and testing locally
33+
There is a [test app](./testApp) in this repository which you can use to run goci on locally and test various build configurations. Additionally, you can leverage the built in integrations tests in https://github.com/Clever/circleci-orbs/tree/master, which call goci to test new builds of goci in CI.
2834

29-
Since goci is just a go app, it can be run locally after building the
30-
binary. goci expects to be run from within the root of an applications
31-
repo. You may use the `testApp` within this repo for testing various
32-
launch configurations of goci.
35+
### Running locally
36+
Running goci locally is not easy because it leverages a lot of variables set in our CI environments. Generally it would be easier to use the private orbs repo, or make a branch on another app like catapult and pull in the development branch of goci there for testing in CI. If you need to run locally, you can view each of the variables required for local runs in the environment file and provide them all to the command.
3337

3438
```bash
35-
$ go build -o ./bin/goci ./cmd/goci
39+
go build -o ./bin/goci ./cmd/goci
3640

37-
$ cp ./bin/goci ./testApp
41+
cp ./bin/goci ./testApp
3842

39-
$ cd testApp && goci
43+
cd testApp && goci
4044
```

internal/environment/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
2929
PreviousPipelineCompare = envMustString("PREVIOUS_PIPELINE_COMPARE", false)
3030
// PrimaryCompare is the git commit range to run change detection
3131
// commands against when running for a non-primary branch.
32-
PrimaryCompare = envMustString("MASTER_COMPARE", false)
32+
PrimaryCompare = envMustString("MASTER_COMPARE", true)
3333
// CatapultURL is the dns of the circle-ci-integrations ALB
3434
// including the protocol.
3535
CatapultURL = envMustString("CATAPULT_URL", true)

0 commit comments

Comments
 (0)