-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from Clochette-AbsINThe/dev
🔖 Release 3.0.0
- Loading branch information
Showing
572 changed files
with
51,016 additions
and
17,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Contributing to clochette | ||
|
||
When contributing to this repository, please first discuss the change you wish to | ||
make via issue with the owners of this repository before making a change. | ||
|
||
## Branching | ||
|
||
If you would like to contribute to this project, you will need to use | ||
[git flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). This way, any and all changes | ||
happen on the development branch and not on the main branch. As such, after | ||
you have git-flow-ified your `ms-python-client` git repo (`git flow init`), create a pull request for your | ||
branch, and we'll take it from there. | ||
|
||
## Git Commit guidelines | ||
|
||
1. Separate subject from body with a blank line | ||
2. Limit the subject line to 50 characters | ||
3. Capitalize the subject line | ||
4. Do not end the subject line with a period | ||
5. Use the imperative mood in the subject line | ||
6. Wrap the body at 72 characters | ||
7. Use the body to explain what and why vs. how | ||
|
||
Source: https://chris.beams.io/posts/git-commit/ | ||
|
||
## Pull request guidelines | ||
|
||
> :warning: When submitting a Pull Request to this project for something more than a typo or small bug, | ||
> **please make sure your idea was discussed beforehand** with the development team, via an | ||
> [issue](https://github.com/bocabitlabs/buho-stocks/issues/new/choose). | ||
Open Source is about contributing back, but it's important to know how to do it in the best way possible. | ||
We don't want you to spend your precious time in a "ping-pong" of code reviews that will end up not being fun. | ||
We also want to maximize the chances that your contribution will already be done following what we consider good practices. | ||
|
||
1. The subject line should be a one-sentence summary, and should not include | ||
the word _and_ (explicitly or implied). | ||
2. Any extra detail should be provided in the body of the PR. | ||
3. Don't submit unrelated changes in the same pull request. | ||
4. If you had a bit of churn in the process of getting the change right, | ||
squash your commits. Refer to the guidelines on [squashing commits](git-basics.md#squashing). | ||
5. If you had to refactor in order to add your change, then we'd love to | ||
see two commits: First the refactoring, then the added behavior. It's | ||
fine to put this in the same pull request, unless the refactoring is | ||
huge and would make it hard to review both at the same time. | ||
6. If you are referencing another issue or pull-request, for instance | ||
_closes #XXX_, _see #XXX_, please include the reference in the body of the PR, | ||
rather than the subject line. This is simply because the subject line doesn't | ||
support markdown, and so these don't get turned into clickable links. It makes | ||
it harder to follow and to go look at the related issue or PR. | ||
7. Please also refer to the guidelines for [commit messages](git-basics.md#commit-messages). | ||
|
||
Once you've submitted a pull request, one or more of the maintainers will review it if all checks (tests and coverage pass). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: ⬆ | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/frontend" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: ⬆ | ||
groups: | ||
production-dependencies: | ||
dependency-type: production | ||
development-dependencies: | ||
dependency-type: development | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/backend" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: ⬆ | ||
groups: | ||
production-dependencies: | ||
dependency-type: production | ||
development-dependencies: | ||
dependency-type: development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build and push Docker images | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Release on push to main branch"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
env: | ||
GH_REGISTRY: ghcr.io | ||
|
||
jobs: | ||
get-version: | ||
if: github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag_name: ${{ steps.get-tag-name.outputs.tag_name }} | ||
steps: | ||
- name: Download artifact | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "version_number" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/version_number.zip`, Buffer.from(download.data)); | ||
- name: Unzip artifact | ||
run: unzip version_number.zip | ||
|
||
- name: Get tag name | ||
id: get-tag-name | ||
run: | | ||
echo "tag_name=$(cat version_number)" >> $GITHUB_OUTPUT | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
needs: get-version | ||
if: needs.get-version.outputs.tag_name != '' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.GH_REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker-Compose images | ||
run: | | ||
cd docker | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml build | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml push | ||
export tag=${{ needs.get-version.outputs.tag_name }} | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml build | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Dependabot auto-merge | ||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
# Disable this workflow for now | ||
if: ${{ github.actor == 'dependabot[bot]' && 1 == 0 }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Enable auto-merge for Dependabot PRs | ||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and push Docker images"] | ||
branches: [main] | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
deploy: | ||
if: github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ghcr.io | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
REPOSITORY: ${{ github.repository }} | ||
steps: | ||
- name: Deploy to production | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
envs: REGISTRY,GITHUB_TOKEN,REPOSITORY,REPOSITORY_OWNER | ||
script: | | ||
echo $GITHUB_TOKEN | docker login $REGISTRY -u $REPOSITORY_OWNER --password-stdin | ||
cd clochette | ||
rm -f docker-compose.yml docker-compose.prod.yml | ||
wget https://raw.githubusercontent.com/$REPOSITORY/main/docker/docker-compose.yml | ||
wget https://raw.githubusercontent.com/$REPOSITORY/main/docker/docker-compose.prod.yml | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml pull | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d | ||
docker image prune -f -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Test build docker | ||
|
||
on: | ||
pull_request: | ||
branches: [dev, main] | ||
|
||
defaults: | ||
run: | ||
working-directory: docker | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker-Compose images | ||
run: | | ||
docker compose -f docker-compose.yml -f docker-compose.prod.yml build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
branches: [dev] | ||
pull_request: | ||
branches: [dev, main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/[email protected] |
Oops, something went wrong.