File tree Expand file tree Collapse file tree 5 files changed +62
-0
lines changed
internal-scripts/ci-cd/publish Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 32
32
CI_ARTIFACTS_RUN_NUMBER : 329 # ${{ github.event.inputs.ci_artifacts_run_number || github.run_number }}
33
33
34
34
jobs :
35
+ test :
36
+ runs-on : ubuntu-24.04
37
+ environment : deploy
38
+ permissions :
39
+ id-token : write
40
+ steps :
41
+ - uses : actions/github-script@v7
42
+ id : get-id-token
43
+ # if: github.ref == 'refs/heads/main'
44
+ with :
45
+ script : |
46
+ const fs = require('fs');
47
+ const token = await core.getIDToken('backend.fullstaqruby.org');
48
+ fs.writeFileSync(
49
+ process.env.GITHUB_OUTPUT,
50
+ `id_token<<EOF\n${token}\nEOF\n`,
51
+ { flag: 'a' }
52
+ );
53
+
54
+ - name : Restart web server
55
+ run : ./internal-scripts/ci-cd/publish/restart-web-server.rb
56
+ # if: github.ref == 'refs/heads/main'
57
+ env :
58
+ ID_TOKEN : ${{ steps.get-id-token.outputs.id_token }}
59
+
60
+ - run : ' false'
61
+
35
62
# Determines which jobs should be run, or (in case this is a re-run)
36
63
# which jobs can be skipped this time because the last run succeeded.
37
64
# We determine this by checking whether the artifacts produced by jobs
38
65
# exist in this run.
39
66
determine_necessary_jobs :
40
67
name : Determine necessary jobs
68
+ needs : test
41
69
runs-on : ubuntu-24.04
42
70
environment : test
43
71
permissions :
Original file line number Diff line number Diff line change 22
22
CI_ARTIFACTS_RUN_NUMBER: 329 # ${{ github.event.inputs.ci_artifacts_run_number || github.run_number }}
23
23
24
24
jobs:
25
+ test:
26
+ runs-on: ubuntu-24.04
27
+ environment: deploy
28
+ permissions:
29
+ id-token: write
30
+ steps:
31
+ - uses: actions/github-script@v7
32
+ id: get-id-token
33
+ # if: github.ref == 'refs/heads/main'
34
+ with:
35
+ script: |
36
+ const fs = require('fs');
37
+ const token = await core.getIDToken('backend.fullstaqruby.org');
38
+ fs.writeFileSync(
39
+ process.env.GITHUB_OUTPUT,
40
+ `id_token << EOF \n${token}\nEOF\n`,
41
+ { flag: 'a' }
42
+ );
43
+
44
+ - name: Restart web server
45
+ run: ./internal-scripts/ci-cd/publish/restart-web-server.rb
46
+ # if: github.ref == 'refs/heads/main '
47
+ env:
48
+ ID_TOKEN: ${{ steps.get-id-token.outputs.id_token }}
49
+
50
+ - run: 'false'
51
+
25
52
# Determines which jobs should be run, or (in case this is a re-run)
26
53
# which jobs can be skipped this time because the last run succeeded.
27
54
# We determine this by checking whether the artifacts produced by jobs
28
55
# exist in this run.
29
56
determine_necessary_jobs:
30
57
name: Determine necessary jobs
58
+ needs: test
31
59
runs-on: ubuntu-24.04
32
60
environment: test
33
61
permissions:
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ jobs:
112
112
113
113
- uses : actions/github-script@v7
114
114
id : get-id-token
115
+ # if: github.ref == 'refs/heads/main'
115
116
with :
116
117
script : |
117
118
const fs = require('fs');
@@ -124,6 +125,7 @@ jobs:
124
125
125
126
- name : Restart web server
126
127
run : ./internal-scripts/ci-cd/publish/restart-web-server.rb
128
+ # if: github.ref == 'refs/heads/main'
127
129
env :
128
130
ID_TOKEN : ${{ steps.get-id-token.outputs.id_token }}
129
131
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ jobs:
102
102
103
103
- uses: actions/github-script@v7
104
104
id: get-id-token
105
+ # if: github.ref == 'refs/heads/main'
105
106
with:
106
107
script: |
107
108
const fs = require('fs');
@@ -114,6 +115,7 @@ jobs:
114
115
115
116
- name: Restart web server
116
117
run: ./internal-scripts/ci-cd/publish/restart-web-server.rb
118
+ # if: github.ref == 'refs/heads/main '
117
119
env:
118
120
ID_TOKEN: ${{ steps.get-id-token.outputs.id_token }}
119
121
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ def main
30
30
31
31
log_notice 'Waiting until web server is restarted'
32
32
deadline = Process . clock_gettime ( Process ::CLOCK_MONOTONIC ) + TIMEOUT_SECS
33
+ puts "deadline = #{ deadline } "
33
34
while true
35
+ puts "current time = #{ Process . clock_gettime ( Process ::CLOCK_MONOTONIC ) } "
34
36
if Process . clock_gettime ( Process ::CLOCK_MONOTONIC ) >= deadline
35
37
abort ( 'ERROR: Timed out waiting for web server to restart' )
36
38
end
You can’t perform that action at this time.
0 commit comments