Skip to content

Commit 5742537

Browse files
committed
Use CI dockerfile for pushing Docker image
1 parent 174cb2f commit 5742537

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.drone.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ steps:
5050
event: tag
5151

5252
- name: publish:docker
53-
image: banzaicloud/drone-kaniko
53+
image: plugins/docker
5454
settings:
5555
username:
5656
from_secret: docker_user
5757
password:
5858
from_secret: docker_password
59+
repo: codercom/code-server
60+
dockerfile: scripts/ci.dockerfile
5961
tags:
6062
- latest
6163
- v2
@@ -170,17 +172,19 @@ steps:
170172
event: tag
171173

172174
- name: publish:docker
173-
image: banzaicloud/drone-kaniko
175+
image: plugins/docker
174176
settings:
175177
username:
176178
from_secret: docker_user
177179
password:
178180
from_secret: docker_password
181+
repo: codercom/code-server
182+
dockerfile: scripts/ci.dockerfile
179183
tags:
180184
- arm64
181185
- ${DRONE_TAG}-arm64
182186
build_args:
183-
- tag=$DRONE_TAG
187+
- tag=${DRONE_TAG}
184188
when:
185189
event: tag
186190

@@ -289,17 +293,19 @@ steps:
289293
event: tag
290294

291295
- name: publish:docker
292-
image: banzaicloud/drone-kaniko
296+
image: plugins/docker
293297
settings:
294298
username:
295299
from_secret: docker_user
296300
password:
297301
from_secret: docker_password
302+
repo: codercom/code-server
303+
dockerfile: scripts/ci.dockerfile
298304
tags:
299305
- arm
300306
- ${DRONE_TAG}-arm
301307
build_args:
302-
- tag=$DRONE_TAG
308+
- tag=${DRONE_TAG}
303309
when:
304310
event: tag
305311

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ COPY . .
1212

1313
RUN yarn \
1414
&& DRONE_TAG="$tag" MINIFY=true BINARY=true GITHUB_TOKEN="$githubToken" ./scripts/ci.bash \
15-
&& mv /src/binaries/* /src/binaries/code-server \
1615
&& rm -r /src/build \
1716
&& rm -r /src/source
1817

scripts/ci.bash

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function main() {
2121
mv "vscode-$vscode_version-source" "source/vscode-$vscode_version-source"
2222
fi
2323

24-
# Only minify and package on tags since that's when releases are pushed.
24+
# Always minify and package on tags since that's when releases are pushed.
2525
if [[ -n ${DRONE_TAG:-} || -n ${TRAVIS_TAG:-} ]] ; then
2626
export MINIFY="true"
2727
export PACKAGE="true"
@@ -32,8 +32,17 @@ function main() {
3232
}
3333

3434
run-yarn build
35-
[[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] && run-yarn binary
36-
[[ -n ${PACKAGE:-} ]] && run-yarn package
35+
if [[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] ; then
36+
run-yarn binary
37+
fi
38+
if [[ -n ${PACKAGE:-} ]] ; then
39+
run-yarn package
40+
fi
41+
42+
# In this case provide a plainly named "code-server" binary.
43+
if [[ -n ${BINARY:-} ]] ; then
44+
mv binaries/code-server*-vsc* binaries/code-server
45+
fi
3746
}
3847

3948
main "$@"

0 commit comments

Comments
 (0)