Skip to content

Commit

Permalink
Merge pull request #639 from linuxserver/code-server-golang-update
Browse files Browse the repository at this point in the history
code-server-golang update/add workflows
  • Loading branch information
aptalca committed May 21, 2023
2 parents 60d5910 + a2ba44e commit 98c6cd2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/BuildImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
- uses: actions/checkout@v3

- name: Build image
run: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/call_issue_pr_tracker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Issue & PR Tracker

on:
issues:
types: [opened,reopened,labeled,unlabeled,closed]
pull_request_target:
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed]
pull_request_review:
types: [submitted,edited,dismissed]

jobs:
manage-project:
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
secrets: inherit
10 changes: 10 additions & 0 deletions .github/workflows/permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Permission check
on:
pull_request_target:
paths:
- '**/run'
- '**/finish'
- '**/check'
jobs:
permission_check:
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.15 as buildstage
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage

ARG GO_VERSION

RUN \
apk add --no-cache \
curl \
grep && \
if [ -z ${GO_VERSION+x} ]; then \
GO_VERSION=$(curl -sLX GET https://go.dev/dl/ | grep -o '<span.*>.*linux-amd64.*</span>' | grep -oP '(?<=go).*(?=.linux)'); \
Expand Down
3 changes: 0 additions & 3 deletions root/etc/cont-init.d/95-apt-get

This file was deleted.

25 changes: 0 additions & 25 deletions root/etc/cont-init.d/98-golang

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/usr/bin/with-contenv bash

echo "**** ensuring golang is in PATH ****"
if grep -q -E '^(export )?PATH=' /etc/s6-overlay/s6-rc.d/svc-code-server/run; then
if ! grep -q -E '^(export )?PATH=.*/usr/local/go/bin.*' /etc/s6-overlay/s6-rc.d/svc-code-server/run; then
sed -i '/PATH/ s/$/:\/usr\/local\/go\/bin/' /etc/s6-overlay/s6-rc.d/svc-code-server/run
fi
if ! grep -q -E '^(export )?PATH=.*/config/go/bin:.*' /etc/s6-overlay/s6-rc.d/svc-code-server/run; then
sed -i 's/PATH=/PATH=\/config\/go\/bin:/g' /etc/s6-overlay/s6-rc.d/svc-code-server/run
fi
else
sed -i '/^#!\/usr\/bin/a \\n# Added by codeserver-golang\nexport PATH=/config/go/bin:$PATH:/usr/local/go/bin' /etc/s6-overlay/s6-rc.d/svc-code-server/run
if ! grep -q '/usr/local/go/bin' /var/run/s6/container_environment/PATH; then
printf ':/usr/local/go/bin' >> /var/run/s6/container_environment/PATH
fi
if ! grep -q '/config/go/bin' /var/run/s6/container_environment/PATH; then
sed -i '1s|^|/config/go/bin:|' /var/run/s6/container_environment/PATH
fi

ARCH=$(uname -m)
Expand Down

0 comments on commit 98c6cd2

Please sign in to comment.