Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Skeleton #1

Merged
merged 23 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: main

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
tests:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.29-strict/stable
juju-channel: 3.4/stable
lxd-channel: 5.20/stable
- name: format
run: |
tox -e format
- name: lint
run: |
tox -e lint
- name: static
run: |
tox -e static
- name: store cert & pk secrets
env:
CERT: ${{ secrets.TEST_CERTIFICATE }}
PK: ${{ secrets.TEST_CERTIFICATE_PK }}
run: |
echo $CERT > src/configs/cert.pem
echo $PK > src/configs/key.pem
- name: unit tests
run: |
tox -e unit
- name: integration tests
run: |
tox -e integration
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -160,3 +159,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.vscode
*.charm
*.pem
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @canonical/tls
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributing

To make contributions to this charm, you'll need a working [development setup](https://juju.is/docs/sdk/dev-setup).

You can create an environment for development with `tox`:

```shell
tox devenv -e integration
source venv/bin/activate
```

## Testing

This project uses `tox` for managing test environments. There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the charm:

```shell
tox run -e format # update your code according to linting rules
tox run -e lint # code style
tox run -e static # static type checking
tox run -e unit # unit tests
tox run -e integration # integration tests
tox # runs 'format', 'lint', 'static', and 'unit' environments
```

## Build the charm

Build the charm in this git repository using:

```shell
charmcraft pack
```

Deploy it by using:

```shell
juju deploy ./gocert-k8s_ubuntu-22.04-amd64.charm --resource gocert-image=ghcr.io/canonical/gocert
```
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,18 @@ Manage your certificates in charms
## OCI Images

- GoCert: [ghcr.io/canonical/gocert](https://github.com/canonical/gocert)

# gocert

Charmhub package name: gocert
More information: https://charmhub.io/gocert

GoCert can help you manage your certificates, from simple all the way up to enterprise deployments.
kayra1 marked this conversation as resolved.
Show resolved Hide resolved

## Other resources

- [Read more](https://github.com/canonical/gocert/blob/main/README.md)

- [Contributing](CONTRIBUTING.md)

- See the [Juju SDK documentation](https://juju.is/docs/sdk) for more information about developing and improving charms.
43 changes: 43 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.
kayra1 marked this conversation as resolved.
Show resolved Hide resolved

name: gocert-k8s
type: charm
title: GoCert
summary: charming certificate management made easy
kayra1 marked this conversation as resolved.
Show resolved Hide resolved

description: |
GoCert is an application that helps you manage certificate requests and their associated certificates.
kayra1 marked this conversation as resolved.
Show resolved Hide resolved
Charmed GoCert can help you automatically receive CSRs and distribute certificates to the applications
kayra1 marked this conversation as resolved.
Show resolved Hide resolved
you've deployed in your model.

provides:
certificates:
interface: tls-certificates

bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"

containers:
gocert:
resource: gocert-image

kayra1 marked this conversation as resolved.
Show resolved Hide resolved
resources:
gocert-image:
type: oci-image
description: OCI image for the 'GoCert' application
upstream-source: ghcr.io/canonical/gocert:0.0.2

parts:
charm:
build-packages:
- libffi-dev
- libssl-dev
- rustc
- cargo
- pkg-config
Loading