18
18
shell : bash
19
19
run : |
20
20
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
22
22
23
23
- name : Setup dev environment
24
24
shell : bash
@@ -54,13 +54,10 @@ runs:
54
54
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"
55
55
sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
56
56
57
- - name : Prepare Docker Volume Caching
57
+ - name : Compute Docker Volume Cache Key
58
58
id : cache_key
59
59
shell : bash
60
60
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
64
61
source ${{ github.action_path }}/.env
65
62
# See https://explainshell.com/explain?cmd=ls%20-Rv1rpq
66
63
# for that long `ls` command
@@ -71,25 +68,23 @@ runs:
71
68
72
69
- name : Restore DB Volumes Cache
73
70
id : restore_cache
74
- uses : actions/ cache/restore@v4
71
+ uses : BYK/docker-volume- cache-action /restore@be89365902126f508dcae387a32ec3712df6b1cd
75
72
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 }}
77
74
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
84
81
85
82
- name : Install self-hosted
86
83
env :
87
84
SKIP_DB_MIGRATIONS : ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
88
85
shell : bash
89
86
run : |
90
87
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
93
88
# Add some customizations to test that path
94
89
cat <<EOT >> sentry/enhance-image.sh
95
90
#!/bin/bash
@@ -102,31 +97,20 @@ runs:
102
97
103
98
./install.sh --no-report-self-hosted-issues --skip-commit-check
104
99
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
-
117
100
- name : Save DB Volumes Cache
118
101
if : steps.restore_cache.outputs.cache-hit != 'true'
119
- uses : actions/ cache/save@v4
102
+ uses : BYK/docker-volume- cache-action /save@be89365902126f508dcae387a32ec3712df6b1cd
120
103
with :
121
104
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
126
109
127
110
- name : Integration Test
128
111
shell : bash
129
112
run : |
113
+ sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync
130
114
rsync -aW --no-compress --mkpath \
131
115
/var/lib/docker/volumes/sentry-postgres \
132
116
/var/lib/docker/volumes/sentry-clickhouse \
0 commit comments