From 0d0641d62d921ceed5f433942b344e20f40f176d Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 19:39:32 -0500 Subject: [PATCH 1/7] Test NPM and Docker login --- .drone.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..23d90d0a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +kind: pipeline +type: exec +name: Build and Push Docker Image + +platform: + os: linux + arch: amd64 + +steps: +- name: Build + environment: + QUAY_USERNAME: + from_secret: QUAY_USERNAME + QUAY_PASSWORD: + from_secret: QUAY_PASSWORD + commands: + - npm i + - docker login -u $QUAY_USERNAME -p $QUAY_PASSWORD \ No newline at end of file From a5e82af61d0115727c85de6c1e5704d77366b316 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 19:55:54 -0500 Subject: [PATCH 2/7] Use STDIN to allow login without TTY --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 23d90d0a..d0a28500 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,4 +15,4 @@ steps: from_secret: QUAY_PASSWORD commands: - npm i - - docker login -u $QUAY_USERNAME -p $QUAY_PASSWORD \ No newline at end of file + - docker login --username $QUAY_USERNAME --password-stdin $QUAY_PASSWORD \ No newline at end of file From 07c416b954589bdfcf7f9d3bb32276c7792e4949 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 19:59:51 -0500 Subject: [PATCH 3/7] Change method for Docker Login --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d0a28500..4da77b29 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,4 +15,4 @@ steps: from_secret: QUAY_PASSWORD commands: - npm i - - docker login --username $QUAY_USERNAME --password-stdin $QUAY_PASSWORD \ No newline at end of file + - echo $QUAY_PASSWORD | docker login --username $QUAY_USERNAME --password-stdin From 66798d977c11d3173f2de001209cb380c47f5c0b Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 20:03:02 -0500 Subject: [PATCH 4/7] Forgot to set Quay.io as registry --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4da77b29..8d55add1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,4 +15,4 @@ steps: from_secret: QUAY_PASSWORD commands: - npm i - - echo $QUAY_PASSWORD | docker login --username $QUAY_USERNAME --password-stdin + - echo $QUAY_PASSWORD | docker login quay.io --username $QUAY_USERNAME --password-stdin From 3c6b31b0044185aae7240f2ea84ea450348c9ba6 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 20:07:17 -0500 Subject: [PATCH 5/7] Test build and push --- .drone.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 8d55add1..06e78ec3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: exec -name: Build and Push Docker Image +name: Build and Push Docker Image (Quay) platform: os: linux @@ -16,3 +16,5 @@ steps: commands: - npm i - echo $QUAY_PASSWORD | docker login quay.io --username $QUAY_USERNAME --password-stdin + - docker build -t quay.io/sudovanilla/poketube . + - docker push quay.io/sudovanilla/poketube \ No newline at end of file From cdf57988bebf05aa3ad3c94edd0822f3cb927c6a Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 20:09:59 -0500 Subject: [PATCH 6/7] Install `npm` when building Docker image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c934dca0..66f2062b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg - RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt-get update -RUN apt-get -y install nodejs +RUN apt-get -y install nodejs npm # Install Packages RUN npm install From 0982dafc20c71acde105221ee13f71778c64afb6 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 26 Jan 2024 20:15:09 -0500 Subject: [PATCH 7/7] Don't install modules in Drone build, only in Docker. --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 06e78ec3..4f0b5ae9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,6 @@ steps: QUAY_PASSWORD: from_secret: QUAY_PASSWORD commands: - - npm i - echo $QUAY_PASSWORD | docker login quay.io --username $QUAY_USERNAME --password-stdin - docker build -t quay.io/sudovanilla/poketube . - docker push quay.io/sudovanilla/poketube \ No newline at end of file