1818 shell : bash
1919 run : |
2020 image_var=$(echo ${{ inputs.project_name }}_IMAGE | tr '[:lower:]' '[:upper:]')
21- echo "${image_var}=${{ inputs.image_url }}" >> ${{ github.action_path }}/ .env
21+ echo "${image_var}=${{ inputs.image_url }}" >> ${{ github.action_path }}.env
2222
2323 - name : Setup dev environment
2424 shell : bash
@@ -54,13 +54,10 @@ runs:
5454 sudo curl -L https://github.com/docker/compose/releases/download/${{ env.COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` -o "${{ env.COMPOSE_PATH }}/docker-compose"
5555 sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
5656
57- - name : Prepare Docker Volume Caching
57+ - name : Compute Docker Volume Cache Key
5858 id : cache_key
5959 shell : bash
6060 run : |
61- # Set permissions for docker volumes so we can cache and restore
62- sudo chmod o+x /var/lib/docker
63- sudo chmod -R o+rwx /var/lib/docker/volumes
6461 source ${{ github.action_path }}/.env
6562 # See https://explainshell.com/explain?cmd=ls%20-Rv1rpq
6663 # for that long `ls` command
@@ -71,25 +68,23 @@ runs:
7168
7269 - name : Restore DB Volumes Cache
7370 id : restore_cache
74- uses : actions/ cache/restore@v4
71+ uses : BYK/docker-volume- cache-action /restore@be89365902126f508dcae387a32ec3712df6b1cd
7572 with :
76- key : db-volumes-v5 -${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
73+ key : db-volumes-v6 -${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}-${{ steps.cache_key.outputs.SENTRY_MIGRATIONS_MD5 }}
7774 restore-keys : |
78- db-volumes-v5 -${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
79- db-volumes-v5 -
80- path : |
81- /var/lib/docker/volumes/ sentry-postgres/_data
82- /var/lib/docker/volumes/ sentry-clickhouse/_data
83- /var/lib/docker/volumes/ sentry-kafka/_data
75+ db-volumes-v6 -${{ steps.cache_key.outputs.SNUBA_MIGRATIONS_MD5 }}
76+ db-volumes-v6 -
77+ volumes : |
78+ sentry-postgres
79+ sentry-clickhouse
80+ sentry-kafka
8481
8582 - name : Install self-hosted
8683 env :
8784 SKIP_DB_MIGRATIONS : ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
8885 shell : bash
8986 run : |
9087 cd ${{ github.action_path }}
91- # This is for the cache restore on Kafka to work in older releases
92- docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
9388 # Add some customizations to test that path
9489 cat <<EOT >> sentry/enhance-image.sh
9590 #!/bin/bash
@@ -102,31 +97,20 @@ runs:
10297
10398 ./install.sh --no-report-self-hosted-issues --skip-commit-check
10499
105- - name : Prepare Docker Volume Caching
106- shell : bash
107- run : |
108- # Set permissions for docker volumes so we can cache and restore
109- # We need these for the backup/restore test snapshotting too
110- sudo chmod o+x /var/lib/docker
111- sudo chmod -R o+rx /var/lib/docker/volumes
112- # Set tar ownership for it to be able to read
113- # From: https://github.com/actions/toolkit/issues/946#issuecomment-1726311681
114- sudo chown root /usr/bin/tar && sudo chmod u+s /usr/bin/tar
115- sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync
116-
117100 - name : Save DB Volumes Cache
118101 if : steps.restore_cache.outputs.cache-hit != 'true'
119- uses : actions/ cache/save@v4
102+ uses : BYK/docker-volume- cache-action /save@be89365902126f508dcae387a32ec3712df6b1cd
120103 with :
121104 key : ${{ steps.restore_cache.outputs.cache-primary-key }}
122- path : |
123- /var/lib/docker/volumes/ sentry-postgres/_data
124- /var/lib/docker/volumes/ sentry-clickhouse/_data
125- /var/lib/docker/volumes/ sentry-kafka/_data
105+ volumes : |
106+ sentry-postgres
107+ sentry-clickhouse
108+ sentry-kafka
126109
127110 - name : Integration Test
128111 shell : bash
129112 run : |
113+ sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync
130114 rsync -aW --no-compress --mkpath \
131115 /var/lib/docker/volumes/sentry-postgres \
132116 /var/lib/docker/volumes/sentry-clickhouse \
0 commit comments