Skip to content

Commit

Permalink
Merge pull request #2 from linuxserver/insiders-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Roxedus committed Nov 29, 2021
2 parents c766915 + 35d1c54 commit 1de1f74
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
## Readme

If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-openvscode-server/edit/main/readme-vars.yml).
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-openvscode-server/edit/insiders/readme-vars.yml).

These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-openvscode-server)
Expand Down Expand Up @@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Update the changelog

If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-openvscode-server/tree/main/root), add an entry to the changelog
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-openvscode-server/tree/insiders/root), add an entry to the changelog

```yml
changelogs:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

------------------------------

- [ ] I have read the [contributing](https://github.com/linuxserver/docker-openvscode-server/blob/main/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-openvscode-server/blob/insiders/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications

------------------------------

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ on:
workflow_dispatch:

jobs:
external-trigger-main:
external-trigger-insiders:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: External Trigger
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/insiders'
run: |
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_MAIN }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_MAIN is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_INSIDERS }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_INSIDERS is set; skipping trigger. ****"
exit 0
fi
echo "**** External trigger running off of main branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_MAIN\". ****"
echo "**** External trigger running off of insiders branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_OPENVSCODE_SERVER_INSIDERS\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest | jq -r '. | .tag_name' | sed 's|^openvscode-server-v||')
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/gitpod-io/openvscode-server/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' | sed 's|^openvscode-server-insiders-v||')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for openvscode-server branch main"
FAILURE_REASON="Can't retrieve external version for openvscode-server branch insiders"
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-openvscode-server/actions/runs/${{ github.run_id }}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
Expand All @@ -32,7 +32,7 @@ jobs:
echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****"
image="linuxserver/openvscode-server"
tag="latest"
tag="insiders"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fopenvscode-server%3Apull" \
| jq -r '.token')
Expand All @@ -54,7 +54,7 @@ jobs:
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
if [ -z "${IMAGE_VERSION}" ]; then
echo "**** Can't retrieve last pushed version, exiting ****"
FAILURE_REASON="Can't retrieve last pushed version for openvscode-server tag latest"
FAILURE_REASON="Can't retrieve last pushed version for openvscode-server tag insiders"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -64,13 +64,13 @@ jobs:
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/main/lastBuild/api/json | jq -r '.building') == "true" ]; then
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/insiders/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
exit 0
else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/main/buildWithParameters?PACKAGE_CHECK=false \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/insiders/buildWithParameters?PACKAGE_CHECK=false \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand All @@ -85,7 +85,7 @@ jobs:
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"
echo "**** Notifying Discord ****"
TRIGGER_REASON="A version change was detected for openvscode-server tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
TRIGGER_REASON="A version change was detected for openvscode-server tag insiders. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- uses: actions/first-interaction@v1
with:
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-openvscode-server/blob/main/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-openvscode-server/blob/main/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-openvscode-server/blob/main/.github/PULL_REQUEST_TEMPLATE.md)!'
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-openvscode-server/blob/insiders/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-openvscode-server/blob/insiders/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-openvscode-server/blob/insiders/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/package_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ on:
workflow_dispatch:

jobs:
package-trigger-main:
package-trigger-insiders:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Package Trigger
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/insiders'
run: |
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_MAIN }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_MAIN is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_INSIDERS }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_INSIDERS is set; skipping trigger. ****"
exit 0
fi
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/main/lastBuild/api/json | jq -r '.building') == "true" ]; then
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/insiders/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
exit 0
fi
echo "**** Package trigger running off of main branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_MAIN\". ****"
echo "**** Package trigger running off of insiders branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_OPENVSCODE_SERVER_INSIDERS\". ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/main/buildWithParameters?PACKAGE_CHECK=true \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openvscode-server/job/insiders/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ RUN \
sudo && \
echo "**** install openvscode-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^openvscode-server-v||'); \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases" \
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' \
| sed 's|^openvscode-server-insiders-v||'); \
fi && \
mkdir -p /app/openvscode-server && \
curl -o \
/tmp/openvscode-server.tar.gz -L \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v${CODE_RELEASE}/openvscode-server-v${CODE_RELEASE}-linux-x64.tar.gz" && \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-insiders-v${CODE_RELEASE}/openvscode-server-insiders-v${CODE_RELEASE}-linux-x64.tar.gz" && \
tar xf \
/tmp/openvscode-server.tar.gz -C \
/app/openvscode-server/ --strip-components=1 && \
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ RUN \
sudo && \
echo "**** install openvscode-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^openvscode-server-v||'); \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases" \
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' \
| sed 's|^openvscode-server-insiders-v||'); \
fi && \
mkdir -p /app/openvscode-server && \
curl -o \
/tmp/openvscode-server.tar.gz -L \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v${CODE_RELEASE}/openvscode-server-v${CODE_RELEASE}-linux-arm64.tar.gz" && \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-insiders-v${CODE_RELEASE}/openvscode-server-insiders-v${CODE_RELEASE}-linux-arm64.tar.gz" && \
tar xf \
/tmp/openvscode-server.tar.gz -C \
/app/openvscode-server/ --strip-components=1 && \
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ RUN \
sudo && \
echo "**** install openvscode-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^openvscode-server-v||'); \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/gitpod-io/openvscode-server/releases" \
| jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' \
| sed 's|^openvscode-server-insiders-v||'); \
fi && \
mkdir -p /app/openvscode-server && \
curl -o \
/tmp/openvscode-server.tar.gz -L \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v${CODE_RELEASE}/openvscode-server-v${CODE_RELEASE}-linux-armhf.tar.gz" && \
"https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-insiders-v${CODE_RELEASE}/openvscode-server-insiders-v${CODE_RELEASE}-linux-armhf.tar.gz" && \
tar xf \
/tmp/openvscode-server.tar.gz -C \
/app/openvscode-server/ --strip-components=1 && \
Expand Down
Loading

0 comments on commit 1de1f74

Please sign in to comment.