File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed
integration-tests/js-compute/fixtures/secret-store Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,11 @@ let stores = await (async function() {
29
29
}
30
30
} ( ) )
31
31
32
- process . env . STORE_ID = stores . data . find ( ( { name } ) => name === 'example-test-secret-store' ) ?. id
33
- if ( ! process . env . STORE_ID ) {
32
+ const STORE_ID = stores . data . find ( ( { name } ) => name === 'example-test-secret-store' ) ?. id
33
+ if ( ! STORE_ID ) {
34
34
process . env . STORE_ID = JSON . parse ( await zx `fastly secret-store create --name=example-test-secret-store --json --token $FASTLY_API_TOKEN` ) . id
35
+ } else {
36
+ process . env . STORE_ID = STORE_ID ;
35
37
}
36
38
37
39
try {
@@ -43,5 +45,6 @@ let key = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
43
45
} catch { }
44
46
45
47
await zx `fastly resource-link create --version latest --resource-id $STORE_ID --token $FASTLY_API_TOKEN --autoclone`
48
+ await zx `fastly service-version activate --version latest --token $FASTLY_API_TOKEN`
46
49
47
50
console . log ( `Set up has finished! Took ${ ( Date . now ( ) - startTime ) / 1000 } seconds to complete` ) ;
Original file line number Diff line number Diff line change @@ -23,12 +23,25 @@ let stores = await (async function() {
23
23
return { data :[ ] }
24
24
}
25
25
} ( ) )
26
-
27
- process . env . STORE_ID = stores . data . find ( ( { name } ) => name === 'example-test-secret-store' ) ?. id
28
- if ( process . env . STORE_ID ) {
26
+ let links = await ( async function ( ) {
29
27
try {
30
- await zx `fastly resource-link delete --version latest --autoclone --id=$STORE_ID --token $FASTLY_API_TOKEN`
31
- } catch { }
28
+ return JSON . parse ( await zx `fastly resource-link list --json --version latest --token $FASTLY_API_TOKEN` )
29
+ } catch {
30
+ return [ ]
31
+ }
32
+ } ( ) )
33
+
34
+ const STORE_ID = stores . data . find ( ( { name } ) => name === 'example-test-secret-store' ) ?. id
35
+ if ( STORE_ID ) {
36
+ process . env . STORE_ID = STORE_ID ;
37
+ let LINK_ID = links . find ( ( { resource_id} ) => resource_id == STORE_ID ) ?. id ;
38
+ if ( LINK_ID ) {
39
+ process . env . LINK_ID = LINK_ID ;
40
+ try {
41
+ await zx `fastly resource-link delete --version latest --autoclone --id=$LINK_ID --token $FASTLY_API_TOKEN`
42
+ await zx `fastly service-version activate --version latest --token $FASTLY_API_TOKEN`
43
+ } catch { }
44
+ }
32
45
try {
33
46
await zx `fastly secret-store delete --store-id=$STORE_ID --token $FASTLY_API_TOKEN`
34
47
} catch { }
You can’t perform that action at this time.
0 commit comments