Skip to content

Commit 21fa3ef

Browse files
committed
[GHA] GCP Backup upload testing
1 parent 3ff0b11 commit 21fa3ef

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
s3_url=$1
2+
gcp_url=$2
3+
4+
# Process s3_url remove trailing / and get the last segment without the trailing /
5+
file_name=${s3_url%/}
6+
file_name=${file_name##*/}
7+
8+
# Download from S3 then upload to GCP
9+
aws s3 cp $s3_url . --recursive --no-progress
10+
echo "-------"
11+
ls
12+
echo "-------"
13+
gcp storage cp $gcp_url ./$file_name --recursive
14+
rm -rf $file_name
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Backup Eclipse Releases to GCP
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ls_version:
7+
description: The suffix of the p2 repo URL in S3 (i.e. 2023-11-01)
8+
required: true
9+
type: string
10+
release_version:
11+
description: Release version (i.e. 4.20.1)
12+
required: true
13+
type: string
14+
15+
env:
16+
AWS_ACCESS_KEY_ID: ${{ secrets.CDN_S3_ACCESS_KEY }}
17+
AWS_SECRET_ACCESS_KEY: ${{ secrets.CDN_S3_SECRET_KEY }}
18+
AWS_DEFAULT_REGION: us-east-1
19+
AWS_ENDPOINT_URL_S3: ${{ secrets.CDN_S3_ENDPOINT }}
20+
AWS_S3_BUCKET: ${{ secrets.CDN_BUCKET }}
21+
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
22+
23+
jobs:
24+
backup-eclipse-releases-to-gcp:
25+
runs-on: ubuntu-latest
26+
name: Backup Eclipse releases for version '${{ inputs.release_version }}'
27+
steps:
28+
- name: Authenticate to GCP
29+
run: |
30+
echo -e "${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }} " > ~/gcp.json
31+
gcloud auth activate-service-account --key-file=~/gcp.json
32+
- uses: actions/checkout@v4
33+
with:
34+
sparse-checkout: |
35+
.github/scripts
36+
- name: Download from S3, Upload to GCP
37+
run: |
38+
url_path=spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.ls_version }}
39+
40+
echo "Copying Eclipse LS extensions ${{ inputs.ls_version }} to GCP..."
41+
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
42+
43+
echo "Copying Eclipse Distro P2 repos ${{ inputs.ls_version }} to GCP..."
44+
url_path=spring-tools/release/TOOLS/sts4/update/${{ inputs.release_version }}.RELEASE
45+
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
46+
47+
echo "Copying Eclipse Distros ${{ inputs.release_version }} to GCP..."
48+
url_path=spring-tools/release/STS4/${{ inputs.release_version }}.RELEASE/dist
49+
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path

0 commit comments

Comments
 (0)