尝试在 circleci 构建脚本中下载最新版本的 pandoc
Trying to download the latest version of pandoc in circleci build script
我正在尝试将我的自述文件从 markdown 转换为 reStructuredText
使用 pandoc 这样我就可以构建一个可以部署到 pypi 的 egg。不幸的是,circleci 正在使用的 pandoc 版本(1.17.2)在我如何构建一些表格方面存在问题。看起来如果我使用最新版本的 pandoc (2.9.1.1) 一切都会正常但我似乎无法让 circleci 下载最新版本。
到目前为止,我已尝试在 .circleci/config.yml:
中使用以下内容
steps:
- run: sudo apt-get update && sudo apt-get install -y pandoc
我得到以下输出:
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:3 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:4 http://deb.debian.org/debian stretch-backports InRelease [91.8 kB]
Hit:5 http://deb.debian.org/debian stretch Release
Fetched 277 kB in 0s (624 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
liblua5.1-0 libluajit-5.1-2 libluajit-5.1-common pandoc-data
Suggested packages:
texlive-latex-recommended texlive-xetex texlive-luatex pandoc-citeproc
texlive-latex-extra wkhtmltopdf
The following NEW packages will be installed:
liblua5.1-0 libluajit-5.1-2 libluajit-5.1-common pandoc pandoc-data
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 9724 kB of archives.
After this operation, 72.6 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 liblua5.1-0 amd64 5.1.5-8.1+b2 [111 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libluajit-5.1-common all 2.0.4+dfsg-1 [36.6 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 libluajit-5.1-2 amd64 2.0.4+dfsg-1+b1 [207 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 pandoc-data all 1.17.2~dfsg-3 [265 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 pandoc amd64 1.17.2~dfsg-3 [9104 kB]
Fetched 9724 kB in 0s (80.5 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package liblua5.1-0:amd64.
(Reading database ... 42585 files and directories currently installed.)
Preparing to unpack .../liblua5.1-0_5.1.5-8.1+b2_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8.1+b2) ...
Selecting previously unselected package libluajit-5.1-common.
Preparing to unpack .../libluajit-5.1-common_2.0.4+dfsg-1_all.deb ...
Unpacking libluajit-5.1-common (2.0.4+dfsg-1) ...
Selecting previously unselected package libluajit-5.1-2:amd64.
Preparing to unpack .../libluajit-5.1-2_2.0.4+dfsg-1+b1_amd64.deb ...
Unpacking libluajit-5.1-2:amd64 (2.0.4+dfsg-1+b1) ...
Selecting previously unselected package pandoc-data.
Preparing to unpack .../pandoc-data_1.17.2~dfsg-3_all.deb ...
Unpacking pandoc-data (1.17.2~dfsg-3) ...
Selecting previously unselected package pandoc.
Preparing to unpack .../pandoc_1.17.2~dfsg-3_amd64.deb ...
Unpacking pandoc (1.17.2~dfsg-3) ...
Setting up libluajit-5.1-common (2.0.4+dfsg-1) ...
Setting up pandoc-data (1.17.2~dfsg-3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libluajit-5.1-2:amd64 (2.0.4+dfsg-1+b1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8.1+b2) ...
Setting up pandoc (1.17.2~dfsg-3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
以下是有关 os 在我的构建中使用的信息:
> cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
我很想尝试获取最新版本 2.9.1.1
您可以使用此代码,我们也use with pandoc/lua-filter始终使用最新的 pandoc 版本:
RELEASES_URL='https://github.com/jgm/pandoc/releases'
# the 'latest' URL redirects to the name of the latest tag.
export PANDOCVERSION=$(curl -I "$RELEASES_URL/latest" | sed -ne 's#Location:.*tag/\(.*\)$##p' | tr -d "\n\r")
# Show pandoc version in logs
echo $PANDOCVERSION
# downloads and extract
wget $RELEASES_URL/download/$PANDOCVERSION/pandoc-$PANDOCVERSION-linux-amd64.tar.gz
tar xvzf pandoc-$PANDOCVERSION-linux-amd64.tar.gz
# add executable to PATH
export PATH=$HOME/pandoc-$PANDOCVERSION/bin:$PATH
我正在尝试将我的自述文件从 markdown 转换为 reStructuredText 使用 pandoc 这样我就可以构建一个可以部署到 pypi 的 egg。不幸的是,circleci 正在使用的 pandoc 版本(1.17.2)在我如何构建一些表格方面存在问题。看起来如果我使用最新版本的 pandoc (2.9.1.1) 一切都会正常但我似乎无法让 circleci 下载最新版本。
到目前为止,我已尝试在 .circleci/config.yml:
中使用以下内容steps:
- run: sudo apt-get update && sudo apt-get install -y pandoc
我得到以下输出:
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:3 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:4 http://deb.debian.org/debian stretch-backports InRelease [91.8 kB]
Hit:5 http://deb.debian.org/debian stretch Release
Fetched 277 kB in 0s (624 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
liblua5.1-0 libluajit-5.1-2 libluajit-5.1-common pandoc-data
Suggested packages:
texlive-latex-recommended texlive-xetex texlive-luatex pandoc-citeproc
texlive-latex-extra wkhtmltopdf
The following NEW packages will be installed:
liblua5.1-0 libluajit-5.1-2 libluajit-5.1-common pandoc pandoc-data
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 9724 kB of archives.
After this operation, 72.6 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 liblua5.1-0 amd64 5.1.5-8.1+b2 [111 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libluajit-5.1-common all 2.0.4+dfsg-1 [36.6 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 libluajit-5.1-2 amd64 2.0.4+dfsg-1+b1 [207 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 pandoc-data all 1.17.2~dfsg-3 [265 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 pandoc amd64 1.17.2~dfsg-3 [9104 kB]
Fetched 9724 kB in 0s (80.5 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package liblua5.1-0:amd64.
(Reading database ... 42585 files and directories currently installed.)
Preparing to unpack .../liblua5.1-0_5.1.5-8.1+b2_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8.1+b2) ...
Selecting previously unselected package libluajit-5.1-common.
Preparing to unpack .../libluajit-5.1-common_2.0.4+dfsg-1_all.deb ...
Unpacking libluajit-5.1-common (2.0.4+dfsg-1) ...
Selecting previously unselected package libluajit-5.1-2:amd64.
Preparing to unpack .../libluajit-5.1-2_2.0.4+dfsg-1+b1_amd64.deb ...
Unpacking libluajit-5.1-2:amd64 (2.0.4+dfsg-1+b1) ...
Selecting previously unselected package pandoc-data.
Preparing to unpack .../pandoc-data_1.17.2~dfsg-3_all.deb ...
Unpacking pandoc-data (1.17.2~dfsg-3) ...
Selecting previously unselected package pandoc.
Preparing to unpack .../pandoc_1.17.2~dfsg-3_amd64.deb ...
Unpacking pandoc (1.17.2~dfsg-3) ...
Setting up libluajit-5.1-common (2.0.4+dfsg-1) ...
Setting up pandoc-data (1.17.2~dfsg-3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libluajit-5.1-2:amd64 (2.0.4+dfsg-1+b1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8.1+b2) ...
Setting up pandoc (1.17.2~dfsg-3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
以下是有关 os 在我的构建中使用的信息:
> cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
我很想尝试获取最新版本 2.9.1.1
您可以使用此代码,我们也use with pandoc/lua-filter始终使用最新的 pandoc 版本:
RELEASES_URL='https://github.com/jgm/pandoc/releases'
# the 'latest' URL redirects to the name of the latest tag.
export PANDOCVERSION=$(curl -I "$RELEASES_URL/latest" | sed -ne 's#Location:.*tag/\(.*\)$##p' | tr -d "\n\r")
# Show pandoc version in logs
echo $PANDOCVERSION
# downloads and extract
wget $RELEASES_URL/download/$PANDOCVERSION/pandoc-$PANDOCVERSION-linux-amd64.tar.gz
tar xvzf pandoc-$PANDOCVERSION-linux-amd64.tar.gz
# add executable to PATH
export PATH=$HOME/pandoc-$PANDOCVERSION/bin:$PATH