Commit 2169a3cc authored by Leo Leung's avatar Leo Leung
Browse files

Moved before script contents into the job

Making .ssh directory
parent 1c8641c5
Pipeline #112 passed with stages
in 1 minute and 39 seconds
......@@ -6,17 +6,14 @@ stages:
- Build image and push
- Update production
# Retrieve the radarr version being built
before_script:
- export VERSION=$(wget -q -O - https://factorio.com/download-headless/experimental | grep get-download | sed -n -e 's/.*download\/\([0-9\.]*\)\/.*/\1/p' | head -n 1 )
- echo "Building factorio server version $VERSION"
docker build:
stage: Build image and push
only:
- custom
image: docker:stable
script:
- export VERSION=$(wget -q -O - https://factorio.com/download-headless/experimental | grep get-download | sed -n -e 's/.*download\/\([0-9\.]*\)\/.*/\1/p' | head -n 1 )
- echo "Building factorio server version $VERSION"
- docker info
- cd 0.17
- docker build -t $IMAGE_TAG:latest -t $IMAGE_TAG:$VERSION --build-arg VERSION --no-cache .
......@@ -32,6 +29,7 @@ update running image:
script:
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > /keys
- chmod 600 /keys
- mkdir ~/.ssh
- ssh-keyscan $SSH_SERVER >> ~/.ssh/known_hosts
- ssh -i /keys remote@$SSH_SERVER docker-compose -f /root/docker/running/factorio/docker-compose.yml pull
- ssh -i /keys remote@$SSH_SERVER docker-compose -f /root/docker/running/factorio/docker-compose.yml up -d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment