mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 15:15:55 +08:00
only decrypt if the key is available (#3858)
* only decrypt if the key is available * Use script instead of explicit command * Don't deploy if the keyfile is missing/empty. * Don't deploy if key is not available. * Don't decrypt appveyor key if no secret * wrong name * Fix the logic and a typo
This commit is contained in:
parent
66c7eb72b5
commit
04b59affce
@ -1,9 +1,6 @@
|
|||||||
language: perl
|
language: perl
|
||||||
before_install:
|
before_install:
|
||||||
- openssl aes-256-cbc -K $encrypted_daaf322d08bf_key -iv $encrypted_daaf322d08bf_iv
|
- sh package/linux/travis-decrypt-key
|
||||||
-in $TRAVIS_BUILD_DIR/package/deploy/slic3r-upload.rsa.enc -out ~/slic3r-upload.rsa
|
|
||||||
-d
|
|
||||||
- chmod 600 ~/slic3r-upload.rsa
|
|
||||||
install:
|
install:
|
||||||
- export LDLOADLIBS=-lstdc++
|
- export LDLOADLIBS=-lstdc++
|
||||||
- export BOOST_DIR=$HOME/boost_1_63_0
|
- export BOOST_DIR=$HOME/boost_1_63_0
|
||||||
|
@ -16,8 +16,8 @@ environment:
|
|||||||
secure: fYPwnI3p6HNR+eMRJR3JfmyNolFn+Uc0MUn2bBXp9uU=
|
secure: fYPwnI3p6HNR+eMRJR3JfmyNolFn+Uc0MUn2bBXp9uU=
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- nuget install secure-file -ExcludeVersion
|
- IF DEFINED ENC_SECRET nuget install secure-file -ExcludeVersion
|
||||||
- secure-file\tools\secure-file -decrypt package/deploy/slic3r-upload.ppk.enc -secret %ENC_SECRET%
|
- IF DEFINED ENC_SECRET secure-file\tools\secure-file -decrypt package/deploy/slic3r-upload.ppk.enc -secret %ENC_SECRET%
|
||||||
- ps: "& package/win/appveyor_preinstall.ps1"
|
- ps: "& package/win/appveyor_preinstall.ps1"
|
||||||
cache:
|
cache:
|
||||||
- C:\Users\appveyor\boost.1.63.0.7z
|
- C:\Users\appveyor\boost.1.63.0.7z
|
||||||
|
@ -10,7 +10,11 @@ KEY=$1
|
|||||||
shift
|
shift
|
||||||
FILES=$*
|
FILES=$*
|
||||||
|
|
||||||
for i in $FILES; do
|
if [ -s $KEY ]; then
|
||||||
filepath=$(readlink -f "$i")
|
for i in $FILES; do
|
||||||
echo put $filepath | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/"
|
filepath=$(readlink -f "$i")
|
||||||
done
|
echo put $filepath | sftp -i$KEY "${UPLOAD_USER}@dl.slic3r.org:$DIR/"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "$KEY is not available, not deploying."
|
||||||
|
fi
|
||||||
|
@ -10,4 +10,6 @@ Param(
|
|||||||
)
|
)
|
||||||
Set-Variable -Name "UUSER" -Value "$env:UPLOAD_USER"
|
Set-Variable -Name "UUSER" -Value "$env:UPLOAD_USER"
|
||||||
Set-Variable -Name "UPLOAD" -Value "$($FILE | Resolve-Path)"
|
Set-Variable -Name "UPLOAD" -Value "$($FILE | Resolve-Path)"
|
||||||
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR -hostkey=*" "put $UPLOAD ./$FILE" "exit"
|
if (Test-Path $KEY) {
|
||||||
|
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR -hostkey=*" "put $UPLOAD ./$FILE" "exit"
|
||||||
|
}
|
||||||
|
7
package/linux/travis-decrypt-key
Normal file
7
package/linux/travis-decrypt-key
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Script to only decrypt if it is available
|
||||||
|
|
||||||
|
if [ ! -z ${encrypted_daaf322d08bf_key+x} ]; then
|
||||||
|
openssl aes-256-cbc -K $encrypted_daaf322d08bf_key -iv $encrypted_daaf322d08bf_iv -in $TRAVIS_BUILD_DIR/package/deploy/slic3r-upload.rsa.enc -out ~/slic3r-upload.rsa -d
|
||||||
|
chmod 600 ~/slic3r-upload.rsa
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user