Skip to content

Commit 340e4ff

Browse files
committed
feat(workflow): switch charts to oci
1 parent 2056f3b commit 340e4ff

10 files changed

Lines changed: 55 additions & 55 deletions

File tree

.drone/drone.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ steps:
3535
- name: publish-charts
3636
commands:
3737
- pip install -r requirements.txt
38-
- python3 _scripts/dependency_update.py "$CHARTMUSEUM_API/$([ -z $DRONE_TAG ] && echo testing || echo stable)" "charts/workflow/Chart.yaml"
39-
- helm package charts/workflow -u --version ${DRONE_TAG:-v1.0.0}
40-
- curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@workflow-${DRONE_TAG:-v1.0.0}.tgz "$CHARTMUSEUM_API/api/$([ -z $DRONE_TAG ] && echo testing || echo stable)/charts"
38+
- python3 _scripts/dependency_update.py "oci://$DRYCC_REGISTRY/$([ -z $DRONE_TAG ] && echo charts-testing || echo charts)" "charts/workflow/Chart.yaml"
39+
- helm dependency update charts/workflow
40+
- helm package charts/workflow -u --version $([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v})
41+
- echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
42+
- helm push workflow-$([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v}).tgz oci://$DRYCC_REGISTRY/$([ -z $DRONE_TAG ] && echo charts-testing || echo charts)
4143
- bash _scripts/generate_cache.sh
4244
environment:
43-
CHARTMUSEUM_API:
44-
from_secret: chartmuseum_api
45-
CHARTMUSEUM_USERNAME:
46-
from_secret: chartmuseum_username
47-
CHARTMUSEUM_PASSWORD:
48-
from_secret: chartmuseum_password
45+
DRYCC_REGISTRY:
46+
from_secret: drycc_registry
47+
CONTAINER_USERNAME:
48+
from_secret: container_username
49+
CONTAINER_PASSWORD:
50+
from_secret: container_password
4951

5052
trigger:
5153
event:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ lib
1515
lib64
1616
bower_components
1717
.sass-cache
18+
charts/workflow/charts
19+
charts/workflow/Chart.lock
1820

1921
# python virtual environments for testing
2022
venv/
@@ -23,4 +25,4 @@ _build/
2325

2426
.DS_Store
2527
.idea/*
26-
.vscode/
28+
.vscode/

_scripts/dependency_update.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ def dump_requirements(requirements_file, requirements):
1616
with open(requirements_file, "w") as f:
1717
return yaml.dump(requirements, stream=f, Dumper=yaml.Dumper)
1818

19-
def update_dependencies(index, requirements, url):
19+
def update_dependencies(requirements, url):
2020
for dependency in requirements["dependencies"]:
21-
entries = index["entries"][dependency["name"]]
22-
entries.sort(key=lambda x: x["created"])
23-
dependency["version"] = entries[-1]["version"]
2421
dependency["repository"] = url
2522

2623
if __name__ == "__main__":
27-
index = load_index(sys.argv[1] + "/index.yaml")
2824
requirements = load_requirements(sys.argv[2])
29-
update_dependencies(index, requirements, sys.argv[1])
25+
update_dependencies(requirements, sys.argv[1])
3026
dump_requirements(sys.argv[2], requirements)
3127

_scripts/generate_cache.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ helm fetch jetstack/cert-manager
2525

2626
for tar in `ls $tmp | grep .tgz`
2727
do
28-
curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@$tar "$CHARTMUSEUM_API/api/$([ -z $DRONE_TAG ] && echo testing || echo stable)/charts"
28+
helm push $tar oci://$DRYCC_REGISTRY/$([ -z $DRONE_TAG ] && echo charts-testing || echo charts)
2929
done

_scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function install_helm {
5959
tar -zxvf "${tar_name}"
6060
mv "linux-${ARCH}/helm" /usr/local/bin/helm
6161
rm -rf "${tar_name}" "linux-${ARCH}"
62-
helm repo add --force-update drycc https://charts.drycc.cc/${CHANNEL:-stable}
62+
helm repo add --force-update drycc oci://registry.drycc.cc/$([ $CHANNEL == "stable" ] && echo charts || echo charts-testing)
6363
helm repo update
6464
}
6565

charts/workflow/Chart.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
name: workflow
21
apiVersion: v2
3-
home: https://github.com/drycc/workflow
42
dependencies:
53
- name: builder
6-
version: <builder-tag>
7-
repository: https://charts.drycc.cc/stable/builder
4+
repository: oci://registry.drycc.cc/charts-testing
5+
version: x.x.x
86
- name: imagebuilder
9-
version: <imagebuilder-tag>
10-
repository: https://charts.drycc.cc/stable/imagebuilder
7+
repository: oci://registry.drycc.cc/charts-testing
8+
version: x.x.x
119
- name: controller
12-
version: <controller-tag>
13-
repository: https://charts.drycc.cc/stable/controller
10+
repository: oci://registry.drycc.cc/charts-testing
11+
version: x.x.x
1412
- name: database
15-
version: <database-tag>
16-
repository: https://charts.drycc.cc/stable/database
13+
repository: oci://registry.drycc.cc/charts-testing
14+
version: x.x.x
1715
- name: fluentd
18-
version: <fluentd-tag>
19-
repository: https://charts.drycc.cc/stable/fluentd
16+
repository: oci://registry.drycc.cc/charts-testing
17+
version: x.x.x
2018
- name: redis
21-
version: <redis-tag>
22-
repository: https://charts.drycc.cc/stable/redis
19+
repository: oci://registry.drycc.cc/charts-testing
20+
version: x.x.x
2321
- name: logger
24-
version: <logger-tag>
25-
repository: https://charts.drycc.cc/stable/logger
22+
repository: oci://registry.drycc.cc/charts-testing
23+
version: x.x.x
2624
- name: storage
27-
version: <storage-tag>
28-
repository: https://charts.drycc.cc/stable/storage
25+
repository: oci://registry.drycc.cc/charts-testing
26+
version: x.x.x
2927
- name: monitor
30-
version: <monitor-tag>
31-
repository: https://charts.drycc.cc/stable/monitor
28+
repository: oci://registry.drycc.cc/charts-testing
29+
version: x.x.x
3230
- name: registry
33-
version: <registry-tag>
34-
repository: https://charts.drycc.cc/stable/registry
31+
repository: oci://registry.drycc.cc/charts-testing
32+
version: x.x.x
3533
- name: registry-proxy
36-
version: <registry-proxy-tag>
37-
repository: https://charts.drycc.cc/stable/registry-proxy
34+
repository: oci://registry.drycc.cc/charts-testing
35+
version: x.x.x
3836
- name: influxdb
39-
version: <influxdb-tag>
40-
repository: https://charts.drycc.cc/stable/influxdb
37+
repository: oci://registry.drycc.cc/charts-testing
38+
version: x.x.x
4139
- name: rabbitmq
42-
version: <rabbitmq-tag>
43-
repository: https://charts.drycc.cc/stable/rabbitmq
40+
repository: oci://registry.drycc.cc/charts-testing
41+
version: x.x.x
4442
- name: passport
45-
version: <passport-tag>
46-
repository: https://charts.drycc.cc/stable/passport
43+
repository: oci://registry.drycc.cc/charts-testing
44+
version: x.x.x
4745
description: Drycc Workflow
46+
home: https://github.com/drycc/workflow
4847
maintainers:
49-
- name: Team Drycc
50-
email: team@drycc.cc
48+
- email: team@drycc.cc
49+
name: Team Drycc
50+
name: workflow
5151
version: v1.0.0

src/_includes/install-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Drycc Chart Repository contains everything needed to install Drycc Workflow
1717
Add this repository to Helm:
1818

1919
```
20-
$ helm repo add drycc https://charts.drycc.cc/stable
20+
$ helm repo add drycc oci://registry.drycc.cc/charts
2121
```
2222

2323
## Install Drycc Workflow

src/installing-workflow/configuring-object-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you are using AWS S3 and your Kubernetes nodes are configured with appropriat
2929

3030
### Step 3: Add Drycc Repo
3131

32-
If you haven't already added the Helm repo, do so with `helm repo add drycc https://charts.drycc.cc/stable`
32+
If you haven't already added the Helm repo, do so with `helm repo add drycc oci://registry.drycc.cc/charts`
3333

3434
### Step 4: Configure Workflow Chart
3535

src/installing-workflow/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The Drycc Chart Repository contains everything needed to install Drycc Workflow
4444
Add this repository to Helm:
4545

4646
```
47-
$ helm repo add drycc https://charts.drycc.cc/stable
47+
$ helm repo add drycc oci://registry.drycc.cc/charts
4848
```
4949

5050
## Install Drycc Workflow

src/roadmap/releases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ this chart will also be packaged, signed and uploaded to its production chart re
134134
verify it can be fetched (and verified):
135135

136136
```
137-
$ helm repo add controller https://charts.drycc.cc/stable
137+
$ helm repo add controller oci://registry.drycc.cc/charts
138138
"controller" has been added to your repositories
139139
$ helm fetch --verify drycc/controller --version v1.0.1
140140
Verification: &{0xc4207ec870 sha256:026e766e918ff28d2a7041bc3d560d149ee7eb0cb84165c9d9d00a3045ff45c3 controller-v1.0.1.tgz}
@@ -209,7 +209,7 @@ the chart versions existing in the `WORKFLOW_PREV_RELEASE` chart and the _most r
209209
(Therefore, if there are any unreleased commits in a component repo, they will not appear here):
210210

211211
```bash
212-
helm repo add drycc https://charts.drycc.cc/stable
212+
helm repo add drycc oci://registry.drycc.cc/charts
213213
helm fetch --untar drycc/workflow --version $WORKFLOW_PREV_RELEASE
214214
dryccrel changelog global workflow/requirements.lock map.json > changelog-$WORKFLOW_RELEASE.md
215215
```

0 commit comments

Comments
 (0)