-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1163 from isomerpages/release/0.67.0
Release/0.67.0 (prod)
- Loading branch information
Showing
24 changed files
with
651 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ RUN echo "[user]" > /root/.gitconfig | |
RUN echo " name = Isomer Admin" >> /root/.gitconfig | ||
RUN echo " email = [email protected]" >> /root/.gitconfig | ||
|
||
RUN chmod +x ./scripts/02_fetch_ssh_keys.sh | ||
|
||
EXPOSE "8081" | ||
CMD ["bash", "-c", "chmod +x ./scripts/02_fetch_ssh_keys.sh && bash ./scripts/02_fetch_ssh_keys.sh & npm run start:ecs"] | ||
CMD ["bash", "-c", "bash ./scripts/02_fetch_ssh_keys.sh & npm run start:ecs:$NODE_ENV"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,15 @@ import { ResultAsync, errAsync, fromPromise, okAsync } from "neverthrow" | |
|
||
import { config } from "@config/config" | ||
|
||
import { lock, unlock } from "@utils/mutex-utils" | ||
|
||
import { | ||
EFS_VOL_PATH_STAGING, | ||
EFS_VOL_PATH_STAGING_LITE, | ||
} from "@root/constants" | ||
import GitFileSystemError from "@root/errors/GitFileSystemError" | ||
import InitializationError from "@root/errors/InitializationError" | ||
import LockedError from "@root/errors/LockedError" | ||
import { consoleLogger } from "@root/logger/console.logger" | ||
import logger from "@root/logger/logger" | ||
import { attachFormSGHandler } from "@root/middleware" | ||
|
@@ -114,15 +117,20 @@ export class FormsgGGsRepairRouter { | |
} | ||
|
||
handleGGsFormSubmission = (repoNames: string[], requesterEmail: string) => { | ||
const repairs: ResultAsync<string, GitFileSystemError>[] = [] | ||
const repairs: ResultAsync<string, GitFileSystemError | LockedError>[] = [] | ||
|
||
const clonedStagingRepos: string[] = [] | ||
const syncedStagingAndStagingLiteRepos: string[] = [] | ||
const LOCK_TIME_SECONDS = 15 * 60 // 15 minutes | ||
repoNames.forEach((repoName) => { | ||
const repoUrl = `[email protected]:isomerpages/${repoName}.git` | ||
|
||
repairs.push( | ||
this.doesRepoNeedClone(repoName) | ||
ResultAsync.fromPromise( | ||
lock(repoName, LOCK_TIME_SECONDS), | ||
(err) => new LockedError(`Unable to lock repo ${repoName}`) | ||
) | ||
.andThen(() => this.doesRepoNeedClone(repoName)) | ||
.andThen(() => { | ||
const isStaging = true | ||
return ( | ||
|
@@ -166,6 +174,15 @@ export class FormsgGGsRepairRouter { | |
return okAsync(result) | ||
}) | ||
) | ||
.andThen((result) => { | ||
// Failure to unlock is not blocking | ||
ResultAsync.fromPromise(unlock(repoName), () => { | ||
logger.error( | ||
"Failed to unlock repo - repo will unlock after at most 15 min" | ||
) | ||
}) | ||
return okAsync(result) | ||
}) | ||
) | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.