Skip to content

Commit cb45c04

Browse files
committed
migrate skaraMirror.sh to be a python script
1 parent 4b89764 commit cb45c04

File tree

9 files changed

+828
-0
lines changed

9 files changed

+828
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: pip
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/linters/.markdown-lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
###########################
2+
###########################
3+
## Markdown Linter rules ##
4+
###########################
5+
###########################
6+
7+
# Linter rules doc:
8+
# - https://github.com/DavidAnson/markdownlint
9+
#
10+
# Note:
11+
# To comment out a single error:
12+
# <!-- markdownlint-disable -->
13+
# any violations you want
14+
# <!-- markdownlint-restore -->
15+
#
16+
17+
###############
18+
# Rules by id #
19+
###############
20+
MD013: false # Line length is usually not important and the 80 char limit is way too small anyway
21+
MD033: false # Inline HTML is important for multilines and checkboxes within markdown tables

.github/workflows/linter.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
###########################
3+
###########################
4+
## Linter GitHub Actions ##
5+
###########################
6+
###########################
7+
name: Linter
8+
9+
#
10+
# Documentation:
11+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
12+
#
13+
14+
####################################################################
15+
# Start the job on all pull requests that target the master branch #
16+
####################################################################
17+
on:
18+
pull_request:
19+
branches: [master]
20+
21+
###############
22+
# Set the Job #
23+
###############
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
linter:
29+
# Name the Job
30+
permissions:
31+
contents: read # for actions/checkout to fetch code
32+
statuses: write # for github/super-linter to mark status of each linter run
33+
name: Lint Code Base
34+
# Set the agent to run on
35+
runs-on: ubuntu-latest
36+
37+
##################
38+
# Load all steps #
39+
##################
40+
steps:
41+
##########################
42+
# Checkout the code base #
43+
##########################
44+
- name: Checkout Code
45+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
46+
with:
47+
# Full git history is needed to get a proper list of changed files within `super-linter`
48+
fetch-depth: 0
49+
50+
################################
51+
# Run Linter against code base #
52+
################################
53+
- name: Lint Code Base
54+
uses: github/super-linter@45fc0d88288beee4701c62761281edfee85655d7 # v5.0.0
55+
env:
56+
VALIDATE_ALL_CODEBASE: false
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
# Markdown lint complains about the issue templates
59+
FILTER_REGEX_EXCLUDE: .github/ISSUE_TEMPLATE/*
60+
# Lots of shellcheck errors - need fixing
61+
VALIDATE_BASH: false

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
test_python:
12+
name: Python
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
17+
18+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
19+
with:
20+
python-version: '3'
21+
22+
- name: Install Python Dependencies
23+
run: pip install -r requirements.txt
24+
25+
- name: Run Python Tests
26+
run: python -m unittest test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ workspace
55
pipelines/.gradle
66
pipelines/gradle-cache
77
pipelines/target
8+
__pycache__

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
GitPython==3.1.43
2+
tqdm==4.66.2

skaraMirror.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# OpenJDK Mirroring Script
2+
3+
This script automates the process of mirroring OpenJDK repositories from GitHub to Adoptium. It is designed to clone specific JDK versions, add upstream Skara repositories, and perform merges as necessary to keep the Adoptium mirrors up to date with OpenJDK development.
4+
5+
## Features
6+
7+
- **Clone Repositories:** Clone OpenJDK repositories for specific JDK versions.
8+
- **Add Skara Upstream:** Configure Skara repository as a remote upstream.
9+
- **Merge Changes:** Merge changes from Skara into the GitHub repository and manage branch merges for release and development purposes.
10+
11+
## Prerequisites
12+
13+
Python 3.6 or higher
14+
Ensure you have Git installed and configured on your system.
15+
16+
## Installation
17+
18+
Install the required Python dependencies:
19+
20+
```bash
21+
pip install -r requirements.txt
22+
```
23+
24+
## Usage
25+
26+
The script supports various operations based on command-line arguments:
27+
28+
```bash
29+
./skaraMirror.py <jdk_version> [repo_url] [branch]
30+
```
31+
32+
- `<jdk_version>`: The JDK version to mirror (e.g., jdk8u, jdk17u).
33+
- `[repo_url]`: (Optional) URL of the repository to mirror. Defaults to [email protected]:adoptium.
34+
- `[branch]`: (Optional) Branch to mirror. Defaults to master.
35+
36+
## Examples
37+
38+
Mirror the JDK 17 repository:
39+
40+
```bash
41+
./skaraMirror.py jdk17u
42+
```
43+
44+
Mirror the JDK 8 repository from a specific repository and branch:
45+
46+
```bash
47+
./skaraMirror.py jdk8u [email protected]:custom_org custom_branch
48+
```

0 commit comments

Comments
 (0)