Skip to content

Commit 961bd04

Browse files
author
lijianguo
committed
feat(passport): drycc oauth2
0 parents  commit 961bd04

75 files changed

Lines changed: 3024 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.drone/drone.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
kind: pipeline
2+
type: docker
3+
name: linux-amd64
4+
5+
platform:
6+
arch: amd64
7+
os: linux
8+
9+
steps:
10+
- name: test
11+
image: docker.io/drycc/go-dev
12+
pull: always
13+
privileged: true
14+
commands:
15+
- make test docker-build-test upload-coverage
16+
environment:
17+
VERSION: ${DRONE_TAG:-latest}-linux-amd64
18+
DEV_REGISTRY: ${DEV_REGISTRY:-docker.io}
19+
DRYCC_REGISTRY: ${DRYCC_REGISTRY:-docker.io}
20+
CODECOV_TOKEN:
21+
from_secret: codecov_token
22+
when:
23+
event:
24+
- push
25+
- tag
26+
- pull_request
27+
volumes:
28+
- name: image_registries
29+
path: /etc/containers/registries.conf
30+
31+
- name: publish
32+
image: docker.io/drycc/go-dev
33+
pull: always
34+
privileged: true
35+
commands:
36+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
37+
- make docker-build docker-immutable-push
38+
environment:
39+
VERSION: ${DRONE_TAG:-latest}-linux-amd64
40+
DEV_REGISTRY:
41+
from_secret: dev_registry
42+
DRYCC_REGISTRY:
43+
from_secret: drycc_registry
44+
DOCKER_USERNAME:
45+
from_secret: docker_username
46+
DOCKER_PASSWORD:
47+
from_secret: docker_password
48+
when:
49+
event:
50+
- push
51+
- tag
52+
volumes:
53+
- name: image_registries
54+
path: /etc/containers/registries.conf
55+
56+
trigger:
57+
event:
58+
- push
59+
- tag
60+
- pull_request
61+
62+
volumes:
63+
- name: image_registries
64+
host:
65+
path: /etc/containers/registries.conf
66+
67+
---
68+
kind: pipeline
69+
type: docker
70+
name: linux-arm64
71+
72+
platform:
73+
arch: arm64
74+
os: linux
75+
76+
steps:
77+
- name: publish
78+
image: docker.io/drycc/go-dev
79+
pull: always
80+
privileged: true
81+
commands:
82+
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
83+
- make docker-build docker-immutable-push
84+
environment:
85+
VERSION: ${DRONE_TAG:-latest}-linux-arm64
86+
DEV_REGISTRY:
87+
from_secret: dev_registry
88+
DRYCC_REGISTRY:
89+
from_secret: drycc_registry
90+
DOCKER_USERNAME:
91+
from_secret: docker_username
92+
DOCKER_PASSWORD:
93+
from_secret: docker_password
94+
volumes:
95+
- name: image_registries
96+
path: /etc/containers/registries.conf
97+
98+
trigger:
99+
event:
100+
- push
101+
- tag
102+
103+
volumes:
104+
- name: image_registries
105+
host:
106+
path: /etc/containers/registries.conf
107+
108+
---
109+
kind: pipeline
110+
type: docker
111+
name: manifest
112+
113+
steps:
114+
- name: generate manifest
115+
image: docker.io/library/alpine
116+
pull: always
117+
commands:
118+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
119+
environment:
120+
DRYCC_REGISTRY:
121+
from_secret: drycc_registry
122+
123+
- name: publish
124+
image: plugins/manifest
125+
settings:
126+
spec: .drone/manifest.tmpl
127+
username:
128+
from_secret: docker_username
129+
password:
130+
from_secret: docker_password
131+
environment:
132+
DEV_REGISTRY:
133+
from_secret: dev_registry
134+
DRYCC_REGISTRY:
135+
from_secret: drycc_registry
136+
137+
trigger:
138+
event:
139+
- push
140+
- tag
141+
142+
depends_on:
143+
- linux-amd64
144+
- linux-arm64
145+
146+
---
147+
kind: pipeline
148+
type: docker
149+
name: chart
150+
151+
steps:
152+
- name: generate chart
153+
image: docker.io/drycc/python-dev
154+
commands:
155+
- IMAGE_TAG=$([ ! -z $DRONE_TAG ] && echo \"${DRONE_TAG:1}\" || echo \"canary\")
156+
- sed -i "s/image_tag:\ \"canary\"/image_tag:\ $IMAGE_TAG/g" charts/passport/values.yaml
157+
- helm package charts/passport --version ${DRONE_TAG:-v1.0.0}
158+
- curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@passport-${DRONE_TAG:-v1.0.0}.tgz "$CHARTMUSEUM_API/api/$([ -z $DRONE_TAG ] && echo testing || echo stable)/charts"
159+
environment:
160+
CHARTMUSEUM_USERNAME:
161+
from_secret: chartmuseum_username
162+
CHARTMUSEUM_PASSWORD:
163+
from_secret: chartmuseum_password
164+
CHARTMUSEUM_API:
165+
from_secret: chartmuseum_api
166+
167+
trigger:
168+
event:
169+
- push
170+
- tag

.drone/manifest.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
image: docker.io/drycc/passport:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}}
2+
{{#if build.tags}}
3+
tags:
4+
{{#each build.tags}}
5+
- {{this}}
6+
{{/each}}
7+
{{/if}}
8+
manifests:
9+
-
10+
image: docker.io/drycc/passport:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
11+
platform:
12+
architecture: amd64
13+
os: linux
14+
-
15+
image: docker.io/drycc/passport:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64
16+
platform:
17+
architecture: arm64
18+
os: linux

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
*.py[cod]
2+
3+
# Packages
4+
*.egg
5+
*.egg-info
6+
dist
7+
build
8+
eggs
9+
parts
10+
var
11+
sdist
12+
develop-eggs
13+
.installed.cfg
14+
lib
15+
lib64
16+
17+
# coverage reports
18+
.coverage
19+
coverage.out
20+
coverage.xml
21+
htmlcov/
22+
23+
# python virtual environments for testing
24+
venv/
25+
26+
.idea
27+
env/

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Contributing to Drycc
2+
3+
This project is part of Drycc. You can find the latest contribution
4+
guidelines [in our documentation](https://drycc.com/docs/workflow/contributing/overview/).

DCO

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5+
660 York Street, Suite 102,
6+
San Francisco, CA 94110 USA
7+
8+
Everyone is permitted to copy and distribute verbatim copies of this
9+
license document, but changing it is not allowed.
10+
11+
12+
Developer's Certificate of Origin 1.1
13+
14+
By making a contribution to this project, I certify that:
15+
16+
(a) The contribution was created in whole or in part by me and I
17+
have the right to submit it under the open source license
18+
indicated in the file; or
19+
20+
(b) The contribution is based upon previous work that, to the best
21+
of my knowledge, is covered under an appropriate open source
22+
license and I have the right under that license to submit that
23+
work with modifications, whether created in whole or in part
24+
by me, under the same open source license (unless I am
25+
permitted to submit under a different license), as indicated
26+
in the file; or
27+
28+
(c) The contribution was provided directly to me by some other
29+
person who certified (a), (b) or (c) and I have not modified
30+
it.
31+
32+
(d) I understand and agree that this project and the contribution
33+
are public and that a record of the contribution (including all
34+
personal information I submit with it, including my sign-off) is
35+
maintained indefinitely and may be redistributed consistent with
36+
this project or the open source license(s) involved.

0 commit comments

Comments
 (0)