Skip to content

Commit ff65b39

Browse files
committed
[GHA] GCP Backup upload working
1 parent 17f9bbb commit ff65b39

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/scripts/copy-from-s3-to-gcp.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ file_name=${s3_url%/}
66
file_name=${file_name##*/}
77

88
# Download from S3 then upload to GCP
9-
aws s3 cp $s3_url . --recursive --no-progress
9+
dir=s3_download_$file_name
10+
mkdir $dir
11+
aws s3 cp $s3_url ./$dir --recursive --no-progress
1012
echo "-------"
11-
ls
13+
ls $dir
1214
echo "-------"
13-
gcp storage cp $gcp_url ./$file_name --recursive
14-
rm -rf $file_name
15+
gcloud storage cp $gcp_url ./$dir --recursive
16+
rm -rf dir

.github/workflows/backup-eclipse-releases-to-gcp.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
steps:
2828
- name: Authenticate to GCP
2929
run: |
30-
json='${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }}'
3130
echo '${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }}' > ./gcp.json
3231
gcloud auth activate-service-account --key-file=./gcp.json
3332
rm -f gcp.json
@@ -37,15 +36,14 @@ jobs:
3736
.github/scripts
3837
- name: Download from S3, Upload to GCP
3938
run: |
40-
url_path=spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.ls_version }}
41-
4239
echo "Copying Eclipse LS extensions ${{ inputs.ls_version }} to GCP..."
43-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
40+
url_path=spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.ls_version }}
41+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path --recursive
4442
4543
echo "Copying Eclipse Distro P2 repos ${{ inputs.ls_version }} to GCP..."
4644
url_path=spring-tools/release/TOOLS/sts4/update/${{ inputs.release_version }}.RELEASE
47-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
45+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path --recursive
4846
4947
echo "Copying Eclipse Distros ${{ inputs.release_version }} to GCP..."
5048
url_path=spring-tools/release/STS4/${{ inputs.release_version }}.RELEASE/dist
51-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
49+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path --recursive

0 commit comments

Comments
 (0)