optimisations drone
continuous-integration/drone/push Build is passing Details

production
Override-6 2 years ago
parent 60b4120f7e
commit 3d98a006ce

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

@ -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 #!/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 mkdir /root/.ssh
echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
chmod 0600 /root/.ssh/* chmod 0600 /root/.ssh/*
@ -26,7 +9,7 @@ case "$DRONE_BRANCH" in
"dev") "dev")
USER=maxime USER=maxime
IP=92.132.18.192 IP=92.132.18.192
DIR=server/TBasket/ DIR=server/TBasket
;; ;;
"production") "production")
USER=palafour USER=palafour