Merge branch 'dev' into production
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is failing Details

production
Override-6 2 years ago
commit 9342f3969d

@ -5,16 +5,16 @@ name: Deployment
steps:
- name: Unit tests
image: amazoncorretto:11
image: override6/tbasket-backend:latest
volumes:
- name: build
path: ./build
commands:
- echo
- ./gradlew :test
- ./gradlew :shadowJar
- name: Deploy
image: amazoncorretto:11
image: override6/tbasket-backend:latest
depends_on:
- 'Unit tests'
environment:

@ -3,7 +3,6 @@
chmod 700 ./drone/prepare-deliver.sh
source ./drone/prepare-deliver.sh
./gradlew :shadowJar
echo "making delivery onto '$USER@$IP:$DIR/backend'"
scp -o "StrictHostKeyChecking no" "build/libs/server-all.jar" "drone/deploy.sh" "drone/start.sh" "$USER@$IP:$DIR/backend"

@ -0,0 +1,10 @@
# syntax=override6/tbasket-end:latest
FROM ubuntu:latest
RUN apt update &&\
apt install openjdk-11-jdk openssh-client wget unzip -y &&\
wget https://services.gradle.org/distributions/gradle-7.5.1-bin.zip &&\
mkdir /opt/gradle &&\
unzip -d /opt/gradle gradle-7.5.1-bin.zip &&\
export GRADLE_HOME=/opt/gradle/gradle-7.5.1

@ -1,22 +1,5 @@
#!/usr/bin/env bash
echo "installing packages..."
#use the right command to install packages
if [ "$(command -v apt)" ]; then
apt update > /dev/null
apt -y install openssh-client openssh-clients > /dev/null
elif [ "$(command -v yum)" ]; then
yum update > /dev/null
yum -y install openssh-client openssh-clients > /dev/null
elif [ "$(command -v apk)" ]; then
apk update > /dev/null
apk add openssh > /dev/null
else
echo "could not find a package manager, aborting" >&2
exit 1
fi
echo "done."
mkdir /root/.ssh
echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
chmod 0600 /root/.ssh/*
@ -26,15 +9,15 @@ case "$DRONE_BRANCH" in
"dev")
USER=maxime
IP=92.132.18.192
DIR=server/TBasket/
DIR=server/TBasket
;;
"production")
USER=palafour
IP=193.49.118.205
DIR=public_html/TBasket/
USER=mabatista1
IP=lisbonne.iut-clermont.uca.fr
DIR=tbasket/backend
;;
"")
echo "DRONE_BRANCH is missing" >&2
echo '$DRONE_BRANCH is missing' >&2
exit 1
;;
*)