Enable docker image builds

This commit is contained in:
simon987 2021-01-16 10:57:55 -05:00
parent 013c54daa0
commit 75e4e93ddd
4 changed files with 22 additions and 15 deletions

View File

@ -11,6 +11,20 @@ steps:
image: simon987/ubuntu_ci
commands:
- ./ci/build.sh
- name: docker
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: simon987/sist2
context: ./Docker/
dockerfile: ./Docker/Dockerfile
autotag: true
when:
event:
- tag
- name: scp files
image: appleboy/drone-scp
settings:
@ -24,6 +38,7 @@ steps:
from_secret: SSH_KEY
target: /files/sist2/${DRONE_REPO_OWNER}_${DRONE_REPO_NAME}/${DRONE_BRANCH}_${DRONE_BUILD_NUMBER}_${DRONE_COMMIT}/
source:
- ./VERSION
- ./sist2-x64-linux
- ./sist2-x64-linux-debug.tar.gz
@ -54,3 +69,7 @@ steps:
target: /files/sist2/${DRONE_REPO_OWNER}_${DRONE_REPO_NAME}/${DRONE_BRANCH}_${DRONE_BUILD_NUMBER}_${DRONE_COMMIT}/
source:
- ./sist2-arm64-linux
volumes:
- name: dockersock
temp: {}

View File

@ -1,4 +1,4 @@
FROM ubuntu:19.10
FROM ubuntu:20.04
MAINTAINER simon987 <me@simon987.net>
RUN apt update

View File

@ -1,14 +0,0 @@
rm ./sist2 sist2_debug
cp ../sist2.gz .
gzip -d sist2.gz
strip sist2
version=$(./sist2 --version)
echo "Version ${version}"
docker build . -t simon987/sist2:${version} -t simon987/sist2:latest
docker push simon987/sist2:${version}
docker push simon987/sist2:latest
docker run --rm simon987/sist2 -v

View File

@ -10,6 +10,8 @@ rm -rf CMakeFiles CMakeCache.txt
cmake -DSIST_DEBUG=off -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" .
make -j 33
strip sist2
./sist2 -v > VERSION
cp sist2 Docker/
mv sist2 sist2-x64-linux
rm -rf CMakeFiles CMakeCache.txt