diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index 571e961e3..c78b41de8 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -1,37 +1,37 @@ -$schema: "http://json.schemastore.org/buildkite" +$schema: 'http://json.schemastore.org/buildkite' env: # GCP VM image for the Vagrant smoke test. Build it in sourcegraph/infrastructure by running `make e2e` in `gcp/images` - IMAGE: "e2e-db8a40720-2024-08-26t08-44-10z" - VAGRANT_RUN_ENV: "CI" + IMAGE: 'e2e-db8a40720-2024-08-26t08-44-10z' + VAGRANT_RUN_ENV: 'CI' steps: - - label: ":docker:" + - label: ':docker:' command: .buildkite/validate-docker-compose.sh - agents: { queue: "vagrant" } + agents: { queue: 'vagrant' } - - label: ":lipstick:" + - label: ':lipstick:' command: .buildkite/prettier-check.sh - agents: { queue: "vagrant" } + agents: { queue: 'vagrant' } - - label: ":git: :sleuth_or_spy:" + - label: ':git: :sleuth_or_spy:' command: .buildkite/verify-release/verify-release.sh agents: { queue: standard } - - label: ":rice: docker-compose-test" + - label: ':rice: docker-compose-test' command: .buildkite/vagrant-run.sh docker-test artifact_paths: ./*.log - agents: { queue: "vagrant" } + agents: { queue: 'vagrant' } # Please keep in mind that the release manifest uses specific branch names when creating releases. # Therefore, if you update them, or if you decide to change how we detect what kind of build we're dealing # with, please update this file as well. - - label: "(internal) Release: test" + - label: '(internal) Release: test' if: build.branch =~ /^internal\/release-.*/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ command: | sg release run test --workdir=. --config-from-commit - - label: "(promote) Release: test" + - label: '(promote) Release: test' if: build.branch =~ /^promote\/release-.*/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ @@ -40,18 +40,16 @@ steps: - wait - - label: "(internal) Release: finalize" + - label: '(internal) Release: finalize' if: build.branch =~ /^internal\/release-.*/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ command: | sg release run internal finalize --workdir=. --config-from-commit - - - label: "(promote) Release: finalize" + - label: '(promote) Release: finalize' if: build.branch =~ /^promote\/release-.*/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ command: | sg release run promote-to-public finalize --workdir=. --config-from-commit - diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 10c798be2..000000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -.github/ -*.md diff --git a/.vscode/settings.json b/.vscode/settings.json index 8ef4ffc62..386b088b5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,6 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "[shellscript]": { - "editor.defaultFormatter": "foxundermoon.shell-format", - }, + "editor.defaultFormatter": "foxundermoon.shell-format" + } } diff --git a/batch-change/release.yaml b/batch-change/release.yaml index 2534f0a07..996ceb300 100644 --- a/batch-change/release.yaml +++ b/batch-change/release.yaml @@ -1,26 +1,26 @@ meta: - productName: "deploy-sourcegraph-docker" + productName: 'deploy-sourcegraph-docker' owners: - - "@sourcegraph/release" - repository: "github.com/sourcegraph/deploy-sourcegraph-docker" + - '@sourcegraph/release' + repository: 'github.com/sourcegraph/deploy-sourcegraph-docker' inputs: - releaseId: server requirements: # We use wget here, because curl --fail-with-body was introduced in a version ulterior to what we can have on the CI agents. - - name: "wget" - cmd: "wget --help" - - name: "GitHub cli exists" - cmd: "which gh" - fixInstructions: "install GitHub cli" - - name: "Docker username" - env: "DOCKER_USERNAME" - - name: "Docker password" - env: "DOCKER_PASSWORD" - - name: "GH auth status" - cmd: "gh auth status" - fixInstructions: "gh auth login" + - name: 'wget' + cmd: 'wget --help' + - name: 'GitHub cli exists' + cmd: 'which gh' + fixInstructions: 'install GitHub cli' + - name: 'Docker username' + env: 'DOCKER_USERNAME' + - name: 'Docker password' + env: 'DOCKER_PASSWORD' + - name: 'GH auth status' + cmd: 'gh auth status' + fixInstructions: 'gh auth login' internal: # Please keep in mind that the CI pipeline uses the branch names defined below when creating releases. @@ -48,7 +48,7 @@ internal: sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD ../docker-compose/ finalize: steps: - - name: "git:finalize" + - name: 'git:finalize' cmd: | set -eu @@ -64,7 +64,7 @@ internal: cat << EOF | buildkite-agent annotate --style info Internal release is ready for promotion under the branch [\`$branch\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/$branch). EOF - + - name: 'Register on release registry' cmd: | echo "Registering internal deploy-sourcegraph-docker {{version}} release on release registry" @@ -89,14 +89,14 @@ internal: test: steps: - - name: "Placeholder" + - name: 'Placeholder' cmd: | echo "Test" promoteToPublic: create: steps: - - name: "git" + - name: 'git' cmd: | set -eu branch="internal/release-{{version}}" @@ -162,7 +162,7 @@ promoteToPublic: Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/{{version}}). EOF - - name: "update main with latest version" + - name: 'update main with latest version' cmd: | set -eu branch="promote/release-{{version}}-update-main" @@ -178,14 +178,14 @@ promoteToPublic: registry=index.docker.io/sourcegraph sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD ../docker-compose/ - - name: "git:branch" + - name: 'git:branch' cmd: | set -eu branch="promote/release-{{version}}-update-main" git commit -am 'prep update main: {{version}}' -m 'update main with latest release' git push origin "${branch}" - - name: "github:pr" + - name: 'github:pr' cmd: | set -eu internal_branch="promote/release-{{version}}-update-main" diff --git a/docker-compose/db-only-migrate.docker-compose.yaml b/docker-compose/db-only-migrate.docker-compose.yaml index ca3d6340b..f48f6521a 100644 --- a/docker-compose/db-only-migrate.docker-compose.yaml +++ b/docker-compose/db-only-migrate.docker-compose.yaml @@ -1,4 +1,4 @@ -# This file contains the pgsql service definition (the primary Sourcegraph database deployment), +# This file contains the pgsql service definition (the primary Sourcegraph database deployment), # as well as the codeintel-db service definition (a separate postgres deployment). Both run postgres. # This file is used for database-only operations such as backup and restore. # See https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/operations diff --git a/docker-compose/dev/README.md b/docker-compose/dev/README.md index bf75a6e23..3572c40e5 100644 --- a/docker-compose/dev/README.md +++ b/docker-compose/dev/README.md @@ -8,7 +8,7 @@ This folder includes a helper script, [run.sh](./run.sh), that will run the `doc Example usage: ```sh -./run.sh up -d +./run.sh up -d ``` The above will deploy Sourcegraph on [http://localhost:8080](http://localhost:8080) with the indicated overlays. diff --git a/docker-compose/examples/README.md b/docker-compose/examples/README.md index 9eb01093a..bd54014d2 100644 --- a/docker-compose/examples/README.md +++ b/docker-compose/examples/README.md @@ -8,34 +8,34 @@ These best practices reduce the operational cost of keeping your Sourcegraph ins - Your docker-compose.override.yaml file should be stored, maintained, and fetched from a Git repo / code version control system, with meaningful commit messages, so that future you, and future admins, can understand why changes needed to be made - - Bonus points if your override file is stored outside of your clone of this deploy-sourcegraph-docker repo, so that this deploy-sourcegraph-docker repo can be deleted / recreated / `git reset --hard` as needed, without losing your customizations + - Bonus points if your override file is stored outside of your clone of this deploy-sourcegraph-docker repo, so that this deploy-sourcegraph-docker repo can be deleted / recreated / `git reset --hard` as needed, without losing your customizations - The examples in this directory use the current compose syntax, used by `docker compose`, the docker-compose-plugin. Some parts of this syntax may not be valid for the old `docker-compose` standalone binary. It is highly recommended to switch to using the new compose plugin. See Docker docs: - - Install Compose plugin - - https://docs.docker.com/compose/install + - Install Compose plugin + - https://docs.docker.com/compose/install - - Merging multiple compose files - - https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/ - - https://docs.docker.com/reference/compose-file/merge/#reset-value + - Merging multiple compose files + - https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/ + - https://docs.docker.com/reference/compose-file/merge/#reset-value - Using multiple compose / override files - - Old method: + - Old method: - - Store your docker-compose.override.yaml file inside this deploy-sourcegraph-docker repo, under the /docker-compose directory + - Store your docker-compose.override.yaml file inside this deploy-sourcegraph-docker repo, under the /docker-compose directory - - `docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml -f docker-compose.override.yaml up -d --remove-orphans` + - `docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml -f docker-compose.override.yaml up -d --remove-orphans` - - New method: + - New method: - - Store your docker-compose.override.yaml file in the parent directory / beside this deploy-sourcegraph-docker repo + - Store your docker-compose.override.yaml file in the parent directory / beside this deploy-sourcegraph-docker repo - - Create an `.env` file, containing the below + - Create an `.env` file, containing the below - - `docker compose up -d --remove-orphans` + - `docker compose up -d --remove-orphans` - - Note that any file paths (ex. mounting TLS CAs) are relative to the first compose file, so the mount path will likely start with `../../cert-chain.pem` if `cert-chain.pem` is in the parent directory / beside this deploy-sourcegraph-docker repo + - Note that any file paths (ex. mounting TLS CAs) are relative to the first compose file, so the mount path will likely start with `../../cert-chain.pem` if `cert-chain.pem` is in the parent directory / beside this deploy-sourcegraph-docker repo ```env SOURCEGRAPH=./deploy-sourcegraph-docker/docker-compose/docker-compose.yaml diff --git a/docker-compose/examples/aws-alb/docker-compose.override.yaml b/docker-compose/examples/aws-alb/docker-compose.override.yaml index e904ba6ab..7a580b833 100644 --- a/docker-compose/examples/aws-alb/docker-compose.override.yaml +++ b/docker-compose/examples/aws-alb/docker-compose.override.yaml @@ -1,18 +1,14 @@ # Docker Compose override snippet for customers using AWS ALBs to terminate TLS, # and do not need TLS between the ALB and their Sourcegraph intance - ## Overrides for services defined in the base docker-compose.yaml files services: - sourcegraph-frontend-0: - # Add port 80, for ALB target group, in place of Caddy ports: - - "0.0.0.0:80:3080" - + - '0.0.0.0:80:3080' -## Disable services + ## Disable services # Disable Caddy, because we're using an ALB for TLS termination caddy: !reset {} diff --git a/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml b/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml index a5a8ca557..439350a12 100644 --- a/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml +++ b/docker-compose/examples/aws-rds-databases/docker-compose.override.yaml @@ -1,19 +1,15 @@ # Docker Compose override file for customers using AWS IAM authentication to databases on RDS # See https://sourcegraph.com/docs/self-hosted/external-services/postgres#usage-with-aws-rds-iam-auth - - ## Reusable blocks of environment variables # For all containers, which connect to any of the databases +# Using AWS RDS IAM authentication, not a password, so instruct the psql library to refresh the token x-database-env-var-rds-iam-auth: &database-env-var-rds-iam-auth - - # Using AWS RDS IAM authentication, not a password, so instruct the psql library to refresh the token PG_CONNECTION_UPDATER: EC2_ROLE_CREDENTIALS # For both migrator and frontend x-database-env-vars: &database-env-vars - <<: *database-env-var-rds-iam-auth # NOTE: Must clear / override the PGDATASOURCE env vars, otherwise frontends don't start up @@ -22,39 +18,33 @@ x-database-env-vars: &database-env-vars PGSSLMODE: require PGDATABASE: sg PGUSER: sg - PGPASSWORD: "" - PGDATASOURCE: "" + PGPASSWORD: '' + PGDATASOURCE: '' CODEINTEL_PGHOST: example-database-codeintel.cluster-example.us-west-2.rds.amazonaws.com CODEINTEL_PGPORT: 5432 CODEINTEL_PGSSLMODE: require CODEINTEL_PGDATABASE: codeintel CODEINTEL_PGUSER: sg - CODEINTEL_PGPASSWORD: "" - CODEINTEL_PGDATASOURCE: "" + CODEINTEL_PGPASSWORD: '' + CODEINTEL_PGDATASOURCE: '' CODEINSIGHTS_PGHOST: example-database-codeinsights.cluster-example.us-west-2.rds.amazonaws.com CODEINSIGHTS_PGPORT: 5432 CODEINSIGHTS_PGSSLMODE: require CODEINSIGHTS_PGDATABASE: codeinsights CODEINSIGHTS_PGUSER: sg - CODEINSIGHTS_PGPASSWORD: "" - CODEINSIGHTS_PGDATASOURCE: "" - - + CODEINSIGHTS_PGPASSWORD: '' + CODEINSIGHTS_PGDATASOURCE: '' ## Overrides for services defined in the base docker-compose.yaml files services: - - gitserver-0: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: <<: *database-env-var-rds-iam-auth - migrator: - # !reset drops the depends_on config entirely, so that migrator will start up without the database containers depends_on: !reset [] @@ -85,25 +75,21 @@ services: # Do not skip the drift check, or use other args, without instruction from Sourcegraph Customer Support Engineering # If migrator fails to start up due to drift detected, or other issues, please open a support ticket by emailing support@sourcegraph.com - precise-code-intel-worker: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: <<: *database-env-var-rds-iam-auth - searcher-0: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: <<: *database-env-var-rds-iam-auth - sourcegraph-frontend-0: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: <<: *database-env-vars - sourcegraph-frontend-internal: # !override drops all depends_on from earlier compose files, then defines new ones, # to ensure it doesn't wait for the database containers, but also doesn't skip the dependency on migrator @@ -114,13 +100,11 @@ services: environment: <<: *database-env-vars - syntactic-code-intel-worker: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: <<: *database-env-var-rds-iam-auth - worker: # Add / merge the env vars, to only overwrite the ones we need, and leave the others intact environment: @@ -130,8 +114,7 @@ services: # TELEMETRY_GATEWAY_EXPORTER_USERMETADATA_EXPORT_ORGANIZATIONS: true # TELEMETRY_GATEWAY_EXPORTER_USERMETADATA_EXPORT_USERS: true - -## Disable services + ## Disable services # Drop built-in database services and volumes from the base compose file pgsql: !reset {} diff --git a/docker-compose/examples/external-databases/docker-compose.override.yaml b/docker-compose/examples/external-databases/docker-compose.override.yaml index 81451e000..215415db3 100644 --- a/docker-compose/examples/external-databases/docker-compose.override.yaml +++ b/docker-compose/examples/external-databases/docker-compose.override.yaml @@ -1,9 +1,8 @@ # Docker Compose override example of how to configure external databases x-env-vars-database: &env-vars-database - CODEINSIGHTS_PGDATABASE: sg - CODEINSIGHTS_PGDATASOURCE: "" + CODEINSIGHTS_PGDATASOURCE: '' CODEINSIGHTS_PGHOST: codeinsights.postgres.example.com CODEINSIGHTS_PGPASSWORD: super_long_secure_password CODEINSIGHTS_PGPORT: 5432 @@ -11,7 +10,7 @@ x-env-vars-database: &env-vars-database CODEINSIGHTS_PGUSER: sg CODEINTEL_PGDATABASE: sg - CODEINTEL_PGDATASOURCE: "" + CODEINTEL_PGDATASOURCE: '' CODEINTEL_PGHOST: codeintel.postgres.example.com CODEINTEL_PGPASSWORD: super_long_secure_password CODEINTEL_PGPORT: 5432 @@ -19,7 +18,7 @@ x-env-vars-database: &env-vars-database CODEINTEL_PGUSER: sg PGDATABASE: sg - PGDATASOURCE: "" + PGDATASOURCE: '' PGHOST: pgsql.postgres.example.com PGPASSWORD: super_long_secure_password PGPORT: 5432 @@ -30,9 +29,7 @@ x-env-vars-database: &env-vars-database # PG_CONNECTION_UPDATER: EC2_ROLE_CREDENTIALS # AWS_STS_REGIONAL_ENDPOINTS: regional - services: - migrator: depends_on: !reset [] # Remove the dependency on the built-in Postgres databases environment: !override @@ -49,7 +46,6 @@ services: environment: <<: *env-vars-database - # Disable built-in databases codeinsights-db-exporter: !reset {} codeinsights-db: !reset {} diff --git a/docker-compose/examples/migrator-operations/docker-compose.override.yaml b/docker-compose/examples/migrator-operations/docker-compose.override.yaml index 4fc3d4a98..a8c16e7c4 100644 --- a/docker-compose/examples/migrator-operations/docker-compose.override.yaml +++ b/docker-compose/examples/migrator-operations/docker-compose.override.yaml @@ -1,16 +1,13 @@ ## Overrides for services defined in the base docker-compose.yaml files services: - migrator: - ################################################################################ # Normal startup of migrator should only ever use the default "up" command, no additional args # Overriding the command should only to be used to make specific changes, on single startups, only when needed, only when directed by Sourcegraph Customer Support Engineering # If you find that your migrator needs (an) additional arg(s) to run, there's something wrong with your databases; please open a support ticket by emailing support@sourcegraph.com - command: ["up"] + command: ['up'] ################################################################################ - ################################################################################ # Initializing new databases @@ -29,7 +26,6 @@ services: # command: ["add-log", "-db=codeinsights", "-version=1675347548"] ################################################################################ - ################################################################################ # Multi-version upgrades # See https://sourcegraph.com/docs/self-hosted/deploy/docker-compose/upgrade#multi-version-upgrades diff --git a/otel-collector/config.yaml b/otel-collector/config.yaml index a06de1961..ff83affa6 100644 --- a/otel-collector/config.yaml +++ b/otel-collector/config.yaml @@ -15,14 +15,14 @@ exporters: extensions: health_check: - endpoint: ":13133" + endpoint: ':13133' zpages: - endpoint: "localhost:55679" + endpoint: 'localhost:55679' service: telemetry: metrics: - address: ":8888" + address: ':8888' pipelines: traces: exporters: diff --git a/package.json b/package.json index 8add73664..ed7e2c42e 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "scripts": { - "prettier": "prettier '**/{*.{js?(on),ts?(x),graphql,md,scss},.*.js?(on)}' --write --list-different --config prettier.config.js", - "prettier-check": "yarn -s run prettier --write=false" + "prettier": "prettier . --write --list-different", + "prettier-check": "prettier . --check" }, "devDependencies": { - "@sourcegraph/prettierrc": "3.0.2", - "prettier": "1.19.1" + "@sourcegraph/prettierrc": "3.0.3", + "prettier": "3.9.10" } } diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index b32ac0c3d..581273087 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -1,6 +1,6 @@ # Prometheus global config global: - scrape_interval: 30s + scrape_interval: 30s evaluation_interval: 30s # scrape_timeout is set to the global default (10s). diff --git a/prometheus/prometheus_targets.yml b/prometheus/prometheus_targets.yml index e7cc3e623..78a434a95 100644 --- a/prometheus/prometheus_targets.yml +++ b/prometheus/prometheus_targets.yml @@ -1,88 +1,88 @@ --- - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: node targets: - cadvisor:48080 - sourcegraph-frontend-internal:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: worker targets: - worker:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: worker-executors targets: - worker:6996 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: node targets: - syntect-server:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: precise-code-intel-worker targets: - precise-code-intel-worker:6060 # Add new entries here for every searcher/symbol/gitserver replica. - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: zoekt-indexserver targets: - zoekt-indexserver-0:6072 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: zoekt-webserver targets: - zoekt-webserver-0:6070 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: sourcegraph-frontend targets: - sourcegraph-frontend-0:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: gitserver targets: - gitserver-0:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: searcher targets: - searcher-0:6060 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: pgsql targets: - pgsql-exporter:9187 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: codeintel-db targets: - codeintel-db-exporter:9187 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: codeinsights-db targets: - codeinsights-db-exporter:9187 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: redis-cache targets: - redis-cache:9121 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: redis-store targets: - redis-store:9121 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: node-exporter targets: - node-exporter:9100 - labels: - nodename: "sourcegraph-docker-compose-host" + nodename: 'sourcegraph-docker-compose-host' job: otel-collector targets: - otel-collector:8888 diff --git a/release.yaml b/release.yaml index b043fe076..90bf8fdf1 100644 --- a/release.yaml +++ b/release.yaml @@ -1,25 +1,25 @@ --- meta: - productName: "deploy-sourcegraph-docker" + productName: 'deploy-sourcegraph-docker' owners: - - "@sourcegraph/release" - repository: "github.com/sourcegraph/deploy-sourcegraph-docker" + - '@sourcegraph/release' + repository: 'github.com/sourcegraph/deploy-sourcegraph-docker' inputs: - releaseId: server requirements: # We use wget here, because curl --fail-with-body was introduced in a version ulterior to what we can have on the CI agents. - - name: "wget" - cmd: "wget --help" - - name: "GitHub cli exists" - cmd: "which gh" - fixInstructions: "install GitHub cli" - - name: "Docker username" - env: "DOCKER_USERNAME" - - name: "Docker password" - env: "DOCKER_PASSWORD" - - name: "GH auth status" - cmd: "gh auth status" - fixInstructions: "gh auth login" + - name: 'wget' + cmd: 'wget --help' + - name: 'GitHub cli exists' + cmd: 'which gh' + fixInstructions: 'install GitHub cli' + - name: 'Docker username' + env: 'DOCKER_USERNAME' + - name: 'Docker password' + env: 'DOCKER_PASSWORD' + - name: 'GH auth status' + cmd: 'gh auth status' + fixInstructions: 'gh auth login' internal: # Please keep in mind that the CI pipeline uses the branch names defined below when creating releases. @@ -28,71 +28,71 @@ internal: create: steps: patch: - - name: docker(compose):tags - cmd: | - set -eu - registry=us-docker.pkg.dev/sourcegraph-images/internal - sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ - - name: "git:branch" - cmd: | - set -eu - branch="internal/release-{{version}}" - git switch -c "${branch}" - git commit -am 'release_patch: {{version}}' -m '{{config}}' - git push origin ${branch} - - name: "github:pr" - cmd: | - gh pr create \ - --fill \ - --draft \ - --title "(internal) release_patch: build {{version}}" \ - --body "Test plan: automated release PR, CI will perform additional checks" - echo "🚢 Please check the associated CI build to ensure the process completed". + - name: docker(compose):tags + cmd: | + set -eu + registry=us-docker.pkg.dev/sourcegraph-images/internal + sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ + - name: 'git:branch' + cmd: | + set -eu + branch="internal/release-{{version}}" + git switch -c "${branch}" + git commit -am 'release_patch: {{version}}' -m '{{config}}' + git push origin ${branch} + - name: 'github:pr' + cmd: | + gh pr create \ + --fill \ + --draft \ + --title "(internal) release_patch: build {{version}}" \ + --body "Test plan: automated release PR, CI will perform additional checks" + echo "🚢 Please check the associated CI build to ensure the process completed". minor: - - name: docker(compose):tags - cmd: | - set -eu - registry=us-docker.pkg.dev/sourcegraph-images/internal - sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ - - name: "git:branch" - cmd: | - set -eu - branch="internal/release-{{version}}" - git switch -c "${branch}" - git commit -am 'release_minor: {{version}}' -m '{{config}}' - git push origin ${branch} - - name: "github:pr" - cmd: | - gh pr create \ - --fill \ - --draft \ - --title "(internal) release_minor: build {{version}}" \ - --body "Test plan: automated release PR, CI will perform additional checks" - echo "🚢 Please check the associated CI build to ensure the process completed". + - name: docker(compose):tags + cmd: | + set -eu + registry=us-docker.pkg.dev/sourcegraph-images/internal + sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ + - name: 'git:branch' + cmd: | + set -eu + branch="internal/release-{{version}}" + git switch -c "${branch}" + git commit -am 'release_minor: {{version}}' -m '{{config}}' + git push origin ${branch} + - name: 'github:pr' + cmd: | + gh pr create \ + --fill \ + --draft \ + --title "(internal) release_minor: build {{version}}" \ + --body "Test plan: automated release PR, CI will perform additional checks" + echo "🚢 Please check the associated CI build to ensure the process completed". major: - - name: docker(compose):tags - cmd: | - set -eu - registry=us-docker.pkg.dev/sourcegraph-images/internal - sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ - - name: "git:branch" - cmd: | - set -eu - branch="internal/release-{{version}}" - git switch -c "${branch}" - git commit -am 'release_major: {{version}}' -m '{{config}}' - git push origin ${branch} - - name: "github:pr" - cmd: | - gh pr create \ - --fill \ - --draft \ - --title "(internal) release_major: build {{version}}" \ - --body "Test plan: automated release PR, CI will perform additional checks" - echo "🚢 Please check the associated CI build to ensure the process completed". + - name: docker(compose):tags + cmd: | + set -eu + registry=us-docker.pkg.dev/sourcegraph-images/internal + sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ + - name: 'git:branch' + cmd: | + set -eu + branch="internal/release-{{version}}" + git switch -c "${branch}" + git commit -am 'release_major: {{version}}' -m '{{config}}' + git push origin ${branch} + - name: 'github:pr' + cmd: | + gh pr create \ + --fill \ + --draft \ + --title "(internal) release_major: build {{version}}" \ + --body "Test plan: automated release PR, CI will perform additional checks" + echo "🚢 Please check the associated CI build to ensure the process completed". finalize: steps: - - name: "git:finalize" + - name: 'git:finalize' cmd: | set -eu @@ -108,7 +108,7 @@ internal: cat << EOF | buildkite-agent annotate --style info Internal release is ready for promotion under the branch [\`$branch\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/$branch). EOF - + - name: 'Register on release registry' cmd: | echo "Registering internal deploy-sourcegraph-docker {{version}} release on release registry" @@ -132,14 +132,14 @@ internal: fi test: steps: - - name: "Placeholder" + - name: 'Placeholder' cmd: | echo "Test" promoteToPublic: create: steps: - - name: "git" + - name: 'git' cmd: | set -eu branch="internal/release-{{version}}" @@ -150,14 +150,14 @@ promoteToPublic: set -eu registry=index.docker.io/sourcegraph sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ - - name: "git:branch" + - name: 'git:branch' cmd: | set -eu branch="promote/release-{{version}}" git switch -c "${branch}" git commit -am 'promote-release: {{version}}' -m '{{config}}' git push origin "${branch}" - - name: "github:pr" + - name: 'github:pr' cmd: | set -eu internal_branch="internal/release-{{version}}" @@ -225,8 +225,8 @@ promoteToPublic: Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/{{version}}). EOF - - name: "update main with latest version" - - name: "git" + - name: 'update main with latest version' + - name: 'git' cmd: | set -eu branch="promote/release-{{version}}-update-main" @@ -242,14 +242,14 @@ promoteToPublic: registry=index.docker.io/sourcegraph sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/ - - name: "git:branch" + - name: 'git:branch' cmd: | set -eu branch="promote/release-{{version}}-update-main" git commit -am 'prep update main: {{version}}' -m 'update main with latest release' git push origin "${branch}" - - name: "github:pr" + - name: 'github:pr' cmd: | set -eu # Create PR to merge release updates into main branch diff --git a/test/servers.yaml b/test/servers.yaml index 36780dbe7..a2497e9b8 100644 --- a/test/servers.yaml +++ b/test/servers.yaml @@ -1,14 +1,13 @@ --- - name: docker-test box: google/gce - machine_type: "custom-16-20480" + machine_type: 'custom-16-20480' project_id: sourcegraph-ci external_ip: false use_private_ip: true network: default username: buildkite - ssh_key_path: "~/.ssh/id_rsa" + ssh_key_path: '~/.ssh/id_rsa' service_account: e2e-builder@sourcegraph-ci.iam.gserviceaccount.com shell_commands: - - "/deploy-sourcegraph-docker/test/smoke-test.sh" - + - '/deploy-sourcegraph-docker/test/smoke-test.sh' diff --git a/yarn.lock b/yarn.lock index f9a81fe41..369d84ac5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,12 +2,12 @@ # yarn lockfile v1 -"@sourcegraph/prettierrc@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@sourcegraph/prettierrc/-/prettierrc-3.0.2.tgz#a8fb80ed5712a59cd60eb62f0969090ebc386a80" - integrity sha512-HCEKIIgOLap22yvnMcr+v6X/1LK6LuVd5MhGLxjYsb7irI2KNEQpalR5SKjsfYPawzVcgCPu1QsD0Oy4iGdPuA== +"@sourcegraph/prettierrc@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@sourcegraph/prettierrc/-/prettierrc-3.0.3.tgz#51bfa9b2588fe35121593fa877143e6373028289" + integrity sha512-FQ1/Ued4I02R0JkrHHofDN163juVxUnPALzfxPZrDZUHv+c3jHjfZhmTHEz+Wd+g3b7MFk0fkj36nZSnvPyU8A== -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@3.9.10: + version "3.9.10" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.9.10.tgz#ac378e432f1a7381518f2e080816bbaefa38d585" + integrity sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==