Skip to content

Commit

Permalink
chore: add initial version of renovate config (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored Feb 21, 2024
1 parent 3fa9560 commit df3f6e0
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Renovate
jobs:
renovate:
container:
env:
LOG_LEVEL: debug
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions"]'
RENOVATE_GIT_AUTHOR: Renovate GitHub Bot <github@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
RENOVATE_REPOSITORY_CACHE: enabled
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
image: ghcr.io/renovatebot/renovate:37.202.2
runs-on: ubuntu-latest
steps:
- run: env | sort
- run: |
if [ -z "${{ secrets.RENOVATE_TOKEN }}" ]; then
echo "RENOVATE_TOKEN not set, skipping ..."
else
renovate $RENOVATE_EXTRA_FLAG
fi
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 * * * 0,6'
workflow_dispatch: null
2 changes: 1 addition & 1 deletion .gitlab/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ci:
- '3.11'
- '3.12'
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- make dev
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ commitlint:
entrypoint: [""]
interruptible: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- |
Expand Down
3 changes: 2 additions & 1 deletion .gitlab/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dev-container-publish:
rules:
- changes:
- .devcontainer/Dockerfile
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "web"
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker context create builder
Expand Down
21 changes: 21 additions & 0 deletions .gitlab/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
renovate:
cache:
key: ${CI_COMMIT_REF_SLUG}-renovate
paths:
- renovate/cache/renovate/repository/
image: renovate/renovate:37.202.2
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $RENOVATE_TOKEN != null
script: renovate $RENOVATE_EXTRA_FLAG
stage: build
variables:
LOG_LEVEL: debug
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_BRANCH_PREFIX: renovate-gitlab/
RENOVATE_ENABLED_MANAGERS: '["pep621"]'
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_GIT_AUTHOR: Renovate GitLab Bot <gitlab@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: gitlab
RENOVATE_REPOSITORIES: '["$CI_PROJECT_PATH"]'
RENOVATE_REPOSITORY_CACHE: enabled
10 changes: 10 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices",
":maintainLockFilesWeekly"
],
"ignorePaths": [
"**/template/**"
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"pyproject",
"pytest",
"Quickstart",
"renovatebot",
"setuptools",
"softprops",
"sphinxcontrib",
Expand Down
12 changes: 12 additions & 0 deletions template/.renovaterc.json.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices",
":maintainLockFilesWeekly"
]
[%- if project_name == "Serious Scaffold Python" %],
"ignorePaths": [
"**/template/**"
]
[%- endif %]
}
1 change: 1 addition & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"pyproject",
"pytest",
"Quickstart",
"renovatebot",
"setuptools",
"softprops",
"sphinxcontrib",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Renovate
jobs:
renovate:
container:
env:
LOG_LEVEL: debug
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions"]'
RENOVATE_GIT_AUTHOR: Renovate GitHub Bot <github@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["{{ '${{ github.repository }}' }}"]'
RENOVATE_REPOSITORY_CACHE: enabled
RENOVATE_TOKEN: {{ '${{ secrets.RENOVATE_TOKEN }}' }}
image: ghcr.io/renovatebot/renovate:37.202.2
runs-on: ubuntu-latest
steps:
- run: env | sort
- run: |
if [ -z "{{ '${{ secrets.RENOVATE_TOKEN }}' }}" ]; then
echo "RENOVATE_TOKEN not set, skipping ..."
else
renovate $RENOVATE_EXTRA_FLAG
fi
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 * * * 0,6'
workflow_dispatch: null
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ci:
- '3.12'
[%- endif %]
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- make dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ commitlint:
entrypoint: [""]
interruptible: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ dev-container-publish:
rules:
- changes:
- .devcontainer/Dockerfile
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "web"
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker context create builder
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
renovate:
cache:
key: ${CI_COMMIT_REF_SLUG}-renovate
paths:
- renovate/cache/renovate/repository/
image: renovate/renovate:37.202.2
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $RENOVATE_TOKEN != null
script: renovate $RENOVATE_EXTRA_FLAG
stage: build
variables:
LOG_LEVEL: debug
RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
RENOVATE_BRANCH_PREFIX: renovate-gitlab/
RENOVATE_ENABLED_MANAGERS: '["pep621"]'
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_GIT_AUTHOR: Renovate GitLab Bot <gitlab@renovatebot.com>
RENOVATE_OPTIMIZE_FOR_DISABLED: 'true'
RENOVATE_PLATFORM: gitlab
RENOVATE_REPOSITORIES: '["$CI_PROJECT_PATH"]'
RENOVATE_REPOSITORY_CACHE: enabled

0 comments on commit df3f6e0

Please sign in to comment.