Compare commits

..

2 Commits

Author SHA1 Message Date
5d0f161fd2 add ci 2022-12-08 22:49:51 +04:00
7c5be73c71 cleanup for modcache 2022-12-08 22:48:14 +04:00
4 changed files with 32 additions and 16 deletions

22
.drone.yml Normal file
View File

@ -0,0 +1,22 @@
# 345678911234567892123456789312345678941234567895123456789612345678971234567898
kind: pipeline
name: build-and-upload
steps:
- name: build-and-push
image: plugins/docker
network_mode: bridge
settings:
repo: sneak/builder
custom_dns: [ 116.202.204.30 ]
tags:
- ${DRONE_COMMIT_SHA}
- ${DRONE_BRANCH}
- latest
- name: notify
image: plugins/slack
settings:
webhook:
from_secret: SLACK_WEBHOOK_URL
when:
event: pull_request

View File

@ -5,7 +5,8 @@ FROM debian:bullseye-20221205
ENV DEBIAN_FRONTEND noninteractive
ENV NVM_DIR /usr/local/nvm
ENV GOROOT /usr/local/go
ENV PATH $PATH:/usr/local/go/bin:/root/go/bin
ENV GOPATH /root/go
ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin:$NVM_DIR/versions/node/v18.12.1/bin
RUN --mount=type=cache,target=/var/cache/apt \
apt update && apt install -y \
@ -33,9 +34,7 @@ RUN rm -rf /usr/local/go && \
tar -C /usr/local -xzf go*.linux-$(uname -m).tar.gz && \
echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
RUN go version
RUN mkdir -p "$(go env GOMODCACHE)" && cd $(go env GOMODCACHE)/../ && tar xvf /tmp/modcache.tar && rm /tmp/modcache.tar && cd /tmp
RUN mkdir -p "$(go env GOMODCACHE)" && cd $(go env GOMODCACHE) && tar xvf /tmp/modcache.tar && rm /tmp/modcache.tar && cd /tmp
RUN \
go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \

View File

@ -44,4 +44,4 @@ push:
docker push $(RN):$(shell git branch --show-current)
deps/modcache.tar:
cd $(shell go env GOMODCACHE)/../ && tar -c . | pv > $(PWD)/deps/modcache.tar
cd $(shell go env GOMODCACHE)/ && tar -c . | pv > $(PWD)/deps/modcache.tar

View File

@ -1,29 +1,24 @@
#!/bin/bash
################################################################################
#2345678911234567892123456789312345678941234567895123456789612345678971234567898
## that's a hell of an act. what do you call it? "JAVASCRIPT"
################################################################################
cd /tmp
mkdir -p "$NVM_DIR"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
echo "export NVM_DIR=$NVM_DIR" >> /etc/profile
echo "source \$NVM_DIR/nvm.sh" >> /etc/profile
source /etc/profile
NCD="/usr/local/nvm/.cache/bin/node-v18.12.1-linux-arm64/"
CD="/usr/local/nvm/.cache/bin/node-v18.12.1-linux-arm64/"
mkdir -p "$NCD"
mv /tmp/node-v18.12.1-linux-arm64.tar.xz "$NCD"
nvm ls-remote
nvm install v18.12.1
nvm use v18.12.1
npm install -g npm@9.2.0
npm install -g yarn
yarn global add prettier
prettier --version
which npm
which yarn
################################################################################
## cleanup
################################################################################
rm -rf /usr/local/nvm/.cache /tmp/*