improvement: add asdf_install.sh script.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
James Harton 2023-07-19 16:04:00 +12:00
parent 484361944b
commit 1fd927af6d
Signed by: james
GPG key ID: 90E82DAA13F624F4
3 changed files with 19 additions and 27 deletions

View file

@ -4,28 +4,10 @@ name: default
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
REGISTRY_TOKEN:
image: plugins/docker
username: james
password:
from_secret: REGISTRY_TOKEN
commands:
- sleep 5
- echo $REGISTRY_TOKEN | docker login code.harton.nz -u james --password-stdin
- docker build -t asdf_container --cache-from=code.harton.nz/james/asdf_container:latest .
- docker tag asdf_container code.harton.nz/james/asdf_container:latest
- docker push code.harton.nz/james/asdf_container:latest
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
repo: code.harton.nz/james/asdf_container
tags:
- latest

View file

@ -26,7 +26,9 @@ ARG USER_GID=$USER_UID
RUN groupadd --gid ${USER_GID} ${USERNAME}
RUN useradd --shell /usr/bin/zsh --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME}
RUN touch /entrypoint.sh && chown ${USERNAME}:${USERNAME} /entrypoint.sh
RUN mkdir -p /var/tmp/history && chown -R ${USERNAME}:${USERNAME} /var/tmp/history
COPY asdf_install /usr/local/bin
RUN chmod 755 /usr/local/bin/asdf_install
USER ${USERNAME}
ENV HOME=/home/${USERNAME}

8
asdf_install Normal file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -e
source ~/.asdf/asdf.sh
cat .tool-versions | cut -d \ -f 1 | xargs -n 1 asdf plugin add
asdf install
cat .tool-versions | xargs -n 2 asdf global