Skip to content

Commit

Permalink
Merge branch 'main' into interface-any
Browse files Browse the repository at this point in the history
  • Loading branch information
manugupt1 authored Apr 1, 2023
2 parents 574872a + 43ee425 commit 8f7dad0
Show file tree
Hide file tree
Showing 37 changed files with 157 additions and 1,039 deletions.
33 changes: 0 additions & 33 deletions .circleci/config.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: gomod
Expand All @@ -9,3 +10,12 @@ updates:
include: scope
open-pull-requests-limit: 2
target-branch: main
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: update-github-action
include: scope
open-pull-requests-limit: 2
target-branch: main
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
name: continuous-integration

on:
- push
- pull_request
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.51.2

steps:
- uses: actions/checkout@v3
- name: Set up Go
Expand All @@ -13,7 +21,11 @@ jobs:
go-version-file: 'go.mod'
cache: true
- name: Lint code
run: make lint-docker
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
skip-pkg-cache: true
skip-build-cache: true

build:
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: unshallow
run: git fetch --prune --unshallow
- name: setup-go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
- name: capture current date
id: date
run: echo "::set-output name=date::$(date -u '+%Y-%m-%d-%H:%M:%S-%Z')"
Expand Down
18 changes: 2 additions & 16 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,7 @@ $ git cherry-pick <commit from main>
```

### Updating the helm chart

Regardless of which branch you created, you'll need to update the helm chart number. After you've cut the branch, make sure to change the versions in the [`Chart.yaml`](./charts/athens-proxy/Chart.yaml) file:

- If this is a new release of Athens, make sure to update the Docker image version [value](./charts/athens-proxy/values.yaml#L5)
- Increment the patch number in the [`version` field](./charts/athens-proxy/Chart.yaml#L2)
- Set the [`appVersion` field](./charts/athens-proxy/Chart.yaml#L2) to the semver of the new branch. Do not include the `v` prefix
see https://github.com/gomods/athens-charts

## Creating the new release in GitHub

Expand All @@ -311,17 +306,8 @@ Make sure the Github Actions CI/CD job finished, and check in Docker Hub to make
The Github Actions job will do everything except:

- Tweet out about the new release
- Update the helm chart in the `main` branch
- Update the helm chart

If you are a core maintainer and don't have access to the `@gomods` account, ask one of the maintainers to give you access. [Here](https://twitter.com/gomodsio/status/1240016379962691585) is an example showing the general format of these tweets. Obviously you should use your creativity here though!

Finally, you'll need to update the helm version number in the `main` branch. Create a new branch called `update-helm-$CURRENT_TAG` and update the following files:

- [charts/athens-proxy/values.yaml](./charts/athens-proxy/values.yaml) - update the `image.tag` field to the latest version number you created, including the `v`. This field should be near the top of the file
- [charts/athens-proxy/Chart.yaml](./charts/athens-proxy/Chart.yaml) - update the `version` field and the `appVersion` field
- Increment the patch number in the `version` field
- Change the `appVersion` field to the tag name of the GitHub version you created, including the `v`

[Here](https://github.com/gomods/athens/pull/1574) is an example of how to do this.

Finally, create a pull request from your new branch into the `main` branch. It will be reviewed and merged as soon as possible.
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.19
ARG GOLANG_VERSION=1.20
FROM golang:$GOLANG_VERSION

RUN echo $GOLANG_VERSION
Expand Down
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ DATE=$(shell date -u +%Y-%m-%d-%H:%M:%S-%Z)
GOLANGCI_LINT_VERSION=v1.51.2

ifndef GOLANG_VERSION
override GOLANG_VERSION = 1.19
override GOLANG_VERSION = 1.20
endif

.PHONY: build
build: ## build the athens proxy
go build -o ./cmd/proxy/proxy ./cmd/proxy
go build -ldflags="-w -s" -o ./cmd/proxy/proxy ./cmd/proxy

.PHONY: build-ver
build-ver: ## build the athens proxy with version number
GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$(VERSION) -X github.com/gomods/athens/pkg/build.buildDate=$(DATE)" -o athens ./cmd/proxy
GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -ldflags "-s -w -X github.com/gomods/athens/pkg/build.version=$(VERSION) -X github.com/gomods/athens/pkg/build.buildDate=$(DATE)" -o athens ./cmd/proxy

athens:
$(MAKE) build-ver
Expand Down Expand Up @@ -89,14 +89,6 @@ proxy-docker:
docker-push:
./scripts/push-docker-images.sh

.PHONY: charts-push
charts-push: build-image
docker run --rm -it \
-v `pwd`:/go/src/github.com/gomods/athens \
-e AZURE_STORAGE_CONNECTION_STRING \
-e CHARTS_REPO \
athens-build ./scripts/push-helm-charts.sh

bench:
./scripts/benchmark.sh

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
GOPROXY: https://proxy.golang.org
SKIP_UNTIL_113: true

stack: go 1.19
stack: go 1.20

test_script:
- go version
Expand Down
18 changes: 0 additions & 18 deletions charts/athens-proxy/Chart.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions charts/athens-proxy/OWNERS

This file was deleted.

85 changes: 1 addition & 84 deletions charts/athens-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,2 @@
# Athens Proxy Helm Chart

## What is Athens?

[Athens](https://docs.gomods.io) is a repository for packages used by your go packages.

Athens provides a repository for [Go Modules](https://github.com/golang/go/wiki/Modules) that you can run. It serves public code and your private code for you, so you don't have to pull directly from a version control system (VCS) like GitHub or GitLab.

## Prerequisites

* Kubernetes 1.10+

## Requirements

- A running Kubernetes cluster
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed and setup to use the cluster
- [Helm](https://helm.sh/) [installed](https://github.com/helm/helm#install) and setup to use the cluster (helm init) or [Tillerless Helm](https://github.com/rimusz/helm-tiller)

## Deploy Athens

The fastest way to install Athens using Helm is to deploy it from our public Helm chart repository. First, add the repository with this command:

Hint: To make the chart available again, the chart is temporarily hosted at sickhub.github.io until we've found a new solution.

```console
$ helm repo add athens https://sickhub.github.io/athens-proxy
$ helm repo update
```

Next, install the chart with default values to `athens` namespace:

```
$ helm install athens/athens-proxy -n athens --namespace athens
```

This will deploy a single Athens instance in the `athens` namespace with `disk` storage enabled. Additionally, a `ClusterIP` service will be created.


## Advanced Configuration

For more advanced configuration options please check Athens [docs](https://docs.gomods.io/install/install-on-kubernetes/#advanced-configuration).

Available options:
- [Replicas](https://docs.gomods.io/install/install-on-kubernetes/#replicas)
- [Access to private repositories via Github](https://docs.gomods.io/install/install-on-kubernetes/#give-athens-access-to-private-repositories-via-github-token-optional)
- [Storage Providers](https://docs.gomods.io/install/install-on-kubernetes/#storage-providers)
- [Kubernetes Service](https://docs.gomods.io/install/install-on-kubernetes/#kubernetes-service)
- [Ingress Resource](https://docs.gomods.io/install/install-on-kubernetes/#ingress-resource)
- [Upstream module repository](https://docs.gomods.io/install/install-on-kubernetes/#upstream-module-repository)
- [.netrc file support](https://docs.gomods.io/install/install-on-kubernetes/#netrc-file-support)
- [gitconfig support](https://docs.gomods.io/install/install-on-kubernetes/#gitconfig-support)

### Pass extra configuration environment variables

You can pass any extra environment variables supported in [config.dev.toml](../../../config.dev.toml).
The example below shows how to set username/password for basic auth:

```yaml
configEnvVars:
- name: BASIC_AUTH_USER
value: "some_user"
- name: BASIC_AUTH_PASS
value: "some_password"
```
### Private git servers over ssh support
One or more of git servers can added to `sshGitServers`, and the corresponding config files (git config and ssh config) and ssh keys will be created. Athens then will use these configs and keys to download the source from the git servers.

```yaml
sshGitServers:
## Private git servers over ssh
## to enable uncomment lines with single hash below
## hostname of the git server
- host: git.example.com
## ssh username
user: git
## ssh private key for the user
privateKey: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
## ssh port
port: 22
```
The chart has a new home at https://github.com/gomods/athens-charts
27 changes: 0 additions & 27 deletions charts/athens-proxy/templates/NOTES.txt

This file was deleted.

19 changes: 0 additions & 19 deletions charts/athens-proxy/templates/_helpers.tpl

This file was deleted.

26 changes: 0 additions & 26 deletions charts/athens-proxy/templates/config-ssh-git-servers.yaml

This file was deleted.

Loading

0 comments on commit 8f7dad0

Please sign in to comment.