File tree 3 files changed +21
-12
lines changed
3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -212,16 +212,17 @@ jobs:
212
212
echo "Docker tags:";
213
213
docker images stoplight/spectral --format="{{ .Tag }}";
214
214
docker push stoplight/spectral:${GIT_SHA};
215
- if [[ -n "$DOCKER_BRANCH" ]]; then
216
- docker push stoplight/spectral:${DOCKER_BRANCH};
217
- fi
218
- if [[ -n "$CIRCLE_TAG" ]]; then
215
+ echo "Pushed stoplight/spectral:${GIT_SHA}";
216
+ if [ -n "$CIRCLE_TAG" ]; then
219
217
docker push stoplight/spectral:${FULL_VERSION} \
220
218
stoplight/spectral:${MINOR_VERSION} \
221
219
stoplight/spectral:${MAJOR_VERSION};
220
+ echo "Pushed stoplight/spectral:${FULL_VERSION}";
221
+ fi
222
+ if [ -n "$DOCKER_BRANCH" ]; then
223
+ docker push stoplight/spectral:${DOCKER_BRANCH};
224
+ echo "Pushed stoplight/spectral:${DOCKER_BRANCH}";
222
225
fi
223
-
224
-
225
226
226
227
release :
227
228
docker :
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ FROM node:16-alpine
3
3
WORKDIR /usr/src/spectral
4
4
5
5
COPY scripts/install.sh /usr/src/spectral/
6
- RUN ls -l
7
- RUN apk --no-cache add curl
8
- RUN ./install.sh
9
- RUN rm ./install.sh
6
+ COPY packages/cli/package.json /usr/src/spectral/
7
+ RUN apk --no-cache add curl jq
8
+ RUN ./install.sh $(cat package.json | jq -r '.version' ) \
9
+ && rm ./install.sh && rm ./package.json
10
10
ENV NODE_ENV production
11
11
12
12
ENTRYPOINT [ "spectral" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+
4
+ VERSION=${1:- latest} ;
5
+
3
6
install () {
4
7
5
8
set -eu
@@ -24,7 +27,12 @@ elif [ "$UNAME" = "Linux" ] ; then
24
27
fi
25
28
fi
26
29
27
- URL=" https://github.com/stoplightio/spectral/releases/latest/download/${FILENAME} "
30
+ if [ " $VERSION " == " latest" ] ; then
31
+ URL=" https://github.com/stoplightio/spectral/releases/latest/download/${FILENAME} "
32
+ else
33
+ URL=" https://github.com/stoplightio/spectral/releases/download/v${VERSION} /${FILENAME} "
34
+ fi
35
+
28
36
SRC=" $( pwd) /${FILENAME} "
29
37
DEST=/usr/local/bin/spectral
30
38
40
48
fi
41
49
}
42
50
43
- install
51
+ install
You can’t perform that action at this time.
0 commit comments