Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9039177b7 | |||
| ddc7dba0a2 | |||
| bc3503f374 | |||
| 2dfe103687 |
@@ -45,5 +45,6 @@ jobs:
|
|||||||
tags: ${{ env.DEPLOY_NAME }}
|
tags: ${{ env.DEPLOY_NAME }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
platforms: linux/amd64, linux/arm64
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|||||||
+2
-1
@@ -32,7 +32,8 @@ COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
|
|||||||
|
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
bash \
|
bash \
|
||||||
git
|
git \
|
||||||
|
libc6-compat
|
||||||
|
|
||||||
VOLUME /wiki
|
VOLUME /wiki
|
||||||
WORKDIR /wiki
|
WORKDIR /wiki
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|||||||
s.rdoc_options = ['--charset=UTF-8']
|
s.rdoc_options = ['--charset=UTF-8']
|
||||||
s.extra_rdoc_files = %w[README.md LICENSE]
|
s.extra_rdoc_files = %w[README.md LICENSE]
|
||||||
|
|
||||||
|
s.add_dependency 'rdoc', '~> 6'
|
||||||
s.add_dependency 'gollum-lib', '~> 5.1'
|
s.add_dependency 'gollum-lib', '~> 5.1'
|
||||||
s.add_dependency 'kramdown', '~> 2.3'
|
s.add_dependency 'kramdown', '~> 2.3'
|
||||||
s.add_dependency 'kramdown-parser-gfm', '~> 1.1.0'
|
s.add_dependency 'kramdown-parser-gfm', '~> 1.1.0'
|
||||||
|
|||||||
+47
-49
@@ -25,62 +25,60 @@ def load_script(**args)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV['CI']
|
context '4.x -> 5.x tag migrator' do
|
||||||
context '4.x -> 5.x tag migrator' do
|
include Rack::Test::Methods
|
||||||
include Rack::Test::Methods
|
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
@path = cloned_testpath("examples/lotr_migration.git")
|
@path = cloned_testpath("examples/lotr_migration.git")
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'repair broken links' do
|
test 'repair broken links' do
|
||||||
# The original contents of Subdir/Foo.md:
|
# The original contents of Subdir/Foo.md:
|
||||||
#
|
#
|
||||||
# waa
|
# waa
|
||||||
# [[Samwi]]
|
# [[Samwi]]
|
||||||
# [[samwise gamgee.mediaWiki]]
|
# [[samwise gamgee.mediaWiki]]
|
||||||
# [[Samwise Gamgee.mediawiki]]
|
# [[Samwise Gamgee.mediawiki]]
|
||||||
# [[Samwise Gamgee]]
|
# [[Samwise Gamgee]]
|
||||||
# [[Test|Samwise Gamgee#Anchor]]
|
# [[Test|Samwise Gamgee#Anchor]]
|
||||||
# [[Waaa|Test]]
|
# [[Waaa|Test]]
|
||||||
# [[Zaa]]
|
# [[Zaa]]
|
||||||
#
|
#
|
||||||
# The contents will be updated after running the migration script.
|
# The contents will be updated after running the migration script.
|
||||||
load_script
|
load_script
|
||||||
|
|
||||||
file = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
|
file = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
|
||||||
assert_equal <<~FILE_CONTENTS, file.read
|
assert_equal <<~FILE_CONTENTS, file.read
|
||||||
waa
|
waa
|
||||||
[[Samwi]]
|
[[Samwi]]
|
||||||
[[/Samwise Gamgee.mediawiki]]
|
[[/Samwise Gamgee.mediawiki]]
|
||||||
[[/Samwise Gamgee.mediawiki]]
|
[[/Samwise Gamgee.mediawiki]]
|
||||||
[[/Samwise Gamgee.md]]
|
[[/Samwise Gamgee.md]]
|
||||||
[[Test|/Samwise Gamgee.md#Anchor]]
|
[[Test|/Samwise Gamgee.md#Anchor]]
|
||||||
[[Waaa|/Bar/Test.md]]
|
[[Waaa|/Bar/Test.md]]
|
||||||
[[Subsub/Zaa.md]]
|
[[Subsub/Zaa.md]]
|
||||||
FILE_CONTENTS
|
FILE_CONTENTS
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'change spaced filenames to hyphenated filenames' do
|
test 'change spaced filenames to hyphenated filenames' do
|
||||||
load_script(hyphenate: true)
|
load_script(hyphenate: true)
|
||||||
|
|
||||||
f = ::File.new(::File.join(@path, 'Home.textile'), 'r')
|
f = ::File.new(::File.join(@path, 'Home.textile'), 'r')
|
||||||
output = f.read
|
output = f.read
|
||||||
assert_equal true, output.include?('[[Bilbo-Baggins.md]]')
|
assert_equal true, output.include?('[[Bilbo-Baggins.md]]')
|
||||||
assert_equal true, output.include?('[[evil|Mordor/Eye-Of-Sauron.md]]')
|
assert_equal true, output.include?('[[evil|Mordor/Eye-Of-Sauron.md]]')
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'migration with page file dir' do
|
test 'migration with page file dir' do
|
||||||
load_script(page_file_dir: 'Subdir')
|
load_script(page_file_dir: 'Subdir')
|
||||||
|
|
||||||
f = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
|
f = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
|
||||||
output = f.read
|
output = f.read
|
||||||
assert_equal true, output.include?('[[Subsub/Zaa.md]]')
|
assert_equal true, output.include?('[[Subsub/Zaa.md]]')
|
||||||
assert_equal true, output.include?('[[Samwi]]')
|
assert_equal true, output.include?('[[Samwi]]')
|
||||||
end
|
end
|
||||||
|
|
||||||
teardown do
|
teardown do
|
||||||
FileUtils.rm_rf(@path)
|
FileUtils.rm_rf(@path)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user