This repository was archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cameron Taggart
committed
Apr 24, 2016
1 parent
b858359
commit 5346e8f
Showing
10 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.bash_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# https://github.com/ctaggart/golang-vscode | ||
# https://travis-ci.org/ctaggart/golang-vscode | ||
|
||
# Ubuntu Trusty 14.04 with Docker | ||
# https://docs.travis-ci.com/user/ci-environment/ | ||
# https://docs.travis-ci.com/user/docker/ | ||
sudo: required | ||
dist: trusty | ||
services: | ||
- docker | ||
language: rust | ||
|
||
env: | ||
global: | ||
- VERSION=0.0.1 | ||
|
||
# travis encrypt DOCKER_HUB_EMAIL=a DOCKER_HUB_USERNAME=b DOCKER_HUB_PASSWORD=c | ||
# - secure: "SBc8QcrGuSECRuwEoikP4dPM8Z2Gaddi7oANm2mbh/JmpdJuD8wn5ToFQc3ih4WI2IZRe7lnU7yxv2R/ZPVXlhIu+MZIcR0Bv9UJrHpGVJbeTTRMo13lBzSbIP93tcTc6IxRJin9s5mM2Hv8AJIsmX0Wx8I9zwRKwyrzNZffOz9ACsITxYW+OjM/vpURVMPdG75RkcWrhDuQOLqWneARLUiMqcFfg9ezxT2whfCI6ZRG81e/bLGutw2sqC9XTeVcszHq6l7rftUIEfjC/eheJwy6B0RNr3qH1srlUqxlMeoRcrPeUuAA01Oex4pXOHhToBngOQUHT+ydiDBwpqNuZrycqNOCLEQ0wng4JXQ0dtHqk8KXXn9ecf388u8Mf+k7DuyrW1K5QCnG9gpfTLcHYzuEkqy3cRQxHYMhMSAaMjHklMXmaNqAYESTet0y33vwLfPJxYntWAb784OABYpa6VTuJ4tmp0XrTkeFPHTBuo8byHoRDghepOeN/fsU5quSjM9sE/A3VJ9Rr2mU3Qk4znBHePsgzKqu8xQjyVGi9vMHCpnH0jcvb8bpEumPgGLBiKZNzLTgPUlKhS8eCJx3dnSQnS9kO+j8F0AVPebxl/CWvaB9rZ73FVSnjTLe/ryonCI9d/SnN9p7crp4vvpms7llIGOg9Hpibr+CzXdxg3k=" | ||
|
||
install: true | ||
|
||
script: | ||
- docker build -t ctaggart/golang-vscode:$VERSION . | ||
|
||
after_success: | ||
- if [ ! -z "$TRAVIS_TAG" ]; then | ||
docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD; | ||
docker push ctaggart/golang-vscode:$VERSION; | ||
docker tag -f ctaggart/golang-vscode:$VERSION ctaggart/golang-vscode:latest; | ||
docker push ctaggart/golang-vscode:latest; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# https://github.com/ctaggart/golang-vscode | ||
# https://hub.docker.com/r/ctaggart/golang-vscode/ | ||
|
||
# https://golang.org/ | ||
# https://hub.docker.com/_/golang/ | ||
# https://github.com/docker-library/golang | ||
FROM golang:latest | ||
|
||
COPY root /root | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# for development | ||
# ip=`ifconfig bridge100 | grep inet | awk '$1=="inet" {print $2}'` | ||
# docker run --rm -it -v $PWD/root:/root -w /root -e DISPLAY=$ip:0 golang:latest | ||
|
||
RUN cd /root \ | ||
&& ./install-apt-packages.sh \ | ||
&& useradd -m vscode -s /bin/bash \ | ||
&& cp install-vscode-extension*.sh /home/vscode/ \ | ||
&& chown vscode:vscode /home/vscode/install-vscode-extension*.sh \ | ||
&& su vscode -c /home/vscode/install-vscode-extensions.sh | ||
|
||
# TODO figure out how to launch it | ||
# CMD su vscode -c code /home/vscode | ||
# CMD ./start-vscode.sh | ||
WORKDIR /root | ||
CMD /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
docker build -t ctaggart/golang-vscode . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
apt-get update \ | ||
&& apt-get install -y --no-install-recommends unzip \ | ||
libgtk2.0-0 libgconf-2-4 libnss3 libasound2 libxtst6 \ | ||
&& curl -o vscode-amd64.deb -L https://go.microsoft.com/fwlink/?LinkID=760868 \ | ||
&& dpkg -i vscode-amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
# installs a Visual Studio Code extension by downloading and unzipping to $HOME/.vscode/extensions/ | ||
# requires curl and unzip | ||
if [ "$#" -ne 3 ]; then | ||
echo "3 parameters required, but given $#" | ||
exit 1 | ||
fi | ||
publisher=$1 | ||
extension=$2 | ||
version=$3 | ||
echo "downloading $publisher.$extension-$version.vsix" | ||
statuscode=$(curl --write-out "%{http_code}" -o /tmp/$publisher.$extension-$version.vsix https://$publisher.gallery.vsassets.io/_apis/public/gallery/publisher/$publisher/extension/$extension/$version/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage) | ||
echo "status code $statuscode" | ||
if [ $statuscode -ne 200 ]; then | ||
exit 2 | ||
fi | ||
rm -rf /tmp/extension/ | ||
unzip -q /tmp/$publisher.$extension-$version.vsix extension/* -d /tmp | ||
rm /tmp/$publisher.$extension-$version.vsix | ||
mkdir -p $HOME/.vscode/extensions/ | ||
rm -rf $HOME/.vscode/extensions/$publisher.$extension-$version/ | ||
mv /tmp/extension/ $HOME/.vscode/extensions/$publisher.$extension-$version/ | ||
echo "installed $HOME/.vscode/extensions/$publisher.$extension-$version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
dir=$(cd `dirname "$0"` && pwd) | ||
# publisher extension version | ||
$dir/install-vscode-extension.sh lukehoban Go 0.6.38 | ||
# $dir/install-vscode-extension.sh donjayamanne python 0.3.5 | ||
# $dir/install-vscode-extension.sh saviorisdead RustyCode 0.12.0 | ||
# $dir/install-vscode-extension.sh Ionide Ionide-fsharp 1.6.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
su vscode -c code /home/vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
open -a XQuartz | ||
xhost + # TODO limit to just the host | ||
# bridge100 is disappearing after a reboot | ||
ip=`ifconfig bridge100 | grep inet | awk '$1=="inet" {print $2}'` | ||
docker run --rm -it -w /root -e DISPLAY=$ip:0 ctaggart/golang-vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
open -a XQuartz | ||
xhost + $(docker-machine ip) | ||
# virtual box network, parallels was vnic0 | ||
ip=`ifconfig vboxnet1 | grep inet | awk '$1=="inet" {print $2}'` | ||
docker run --rm -it -w /root -e DISPLAY=$ip:0 ctaggart/golang-vscode |