@@ -22,7 +22,8 @@ import { dockerExec, dockerIp, dockerRun, dockerStop } from "../docker";
22
22
import { getFreePort } from "../utils/port" ;
23
23
import { SynapseInstance } from "../synapsedocker" ;
24
24
25
- // A cypress plugins to add command to start & stop https://github.com/matrix-org/sliding-sync
25
+ // A cypress plugin to add command to start & stop https://github.com/matrix-org/sliding-sync
26
+ // SLIDING_SYNC_PROXY_TAG env used as the docker tag to use for `ghcr.io/matrix-org/sliding-sync-proxy` image.
26
27
27
28
export interface ProxyInstance {
28
29
containerId : string ;
@@ -34,7 +35,7 @@ const instances = new Map<string, ProxyInstance>();
34
35
35
36
const PG_PASSWORD = "p4S5w0rD" ;
36
37
37
- async function proxyStart ( synapse : SynapseInstance ) : Promise < ProxyInstance > {
38
+ async function proxyStart ( dockerTag : string , synapse : SynapseInstance ) : Promise < ProxyInstance > {
38
39
console . log ( new Date ( ) , "Starting sliding sync proxy..." ) ;
39
40
40
41
const postgresId = await dockerRun ( {
@@ -75,9 +76,9 @@ async function proxyStart(synapse: SynapseInstance): Promise<ProxyInstance> {
75
76
}
76
77
77
78
const port = await getFreePort ( ) ;
78
- console . log ( new Date ( ) , "starting proxy container..." ) ;
79
+ console . log ( new Date ( ) , "starting proxy container..." , dockerTag ) ;
79
80
const containerId = await dockerRun ( {
80
- image : "ghcr.io/matrix-org/sliding-sync-proxy:v0.6.0" ,
81
+ image : "ghcr.io/matrix-org/sliding-sync-proxy:" + dockerTag ,
81
82
containerName : "react-sdk-cypress-sliding-sync-proxy" ,
82
83
params : [
83
84
"--rm" ,
@@ -114,8 +115,10 @@ async function proxyStop(instance: ProxyInstance): Promise<void> {
114
115
* @type {Cypress.PluginConfig }
115
116
*/
116
117
export function slidingSyncProxyDocker ( on : PluginEvents , config : PluginConfigOptions ) {
118
+ const dockerTag = config . env [ "SLIDING_SYNC_PROXY_TAG" ] ;
119
+
117
120
on ( "task" , {
118
- proxyStart,
121
+ proxyStart : proxyStart . bind ( null , dockerTag ) ,
119
122
proxyStop,
120
123
} ) ;
121
124
0 commit comments