mirror of
https://github.com/sp-tarkov/build.git
synced 2025-02-13 02:50:46 -05:00
Updates the clean HTTPS source step to use LFTP. No terminal access. :(
This commit is contained in:
parent
cafabe0581
commit
25777ec7e4
@ -43,7 +43,7 @@ jobs:
|
|||||||
if: needs.check-tag-exists.outputs.proceed == 'true'
|
if: needs.check-tag-exists.outputs.proceed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: refringe/spt-build-node:1.0.2
|
image: refringe/spt-build-node:1.0.3
|
||||||
outputs:
|
outputs:
|
||||||
build_type: ${{ steps.build-type.outputs.build_type }}
|
build_type: ${{ steps.build-type.outputs.build_type }}
|
||||||
steps:
|
steps:
|
||||||
@ -262,7 +262,7 @@ jobs:
|
|||||||
needs: [check-tag-exists, build-server, build-modules, build-launcher]
|
needs: [check-tag-exists, build-server, build-modules, build-launcher]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: refringe/spt-build-node:1.0.2
|
image: refringe/spt-build-node:1.0.3
|
||||||
steps:
|
steps:
|
||||||
- name: Clean Directory
|
- name: Clean Directory
|
||||||
run: |
|
run: |
|
||||||
@ -337,26 +337,25 @@ jobs:
|
|||||||
|
|
||||||
- name: Clean Old SFTP Releases
|
- name: Clean Old SFTP Releases
|
||||||
run: |
|
run: |
|
||||||
|
cd /workspace/refringe/Build/
|
||||||
echo "${{ secrets.SFTP_HOST_KEY }}" > known_hosts
|
echo "${{ secrets.SFTP_HOST_KEY }}" > known_hosts
|
||||||
sshpass -p "${{ secrets.SFTP_PASSWORD }}" ssh -oPort=${{ secrets.SFTP_PORT }} -oConnectTimeout=20 -oUserKnownHostsFile=known_hosts -oStrictHostKeyChecking=yes ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }} << EOF
|
lftp -u ${{ secrets.SFTP_USERNAME }},${{ secrets.SFTP_PASSWORD }} sftp://${{ secrets.SFTP_HOST }}:${{ secrets.SFTP_PORT }} << EOF
|
||||||
|
set net:timeout 20
|
||||||
|
set net:connect-timeout 20
|
||||||
|
set sftp:connect-program "ssh -a -x -o ConnectTimeout=20 -o UserKnownHostsFile=$(pwd)/known_hosts -o StrictHostKeyChecking=yes"
|
||||||
cd /public
|
cd /public
|
||||||
# With a list of debug and bleeding edge builds...
|
cls -1 | grep -E 'SPT-(DEBUG|BLEEDING).*\.7z$' | awk '{
|
||||||
ls | grep -E 'SPT-(DEBUG|BLEEDING).*\.7z$' | while read -r filename; do
|
match(\$0, /([0-9]{8})\.7z$/, arr);
|
||||||
# Extract date from filename
|
"date +%s" | getline current_date;
|
||||||
if [[ "\$filename" =~ ([0-9]{8})\.7z$ ]]; then
|
file_date=substr(arr[1],1,4) "-" substr(arr[1],5,2) "-" substr(arr[1],7,2);
|
||||||
file_date="\${BASH_REMATCH[1]}"
|
"date -d" file_date " +%s" | getline file_date_sec;
|
||||||
file_date_fmt=\$(date -d "\${file_date:0:4}-\${file_date:4:2}-\${file_date:6:2}" +%s)
|
limit_date=current_date - (30 * 24 * 3600);
|
||||||
|
if (file_date_sec < limit_date) {
|
||||||
# Get current date minus 30 days
|
print \$0;
|
||||||
current_date=\$(date +%s)
|
}
|
||||||
limit_date=\$(date -d "@\$((current_date - 30 * 24 * 3600))" +%s)
|
}' | while read filename; do
|
||||||
|
|
||||||
# Compare dates and delete old files
|
|
||||||
if [[ "\$file_date_fmt" -lt "\$limit_date" ]]; then
|
|
||||||
echo "Deleting old file: \$filename"
|
echo "Deleting old file: \$filename"
|
||||||
rm "/public/\$filename"
|
rm "\$filename"
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
EOF
|
EOF
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -9,8 +9,9 @@ FROM node:20.10.0-bookworm
|
|||||||
# - tree (pretty print build directory structure)
|
# - tree (pretty print build directory structure)
|
||||||
# - p7zip-full (the goat)
|
# - p7zip-full (the goat)
|
||||||
# - sshpass (for automated SSH authentication)
|
# - sshpass (for automated SSH authentication)
|
||||||
|
# - lftp (for automated SFTP commands)
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget git git-lfs zstd tree p7zip-full sshpass && \
|
apt-get install -y wget git git-lfs zstd tree p7zip-full sshpass lftp && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
@ -37,10 +37,10 @@ Be sure to update the version number to the next available version before buildi
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Build and push the spt-build-node Docker image to the Docker Hub
|
# Build and push the spt-build-node Docker image to the Docker Hub
|
||||||
docker build -t refringe/spt-build-node:0.0.0 -t refringe/spt-build-node:latest -f Dockerfile.node .
|
docker build -t refringe/spt-build-node:1.0.4 -t refringe/spt-build-node:latest -f Dockerfile.node .
|
||||||
docker push refringe/spt-build-node --all-tags
|
docker push refringe/spt-build-node --all-tags
|
||||||
|
|
||||||
# Build and push the spt-build-dotnet Docker image to the Docker Hub
|
# Build and push the spt-build-dotnet Docker image to the Docker Hub
|
||||||
docker build -t refringe/spt-build-dotnet:0.0.0 -t refringe/spt-build-dotnet:latest -f Dockerfile.dotnet .
|
docker build -t refringe/spt-build-dotnet:1.0.1 -t refringe/spt-build-dotnet:latest -f Dockerfile.dotnet .
|
||||||
docker push refringe/spt-build-dotnet --all-tags
|
docker push refringe/spt-build-dotnet --all-tags
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user