-
-
Notifications
You must be signed in to change notification settings - Fork 27
Checksum1.1 #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Checksum1.1 #152
Changes from all commits
0c873ea
b11f054
3adea0d
3d7c9a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,19 +100,27 @@ jobs: | |
| with: | ||
| project_id: ${{ secrets.GCS_PROJECT_ID }} | ||
| credentials_json: ${{ secrets.GCS_DOWNLOADS_SERVICE_ACCOUNT_JSON }} | ||
|
|
||
| - name: Google Cloud Setup | ||
| if: ${{ github.event_name=='push' }} | ||
| uses: google-github-actions/setup-gcloud@v2 | ||
| with: | ||
| project_id: ${{ secrets.GCS_PROJECT_ID }} | ||
|
|
||
| - name: Generate checksums for compiled packages | ||
| if: ${{ github.event_name=='push' }} | ||
| run: | | ||
| find ${{ env.DOWNLOADS_DIR }}/${{ env.START_TIME }}/openwisp_monitoring -type f -name "*.ipk" -exec sha256sum {} \; > ${{ env.DOWNLOADS_DIR }}/${{ env.START_TIME }}/openwisp_monitoring/sha256sums.txt | ||
|
|
||
| - name: Define Storage Paths | ||
| run: | | ||
| echo "SRC_URL=${{ env.DOWNLOADS_DIR }}/${{ env.START_TIME }}/openwisp_monitoring" >> $GITHUB_ENV | ||
| echo "DST_URL=gs://${{ secrets.GCS_DOWNLOADS_BUCKET_NAME }}/openwisp-monitoring/${{ env.START_TIME }}-${{ env.COMMIT_SHA }}" >> $GITHUB_ENV | ||
| echo "LATEST_URL=gs://${{ secrets.GCS_DOWNLOADS_BUCKET_NAME }}/openwisp-monitoring/latest" >> $GITHUB_ENV | ||
|
|
||
| - name: Upload compiled packages to downloads.openwisp.io | ||
| if: ${{ github.event_name=='push' }} | ||
| run: | | ||
| gsutil -m rsync -r ${{ env.SRC_URL }} ${{ env.DST_URL }} | ||
| gsutil -m rsync -r -d ${{ env.SRC_URL }} ${{ env.LATEST_URL }} | ||
| env: | ||
| SRC_URL: ${{ env.DOWNLOADS_DIR }}/${{ env.START_TIME }}/openwisp_monitoring | ||
| DST_URL: gs://${{ secrets.GCS_DOWNLOADS_BUCKET_NAME }}/openwisp-monitoring/${{ env.START_TIME }}-${{ env.COMMIT_SHA }} | ||
| LATEST_URL: gs://${{ secrets.GCS_DOWNLOADS_BUCKET_NAME }}/openwisp-monitoring/latest | ||
| gsutil -m rsync -r $SRC_URL $DST_URL | ||
| gsutil -m rsync -r -d $SRC_URL $LATEST_URL | ||
| gsutil cp $SRC_URL/sha256sums.txt $DST_URL/ | ||
| gsutil cp $SRC_URL/sha256sums.txt $LATEST_URL/ | ||
|
Comment on lines
+123
to
+126
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are already syncing the source with destination, then why we need to add checksum files ourselves? Shouldn't they will be added automatically in the bucket if they are available?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the safety reason if anything happens than the verification can be smoothly done by checksum file.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean that in any case the packages are not uploaded online, then we can check it via Checksum? I am not very much convinced. What do you think @nemesifier ? |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change was required? We are already defining
envin the next command where they are neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to answer you so late ,i have reason besides that
the reason for defining the env variable "Define Storage Paths" is for readability ,reuse because the paths are bit long and used in many commands i think it will be simple for maintainability
i edited the file while learning yaml so i searched and found out that adding the env variable can be good for reuse
if these change are bad then i would remove them and edit the file .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have been good if these env variables were used anywhere else. These variables are specific for Google Cloud only and therefore added there.
I don't think moving them upwards solves any for our use case.