Ich versuche mein GitLab CI zu konfigurieren, um automatisch meine Elixir App zu erstellen und jedes Mal neue Version zu erstellen, wenn es erfolgreich auf master
Zweig ist. Wenn es jedoch zu einer Bereitstellung kommt, schlägt es aufgrund eines alten Git-Repository auf dem Build-Server fehl.`mix edeliver build release` push veralteter Code zum Erstellen von Server beim Ausführen in GitLab CI runner
Meine .gitlab-ci.yml
Konfiguration:
image: 'elixir:1.3.3'
services:
- postgres
# …
staging:
stage: deploy
environment: staging
tags:
- elixir
before_script:
- mix local.hex --force
- mix do deps.get, compile
- 'which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)'
- eval $(ssh-agent -s)
- echo "$SSH_DEPLOY_STAGING_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
script:
- mix edeliver build release --revision=$CI_BUILD_REF --auto-version=git-revision
- mix edeliver deploy to staging
only:
- master
cache:
paths:
- _build/
- deps/
und Ausgabe von edeliver
auf CI (App Builder ist Distillery):
$ which ssh-agent || (apt-get update -y && apt-get install openssh-client -y)
/usr/bin/ssh-agent
$ eval $(ssh-agent -s)
Agent pid 373
$ echo "$SSH_DEPLOY_STAGING_KEY" | tr -d '\r' | ssh-add -
Identity added: (stdin) ([email protected])
$ mkdir -p ~/.ssh
$ mix edeliver build release --revision=$CI_BUILD_REF --auto-version=git-revision
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
BUILDING RELEASE OF ONEMEDICAL APP ON BUILD HOST
-----> Authorizing hosts
-----> Ensuring hosts are ready to accept git pushes
-----> Pushing new commits with git to: [email protected]
-----> Resetting remote hosts to 3faf1d077f95ce7207cac7d14dd25b33d648d710
fatal: Could not parse object '3faf1d077f95ce7207cac7d14dd25b33d648d710'.
A remote command failed on:
[email protected]
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 128:
set -e
cd /tmp/edeliver/app/builds
git reset --hard 3faf1d077f95ce7207cac7d14dd25b33d648d710
ERROR: Build failed: exit code 1
Lokal, wenn ich mix edeliver build
alles laufen reibungslos funktioniert, aber ich kann, warum nicht finden beim Laufen über CI schlägt dies fehl.