Skip to content
Snippets Groups Projects
Commit cfcfb2cc authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Don't fail when SSH_KNOWN_HOSTS is undefined.

parent 7571649e
No related tags found
1 merge request!5Rewrite CI in TypeScript
Pipeline #1072 passed
......@@ -19,6 +19,7 @@ const {
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,
CI_MERGE_REQUEST_TARGET_BRANCH_NAME,
CI_PIPELINE_SOURCE,
SSH_KNOWN_HOSTS,
SSH_PRIVATE_KEY,
} = process.env
......@@ -55,6 +56,7 @@ async function configureSsh() {
await $`echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -`
}
if (SSH_KNOWN_HOSTS !== undefined) {
// Create the SSH directory and give it the right permissions
await $`mkdir -p ~/.ssh`
await $`chmod 700 ~/.ssh`
......@@ -62,6 +64,7 @@ async function configureSsh() {
await $`echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts`
await $`chmod 644 ~/.ssh/known_hosts`
}
}
async function createNewBranchWithUpdatedVersions() {
// Ensure that everything works.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment