diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..fbc482d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,64 @@ +kind: pipeline +type: docker +name: siska-pipeline + +platform: + os: linux + arch: arm64 + +steps: + - name: build-image-dev + image: docker:24.0.7-dind + environment: + DOCKER_BUILDKIT: "1" + REGISTRY_USERNAME: + from_secret: registry_username + REGISTRY_PASSWORD: + from_secret: registry_password + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - apk add --no-cache curl bash + - echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USERNAME" --password-stdin registry.git.appstaging.my.id + - docker buildx create --use --name mybuilder || true + - docker buildx build --platform linux/arm64 -t registry.git.appstaging.my.id/reihanrere/sistem-akademik/sistem-akademik-dev -f Dockerfile . --push + + - name: deploy-image-dev + image: debian:latest + environment: + SSH_KEY_M4: + from_secret: ssh_key_m4 + REGISTRY_USERNAME: + from_secret: registry_username + REGISTRY_PASSWORD: + from_secret: registry_password + commands: + - apt-get update -qq && apt-get install -qq git openssh-client + - mkdir -p ~/.ssh + - echo "$SSH_KEY_M4" | base64 -d > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - | + cat < ~/.ssh/config + Host * + StrictHostKeyChecking no + EOF + - chmod 600 ~/.ssh/config + - | + ssh -i ~/.ssh/id_rsa opc@138.2.102.242 < + sh -c " + composer install --no-interaction --prefer-dist && + php artisan config:cache && + php artisan route:cache && + php artisan view:cache && + php artisan migrate --force && + php-fpm + " + +networks: + traefik_default: + external: true