Skip to content

Commit ea35ac8

Browse files
authored
Merge pull request #49 from juarezr/chore/upgrade-ci-action-checkout
Upgrade ci action checkout
2 parents e889af1 + b6cf2b3 commit ea35ac8

8 files changed

Lines changed: 127 additions & 60 deletions

File tree

.github/actions/workflow-info/action.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: 'Report Workflow Information'
2-
description: 'Reusable action meant to be used in workflow steps'
1+
name: "Report Workflow Information"
2+
description: "Reusable action meant to be used in workflow steps"
33
branding:
4-
icon: 'watch'
5-
color: 'green'
4+
icon: "watch"
5+
color: "green"
66

77
inputs:
88
title:
9-
description: 'A reference to put in the report title'
9+
description: "A reference to put in the report title"
1010
required: true
11-
default: 'the Job'
11+
default: "the Job"
1212
parameters:
13-
description: 'Input variables used in Job'
13+
description: "Input variables used in Job"
1414
required: false
1515
content:
16-
description: 'Content to put in the report'
16+
description: "Content to put in the report"
1717
required: false
1818
outputs:
1919
status:
@@ -24,12 +24,12 @@ runs:
2424
steps:
2525
- name: Report Workflow Information
2626
id: report_workflow_generation
27-
env:
28-
REPORT_PARAMS: '${{ inputs.parameters }}'
29-
REPORT_CONTENT: '${{ inputs.content }}'
27+
env:
28+
REPORT_PARAMS: "${{ inputs.parameters }}"
29+
REPORT_CONTENT: "${{ inputs.content }}"
3030
shell: bash
3131
run: |
32-
echo "::group::Generating report"
32+
echo "::group::Generating report"
3333
echo "status=started" >> "${GITHUB_OUTPUT}";
3434
3535
dump_ctx(){
@@ -60,4 +60,3 @@ runs:
6060
6161
echo "status=finished" >> "${GITHUB_OUTPUT}";
6262
echo "::endgroup::"
63-

.github/workflows/build-release.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
workflow_dispatch:
99
inputs:
1010
release_version_tag:
11-
description: 'Run the workflow with what release tag?'
11+
description: "Run the workflow with what release tag?"
1212
required: true
1313
type: string
1414
branch_commit_or_ref:
15-
description: 'Run the release workflow in what branch/commit?'
15+
description: "Run the release workflow in what branch/commit?"
1616
required: true
1717
type: string
1818
default: master
@@ -24,20 +24,20 @@ jobs:
2424
strategy:
2525
fail-fast: true
2626
matrix:
27-
platform: [ linux, windows, macos ]
27+
platform: [linux, windows, macos]
2828
include:
29-
- platform: linux
30-
os: ubuntu-latest
31-
target: x86_64-unknown-linux-gnu
32-
channel: stable
33-
- platform: windows
34-
os: windows-latest
35-
target: x86_64-pc-windows-gnu
36-
channel: stable
37-
- platform: macos
38-
os: macos-latest
39-
target: x86_64-apple-darwin
40-
channel: stable
29+
- platform: linux
30+
os: ubuntu-latest
31+
target: x86_64-unknown-linux-gnu
32+
channel: stable
33+
- platform: windows
34+
os: windows-latest
35+
target: x86_64-pc-windows-gnu
36+
channel: stable
37+
- platform: macos
38+
os: macos-latest
39+
target: x86_64-apple-darwin
40+
channel: stable
4141

4242
env:
4343
RELEASE_VERSION: ${{ inputs.release_version_tag || github.event.release.tag_name }}
@@ -49,16 +49,16 @@ jobs:
4949
# region Workflow information
5050

5151
- name: Checkout sources
52-
uses: actions/checkout@v4
52+
uses: actions/checkout@v6
5353
with:
5454
ref: ${{ inputs.branch_commit_or_ref || '' }}
5555

5656
- name: Report Workflow Information
5757
id: workflow_report
5858
uses: ./.github/actions/workflow-info
5959
with:
60-
title: '${{ github.ref_name }}'
61-
parameters: '${{ toJson(inputs) }}'
60+
title: "${{ github.ref_name }}"
61+
parameters: "${{ toJson(inputs) }}"
6262
content: |
6363
### Release information
6464
- Tag Name: ${{ github.event.release.tag_name }}
@@ -148,11 +148,11 @@ jobs:
148148
if: matrix.os == 'ubuntu-latest'
149149
shell: bash
150150
run: |
151-
CARGO_VERSION=$(cargo get package.version --pretty)
152-
echo "CARGO_VERSION=$CARGO_VERSION"
153-
echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
151+
CARGO_VERSION=$(cargo get package.version --pretty)
152+
echo "CARGO_VERSION=$CARGO_VERSION"
153+
echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
154154
155-
test "$CARGO_VERSION" = "${{ env.RELEASE_VERSION }}"
155+
test "$CARGO_VERSION" = "${{ env.RELEASE_VERSION }}"
156156
157157
- name: Upload Debian, RPM and tar.gz Packages
158158
if: matrix.platform == 'linux'

.github/workflows/build-test-and-lint.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ name: build-test-and-lint
66

77
on:
88
push:
9-
branches: [ "master", "release/*" ]
9+
branches: ["master", "release/*"]
1010
pull_request:
11-
branches: [ master ]
11+
branches: [master]
1212
types: [opened, reopened, synchronize, ready_for_review]
1313
schedule:
1414
# Run on the 3rd of every month at 2:01
15-
- cron: '1 2 3 * *'
15+
- cron: "1 2 3 * *"
1616
workflow_dispatch:
1717
inputs:
1818
branch_commit_or_ref:
19-
description: 'Run this workflow in what branch/commit?'
19+
description: "Run this workflow in what branch/commit?"
2020
required: true
2121
type: string
2222
default: master
@@ -31,16 +31,16 @@ jobs:
3131
JOB_GITHUB_REF: ${{ github.head_ref || github.ref }}
3232
steps:
3333
- name: Checkout sources
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
3535
with:
3636
ref: ${{ inputs.branch_commit_or_ref || '' }}
3737

3838
- name: Report Workflow Information
3939
id: workflow_report
4040
uses: ./.github/actions/workflow-info
4141
with:
42-
title: '${{ github.ref_name }}'
43-
parameters: '${{ toJson(inputs) }}'
42+
title: "${{ github.ref_name }}"
43+
parameters: "${{ toJson(inputs) }}"
4444
content: |
4545
- Ref: ${{ github.head_ref }}
4646
@@ -50,14 +50,14 @@ jobs:
5050
strategy:
5151
fail-fast: true
5252
matrix:
53-
os: [ ubuntu-latest, windows-latest, macos-latest ]
54-
channel: [ stable ]
53+
os: [ubuntu-latest, windows-latest, macos-latest]
54+
channel: [stable]
5555

5656
steps:
5757
# region Checkout and Install
5858

5959
- name: Checkout sources
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@v6
6161
with:
6262
ref: ${{ inputs.branch_commit_or_ref || '' }}
6363

@@ -141,7 +141,7 @@ jobs:
141141

142142
- name: Run cargo clippy
143143
if: matrix.os == 'ubuntu-latest'
144-
continue-on-error: true # show all errors
144+
continue-on-error: true # show all errors
145145
shell: bash
146146
run: cargo clippy --all-features
147147

@@ -200,7 +200,7 @@ jobs:
200200
uses: coverallsapp/github-action@master
201201
with:
202202
github-token: ${{ secrets.GITHUB_TOKEN }}
203-
path-to-lcov: './lcov.info'
203+
path-to-lcov: "./lcov.info"
204204

205205
- name: Stop Solr server after tests
206206
if: matrix.os == 'ubuntu-latest'
@@ -225,12 +225,12 @@ jobs:
225225
strategy:
226226
fail-fast: true
227227
matrix:
228-
channel: [ stable ]
228+
channel: [stable]
229229
steps:
230230
# region Environment setup
231231

232232
- name: Checkout repository
233-
uses: actions/checkout@v4
233+
uses: actions/checkout@v6
234234
with:
235235
ref: ${{ inputs.branch_commit_or_ref || '' }}
236236

.github/workflows/security_audit.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
name: Monthly Security Audit
44
on:
55
schedule:
6-
- cron: '3 2 1 * *'
6+
- cron: "3 2 1 * *"
77
workflow_dispatch:
88
inputs:
99
branch_commit_or_ref:
10-
description: 'Run this workflow in what branch/commit?'
10+
description: "Run this workflow in what branch/commit?"
1111
required: true
1212
type: string
1313
default: master
@@ -18,16 +18,16 @@ jobs:
1818
strategy:
1919
fail-fast: true
2020
matrix:
21-
channel: [ stable ]
21+
channel: [stable]
2222
steps:
2323
# region Environment setup
2424

2525
- name: Checkout repository
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2727
with:
2828
ref: ${{ inputs.branch_commit_or_ref || '' }}
2929

30-
- name: Update Rust toolchain from channel ${{ matrix.channel }}
30+
- name: Update Rust toolchain from channel ${{ matrix.channel }}
3131
shell: bash
3232
run: |
3333
rustup self update
@@ -43,7 +43,7 @@ jobs:
4343
rustup show
4444
4545
# endregion
46-
46+
4747
# region Run security audit
4848

4949
- name: Intall cargo-audit from channel ${{ matrix.channel }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Cargo.lock
180180
# Files generated by solrcopy testing
181181

182182
*.zip
183+
*.pdf
183184
.env
184185

185186
#endregion ----------------------------------------------------------------------------------------

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ exclude = [
2828
]
2929

3030
[dependencies]
31-
clap = { version = "4.5.*", features = ["derive", "env", "color"] }
32-
clap_complete = "4.5.*"
31+
clap = { version = "4.6.*", features = ["derive", "env", "color"] }
32+
clap_complete = "4.6.*"
3333
clap_mangen = "0.2.*"
3434
regex = "1.12.*"
3535
url = "2.5.*"

README.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,67 @@ Command line tool useful for migration, transformations, backup, and restore of
1717

1818
## Usage
1919

20-
1. Use the command `solrcopy backup` for dumping documents from a Solr core into local zip files.
20+
### Process
21+
22+
1. Use the command `solrcopy backup` for dumping documents from a Solr core into local zip files:
2123
1. Use the switch `--query` for filtering the documents extracted by using a [Solr](https://lucene.apache.org/solr/guide/8_4/the-standard-query-parser.html) [Query](https://lucene.apache.org/solr/guide/8_4/the-standard-query-parser.html)
2224
2. Use the switch `--order` for specifying the sorting of documents extracted.
2325
3. Use the switches `--limit` and `--skip` for restricting the number of documents extracted.
2426
4. Use the switches `--select` and `--exclude` for restricting the columns extracted.
25-
2. Use the command `solrcopy restore` for uploading the extracted documents from local zip files into the same Solr core or another with same field names as extracted.
27+
2. Use the command `solrcopy restore` for uploading the extracted documents from local zip files into the same Solr core or another with same field names as extracted:
2628
1. The documents are updated in the target core in the same format that they were extracted.
2729
2. The documents are inserted/updated based on their `uniqueKey` field defined in core.
2830
3. If you want to change the documents/columns use the switches in `solrcopy backup` for extracting more than one slice of documents to be updated.
2931

32+
### Workflow
33+
34+
```mermaid
35+
flowchart LR
36+
A[(Source Solr Core)] --> B(solrcopy backup)
37+
B --> F[/Local zip archives/]
38+
F --> G(solrcopy restore)
39+
G --> M[(Target Solr core)]
40+
```
41+
42+
#### Backup Workflow
43+
44+
```mermaid
45+
flowchart TD
46+
A[(Source Solr Core)] --> B(solrcopy backup)
47+
B --> C{Backup options}
48+
C --> C1[Filter: --query / --fq]
49+
C --> C2[Select columns: --select / --exclude]
50+
C --> C3[Slice and order: --order / --skip / --limit / --iterate-by]
51+
C1 --> D@{ shape: processes, label: "Read documents from Solr core"}
52+
C2 --> D
53+
C3 --> D
54+
D --> E@{ shape: docs, label: "Export JSON batches"}
55+
E --> F@{ shape: processes, label: "Write local zip archives in --dir"}
56+
F --> G[/Documents stored as local zip archives/]
57+
```
58+
59+
#### Restore Workflow
60+
61+
```mermaid
62+
flowchart TD
63+
64+
E[/Local zip archives/] --> F[\Optional: inspect or transform extracted JSON/]
65+
F --> G(solrcopy restore)
66+
G --> H{Restore options}
67+
H --> H1[Select files: --search]
68+
H --> H2[Parallelism: --readers / --writers]
69+
H --> H3[Target: --url + --core]
70+
H1 --> I[[Find local zip archives in --dir]]
71+
H2 --> I
72+
H3 --> I
73+
I --> J@{ shape: processes, label: "Extract documents from archives"}
74+
J --> K@{ shape: docs, label: "Upload documents to target core"}
75+
K --> L@{ shape: processes, label: "Insert/Update by uniqueKey"}
76+
L --> M[(Target Solr core)]
77+
M --> N[/Documents persisted in Solr/]
78+
N --> O(solrcopy commit: Optional)
79+
```
80+
3081
### Environment Variables
3182

3283
The following environment variables can be used for common parameters:
@@ -258,6 +309,23 @@ Options:
258309
$ solrcopy restore --url http://localhost:8983/solr --dir ./tmp --core demo
259310
```
260311

312+
#### solrcopy info
313+
314+
``` text
315+
Get information about the Solr instance
316+
317+
Usage: solrcopy info [OPTIONS] --core <core>
318+
319+
Options:
320+
-u, --url <URL> Url pointing to the Solr cluster [env: SOLR_COPY_URL=] [default: http://localhost:8983/solr]
321+
-c, --core <core> Case sensitive name of the core in the Solr server
322+
--log-level <level> What level of detail should print messages [default: INFO]
323+
--log-mode <mode> Terminal output to print messages [default: mixed]
324+
--log-file-path <path> Write messages to a local file
325+
--log-file-level <level> What level of detail should write messages to the file [default: DEBUG]
326+
-h, --help Print help
327+
```
328+
261329
#### solrcopy delete
262330

263331
``` text

docker/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ configs:
9191
alias l='ls --escape --dereference-command-line --human-readable --time-style=iso --no-group --color=auto -CF'
9292
# END OF SCRIPT #
9393

94-
9594
solr-setup-precreate.sh:
9695
content: |
9796
#!/bin/bash

0 commit comments

Comments
 (0)